ITPub博客

首页 > > > MACOS下minikube使用NFSd

MACOS下minikube使用NFSd

作者:frogwisperer 时间:2023-04-20 18:24:28 0 删除 编辑

一、NFSd配置

  1. 打开系统配置 System Preferences
  2. 点开安全和隐私 Security & Privacy → Privacy → Full Disk Access
  3. 点击 输入密码
  4. 点击 +
  5. 按下⌘ command + shift + G
  6. 键入/sbin/nfsd 并点击 Go, 然后点击Open
允许完全访问磁盘

注:这个选项会允许nfsd访问所有磁盘文件。

二、Minikube的安装

# minikube start --driver=hyperkit --container-runtime=containerd \
--image-mirror-country=cn --nfs-share=/Users/tom/Documents/letsencrypt \
--nfs-shares-root=/nfsshares
  minikube v1.19.0 on Darwin 11.3
 ▪ KUBECONFIG=/Users/tom/.kube/config
✨ Using the hyperkit driver based on user configuration
❗ None of the known repositories in your location are accessible. Using registry.cn-hangzhou.aliyuncs.com/google_containers as fallback.
✅ Using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
  Starting control plane node minikube in cluster minikube
  Creating hyperkit VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
  Preparing Kubernetes v1.20.2 on containerd 1.4.3 ...
 ▪ Generating certificates and keys ...
 ▪ Booting up control plane ...
 ▪ Configuring RBAC rules ...
  Configuring bridge CNI (Container Networking Interface) ...
  Verifying Kubernetes components...
 ▪ Using image registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-minikube/storage-provisioner:v5 (global image repository)
  Enabled addons: storage-provisioner, default-storageclass
  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
  1. 查看exports文件
> $ cat /etc/exports
# BEGIN: minikube-hyperkit minikube-/Users/tom/Documents/letsencrypt
/Users/tom/Documents/letsencrypt 192.168.64.15 -alldirs -mapall=tom
# END: minikube-hyperkit minikube-/Users/tom/Documents/letsencrypt

2. 在一些特别的场景下需要local_lock=all

需要重新remount一下,并带上local_lock=all 选项。

# minikube ssh 'su -c "mount -t nfs -o remount,rw -o local_lock=all 192.168.64.1:/Users/tom/Documents/letsencrypt /nfsshares/Users/tom/Documents/letsencrypt "'

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/86123/viewspace-3135015/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-02-14

  • 博文量
    22
  • 访问量
    169