1.pvc无法绑定成功
bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program
[root@K8S1 work]# kubectl describe -f fgedu-nginx-nfs1.yaml
Pod 'fgedu-nginx-nfs1': error 'pods "fgedu-nginx-nfs1" not found', but found events.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 11m default-scheduler Successfully assigned default/fgedu-nginx-nfs1 to k8s5
Warning FailedMount 6m42s kubelet Unable to attach or mount volumes: unmounted volumes=[nfs-app-pv001], unattached volumes=[kube-api-access-sblx6 nfs-app-pv001]: timed out waiting for the condition
Warning FailedMount 2m46s (x12 over 11m) kubelet MountVolume.SetUp failed for volume "nfs-app-pv001" : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs 192.168.1.11:/data/nfs/app-pv001 /var/lib/kubelet/pods/9b60dc70-37a2-40ec-b54f-4e496cf78575/volumes/kubernetes.io~nfs/nfs-app-pv001
Output: mount: /var/lib/kubelet/pods/9b60dc70-37a2-40ec-b54f-4e496cf78575/volumes/kubernetes.io~nfs/nfs-app-pv001: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
Warning FailedMount 2m8s (x3 over 8m58s) kubelet Unable to attach or mount volumes: unmounted volumes=[nfs-app-pv001], unattached volumes=[nfs-app-pv001 kube-api-access-sblx6]: timed out waiting for the condition
[root@K8S1 work]# mount 192.168.1.11:/data/nfs /data/nfs/
mount: /data/nfs: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
2.现在并安装nfs ;
原因是客户端未安装NFS;
https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/
nfs-utils-2.3.3-46.el8.x86_64.rpm
rpcbind-1.2.5-8.el8.x86_64.rpm
gssproxy-0.8.0-19.el8.x86_64.rpm
rpm -ivh gssproxy-0.8.0-19.el8.x86_64.rpm --nodeps
rpm -ivh rpcbind-1.2.5-8.el8.x86_64.rpm
rpm -ivh nfs-utils-2.3.3-46.el8.x86_64.rpm
systemctl start rpcbind
--重新Mount就可以mount成功
mount 192.168.1.11:/data/nfs /data/nfs/
centos8.4的安装包中没有nfs相关软件,需要单独下载,只需要启动 rpcbind便可 mount;