当出现了下面的错误
Mounting command: mount
Mounting arguments: -t nfs 192.168.10.108:/var/pv/prometheus /var/lib/kubelet/pods/896b0337-4ba0-4784-9eee-13665cf7ccaa/volumes/kubernetes.io~nfs/pv-prometheus
Output: mount.nfs: mounting 192.168.10.108:/var/pv/prometheus failed, reason given by server: No such file or directory
那么需要在这个机器上先创建对应的目录,在授予nfs 权限,重启nfs
mkdir /var/pv/prometheus
cat > /etc/exports <<-'EOF'
/var/pv/prometheus *(rw,async,no_root_squash)
EOF
systemctl restart rpcbind
systemctl enable rpcbind
systemctl restart nfs
systemctl enable nfs