在将GKE集群节点的镜像类型从container-vm迁移到cos之后,似乎不再可能为pod挂载NFS卷。
问题似乎是缺少NFS客户端库,因为我尝试了所有COS版本的挂载命令(cos-stable-58-9334-62-0,cos-beta-59-9460-20-0,cos-dev-60-9540-0-0)都失败了。
sudo mount -t nfs mynfsserver:/myshare /mnt
执行失败
mount: wrong fs type, bad option, bad superblock on mynfsserver:/myshare,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
但是这与此处列出的支持的卷类型相矛盾: https://cloud.google.com/container-engine/docs/node-image-migration#storage_driver_support 在一个使用镜像类型为
container-vm
的池中,在pod中挂载NFS卷是可行的,但在使用cos
时却不行。在使用cos时,当我执行
kubectl describe pod
命令时,会收到以下消息:MountVolume.SetUp failed for volume "kubernetes.io/nfs/b6e6cf44-41e7-11e7-8b00-42010a840079-nfs-mandant1" (spec.Name: "nfs-mandant1") pod "b6e6cf44-41e7-11e7-8b00-42010a840079" (UID: "b6e6cf44-41e7-11e7-8b00-42010a840079") with: mount failed: exit status 1
Mounting command: /home/kubernetes/containerized_mounter/mounter
Mounting arguments: singlefs-1-vm:/data/mandant1 /var/lib/kubelet/pods/b6e6cf44-41e7-11e7-8b00-42010a840079/volumes/kubernetes.io~nfs/nfs-mandant1 nfs []
Output: Mount failed: Mount failed: exit status 32
Mounting command: chroot
Mounting arguments: [/home/kubernetes/containerized_mounter/rootfs mount -t nfs singlefs-1-vm:/data/mandant1 /var/lib/kubelet/pods/b6e6cf44-41e7-11e7-8b00-42010a840079/volumes/kubernetes.io~nfs/nfs-mandant1]
Output: mount.nfs: Failed to resolve server singlefs-1-vm: Temporary failure in name resolution