如图状态一直为ContainerCreating。
先用命令kubectl describe pod nfs-client-xxxx -n xxxx
检查pod
原因是挂载的节点必须安装nfs的客户端,否则不适配、
执行命令安装nfs就好了
yum install nfs-utils
然后配置命令
echo "/nfs/data/ *(insecure,rw,sync,no_root_squash)" > /etc/exports
mkdir -p /nfs/data
systemctl enable rpcbind
systemctl enable nfs-server
systemctl start rpcbind
systemctl start nfs-server
exportfs -r
接着用命令exportfs
检查配置是否生效,显示/nfs/data <world>
即为成功