Nfs-subdir-external-provisioner
跳到导航
跳到搜索
ins
下载 https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
nfs-subdir-external-provisioner-master/deploy# cat deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: nfs-client-provisioner labels: app: nfs-client-provisioner # replace with namespace where provisioner is deployed namespace: default spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: nfs-client-provisioner template: metadata: labels: app: nfs-client-provisioner spec: serviceAccountName: nfs-client-provisioner containers: - name: nfs-client-provisioner image: registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:402 volumeMounts: - name: nfs-client-root mountPath: /persistentvolumes env: - name: PROVISIONER_NAME value: k8s-sigs.io/nfs-subdir-external-provisioner - name: NFS_SERVER value: 192.168.10.104 - name: NFS_PATH value: /data/k8s-pv volumes: - name: nfs-client-root nfs: server: 192.168.10.104 path: /data/k8s-pv kubectl apply -f class.yaml -f deployment.yaml -f rbac.yaml
trobule
MountVolume.SetUp failed for volume "nfs-client-root" : mount failed: exit status 32 Mounting command: mount Mounting arguments: -t nfs 192.168.10.104:/data/k8s-pv /var/lib/kubelet/pods/1b3135d7-32cb-407c-8a2b-b644c9d304e7/volumes/kubernetes.io~nfs/nfs-client-root Output: mount: /var/lib/kubelet/pods/1b3135d7-32cb-407c-8a2b-b644c9d304e7/volumes/kubernetes.io~nfs/nfs-client-root: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
To resolve this issue, install the nfs-client package on the host machine 在节点上安装就好了 搞半天 sudo apt install nfs-common