我的操作系统是 Ubuntu,使用 openshift,一个 pod 一直处于挂起状态,因为无法挂载 nfs 服务器(可以使用命令行手动挂载 nfs 服务器,但无法从 Pod 挂载)
我已经安装了 nfs-common,所以这不是根本原因。我尝试安装 nfs-utils,但失败了,错误消息是:
E:无法找到包:nfs-utils。
我也尝试了 libnfs12 和 libnfs-utils,它们和 nfs-utils 一样。我也使用 apt-get install upgade 和 update 来解决软件包定位问题,但它们毫无用处。
我将展示用于连接 nfs 服务器的 yaml 文件
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-test01
lables:
disktype: baas
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
nfs:
path: /baas
server: 9.111.140.47
readOnly: false
persistentVolumeReclaimPolicy: Recycle
对待处理的 Pod 使用“oc describe pod/mypod”后,反馈如下:
Warning FailedMount 14s kubelet, localhost MountVolume.SetUp failed for volume "pv-test01" : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/origin/cluster-up/root/openshift.local.clusterup/openshift.local.volumes/pods/267db6f2-d875-11e9-80ba-005056bc3ce0/volumes/kubernetes.io~nfs/pv-test01 --scope -- mount -t nfs 9.111.140.47:/baas /var/lib/origin/cluster-up/root/openshift.local.clusterup/openshift.local.volumes/pods/267db6f2-d875-11e9-80ba-005056bc3ce0/volumes/kubernetes.io~nfs/pv-test01
Output: Running scope as unit run-28094.scope.
mount: wrong fs type, bad option, bad superblock on 9.111.140.47:/baas,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
那么我如何从 Pod 挂载到 nfs 服务器?