k8s集群 MountVolume.SetUp failed for volume “nfspv1“ : mount failed: exit status 32

环境:创建服务并使用PVC 验证

pod创建后提示

describe 查询pod信息提示

k8s集群 MountVolume.SetUp failed for volume “nfspv1“ : mount failed: exit status 32_第1张图片

 【场景1】 mount.nfs: Connection refused k8s集群 MountVolume.SetUp failed for volume “nfspv1“ : mount failed: exit status 32_第2张图片

怀疑是k8s-node2节点上没有启动nfs服务,检查

# systemctl start nfs && systemctl enable nfs

服务器启动完成后pod恢复正常

【场景2】mount.nfs: mounting 192.168.66.100:/nfs1 failed, reason given by server: No such file or directory

手工挂载尝试

原来是nfs共享文件/etc/exports 没有对新目录进行配置,用户可以把需要共享的文件系统直接编辑到/etc/exports文件中,这样当NFS服务器重新启动时系统就会自动读取/etc/exports 文件

# echo "/nfs1 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

# echo "/nfs2 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

# echo "/nfs3 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

k8s集群 MountVolume.SetUp failed for volume “nfspv1“ : mount failed: exit status 32_第3张图片

 重启nfs服务

# systemctl restart nfs

再次手工挂载正常

 Pod运行正常

k8s集群 MountVolume.SetUp failed for volume “nfspv1“ : mount failed: exit status 32_第4张图片

 

添加

你可能感兴趣的:(K8s,linux,运维,服务器)