k8s 安装nfs_kubernetes挂载nfs报错 | 运维笔记

版本描述:

kubernetes 1.9.0

CentOS Linux release 7.2.1511 (Core)

问题描述:

kubernetes挂载nfs发现发现pod一直处于containercreating状态,describe pod 发现报错如下:

[root@master nginx-ip]# kubectl describe pod nginx-r67f7

Name:           nginx-r67f7

Namespace:      default

Node:           master/10.168.xx.xx

Start Time:     Sun, 10 Jun 2018 09:47:50 +0800

Labels:         name=nginx

Annotations:   

Status:         Pending

IP:

Controlled By:  ReplicationController/nginx

Containers:

nginx:

Container ID:

Image:          reg.xx.xx/library/nginx-ip:0.4

Image ID:

Port:           80/TCP

State:          Waiting

Reason:       ContainerCreating

Ready:          False

Restart Count:  0

Environment:   

Mounts:

/usr/share/nginx/html from httpd-storage (rw)

/var/run/secrets/kubernetes.io/serviceaccount from default-token-drh57 (ro)

Conditions:

Type          Status

Initialized   True

Ready         False

Volumes:

httpd-storage:

Type:      NFS (an NFS mount that lasts the lifetime of a pod)

Server:    10.168.xx.xx

Path:      /data/web

ReadOnly:  false

default-token-drh57:

Type:        Secret (a volume populated by a Secret)

SecretName:  default-token-drh57

Optional:    false

QoS Class:       BestEffort

Node-Selectors: 

Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s

node.kubernetes.io/unreachable:NoExecute for 300s

Events:

Type     Reason       Age   From                     Message

—-     ——       —-  —-                     ——-

Warning  FailedMount  18s   kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34311.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

Normal   SuccessfulMountVolume  18s  kubelet, master  MountVolume.SetUp succeeded for volume "default-token-drh57"

Warning  FailedMount            17s  kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34316.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

Warning  FailedMount  16s  kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34325.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

Warning  FailedMount  14s  kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34341.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

Warning  FailedMount  10s  kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34364.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

Warning  FailedMount  2s  kubelet, master  MountVolume.SetUp failed for volume "httpd-storage" : mount failed: exit status 32

Mounting command: systemd-run

Mounting arguments: –description=Kubernetes transient mount for /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage –scope — mount -t nfs 10.168.xx.xx:/data/web /var/lib/kubelet/pods/4868802e-6c50-11e8-b8b6-b083feea4d48/volumes/kubernetes.io~nfs/httpd-storage

Output: Running scope as unit run-34394.scope.

mount: wrong fs type, bad option, bad superblock on 10.168.xx.xx:/data/web,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog – try

dmesg | tail or so.

看这个报错想是容器没有安装nfs-common  nfs-utils软件包安装导致,容器安装完这两个包发现,还是报这个错误,经过不懈的google,终于发现需要将这两个软件包安装到宿主机上即可。

yum install nfs-common  nfs-utils -y

可能是因为镜像分层机制导致。

你可能感兴趣的:(k8s,安装nfs)