pv回收

学习cloudman中的k8s 152课,创建pod时,需要在k8s-host2 中挂着到在k8s-master 中/nfs中创建的挂载目录,结果提示没有/nfs/pv1

 

root@k8s-master:/nfs# kubectl describe pod mypod1
Name: mypod1
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: k8s-host2/10.11.124.102
Start Time: Tue, 05 Mar 2019 13:23:40 +0800
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"mypod1","namespace":"default"},"spec":{"co
Status: Pending
IP:
Containers:
mypod1:
Container ID:
Image: busybox
Image ID:
Port: <none>
Host Port: <none>
Args:
/bin/sh
-c
sleep 30000
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/mydata from mydata (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-9h9sl (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
mydata:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: mypvc1
ReadOnly: false
default-token-9h9sl:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-9h9sl
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 26m default-scheduler Successfully assigned default/mypod1 to k8s-host2
Warning FailedMount 26m kubelet, k8s-host2 MountVolume.SetUp failed for volume "mypv1" : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/d62d6952-3f06-11e9-b448-52540015401d/volumes/kkubernetes.io~nfs/mypv1
Output: Running scope as unit run-rfad22384ff4140fea68f814c5b6aca49.scope.
mount: wrong fs type, bad option, bad superblock on 10.11.124.100:/nfs/pv1,
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.
Warning FailedMount 26m kubelet, k8s-host2 MountVolume.SetUp failed for volume "mypv1" : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/d62d6952-3f06-11e9-b448-52540015401d/volumes/kkubernetes.io~nfs/mypv1
Output: Running scope as unit run-r9090a847cb034a65ba542db91fcb3319.scope.
mount: wrong fs type, bad option, bad superblock on 10.11.124.100:/nfs/pv1,
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

 

#################################################

下面是安装好nfs-common 后

root@k8s-master:/home/k8s# kubectl apply -f pod1.yml
pod/mypod1 configured
root@k8s-master:/home/k8s# kubectl delete -f pod1.yml
pod "mypod1" deleted
root@k8s-master:/home/k8s# kubectl get pods
NAME READY STATUS RESTARTS AGE
producer-consumer 2/2 Running 4 21h
root@k8s-master:/home/k8s# kubectl apply -f pod1.yml
pod/mypod1 created
root@k8s-master:/home/k8s# kubectl get pods
NAME READY STATUS RESTARTS AGE
mypod1 0/1 ContainerCreating 0 2s
producer-consumer 2/2 Running 4 21h
root@k8s-master:/home/k8s# kubectl get pods
NAME READY STATUS RESTARTS AGE
mypod1 0/1 ContainerCreating 0 5s
producer-consumer 2/2 Running 4 21h
root@k8s-master:/home/k8s# kubectl get pods
NAME READY STATUS RESTARTS AGE
mypod1 1/1 Running 0 15s
producer-consumer 2/2 Running 4 21h
root@k8s-master:/home/k8s# kubectl describe pod mypod1
Name: mypod1
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: k8s-host2/10.11.124.102
Start Time: Tue, 05 Mar 2019 14:19:10 +0800
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"mypod1","namespace":"default"},"spec":{"containers":[{"args":["/bin/s...
Status: Running
IP: 10.244.1.60
Containers:
mypod1:
Container ID: docker://a99be41e69135a5b52091cfd8a71a0d7bc03893ba805428414055d65696e91ce
Image: busybox
Image ID: docker-pullable://busybox@sha256:061ca9704a714ee3e8b80523ec720c64f6209ad3f97c0ff7cb9ec7d19f15149f
Port: <none>
Host Port: <none>
Args:
/bin/sh
-c
sleep 30000
State: Running
Started: Tue, 05 Mar 2019 14:19:15 +0800
Ready: True
Restart Count: 0
Environment: <none>
Mounts:
/mydata from mydata (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-9h9sl (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
mydata:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: mypvc1
ReadOnly: false
default-token-9h9sl:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-9h9sl
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 29s default-scheduler Successfully assigned default/mypod1 to k8s-host2
Normal Pulling 29s kubelet, k8s-host2 pulling image "busybox"
Normal Pulled 24s kubelet, k8s-host2 Successfully pulled image "busybox"
Normal Created 24s kubelet, k8s-host2 Created container
Normal Started 24s kubelet, k8s-host2 Started container
root@k8s-master:/home/k8s#

##############################################################

以下是百度的解决方案

 

 

在linux中利用nfs挂载硬盘时发现提示wrong fs type, bad option, bad superblock错误了,在网上搜索了一下说是没有安装 mount.nfs了,我们只要安装mount.nfs就不会有wrong fs type, bad option, bad superblock错误提示了哦。
今天碰到一个nfs挂载错误的问题,错误提示如下:

mount: wrong fs type, bad option, bad superblock on 125.64.41.244:/data/img,
       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
 
根据错误提示,查看/sbin/mount.<type>文件,果然发现没有/sbin/mount.nfs的文件,安装nfs-utils即可

解决方法:

 代码如下 复制代码
apt-get install nfs-common

或者

yum install nfs-utils

安装之后,/sbin/下面多了两个mount文件,分别是mount.nfs和mount.nfs4:

 代码如下 复制代码
[root@web data]# ll /sbin/mount*
-rwsr-xr-x. 1 root root 123776 11月 22 2013 /sbin/mount.nfs
lrwxrwxrwx. 1 root root      9 6月   9 13:41 /sbin/mount.nfs4 -> mount.nfs
-rwxr-xr-x. 1 root root   1338 2月  22 2013 /sbin/mount.tmpfs



转载于:https://www.cnblogs.com/jarrel/p/pv.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值