学习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

pv回收的更多相关文章

  1. Kubernetes集群PV和PVC详解

    Kubernetes集群高级存储资源PV及PVC 文章目录 Kubernetes集群高级存储资源PV及PVC 1.高级存储PV和PVC概念部分 2.PV和PVC资源的生命周期 3.PV资源介绍与案例配 ...

  2. Kubernetes 存储系统 Storage 介绍:PV,PVC,SC

    要求:先了解数据docker容器中数据卷的挂载等知识 参考网址: https://www.cnblogs.com/sanduzxcvbnm/p/13176938.html https://www.cn ...

  3. Kubernetes (1.6) 中的存储类及其动态供给

    原文地址:http://blog.fleeto.us/translation/dynamic-provisioning-and-storage-classes-kubernetes-0?utm_sou ...

  4. 利用nfs-client-provisioner动态提供Kubernetes后端存储卷

    原文:https://www.kubernetes.org.cn/3894.html 利用NFS client provisioner动态提供Kubernetes后端存储卷 本文翻译自nfs-clie ...

  5. k8s之volume

    pause容器为基础架构容器,每一个节点都有一个pause镜像, 为每一个pod提供底层基础支撑设备,所有pod中容器会共享此容器的网络空间,存储卷也是 还可使用csi,存储插件. 使用存储卷步骤1. ...

  6. k8s 笔记

    一. 解决pod间依赖性 1.手动的采用不同顺序启动不同pod 2.定义restart policy(默认为alway,我们可以定义当某条件不满足时就一直重启,当满足条件是才启动容器) 3.如果对于强 ...

  7. kubernetes之NFS动态提供Kubernetes后端存储卷

    StorageClass作为对存储资源的抽象定义, 对用户设置的NFS申请屏蔽后端存储的细节, 一方面减少了用户对于存储资源细节的关注, 另一方面减轻了管理员手工管理pv的工作, 由系统自动完成pv的 ...

  8. 容器编排系统K8s之StatefulSet控制器

    前文我们聊到了k8s的configmap和secret资源的说明和相关使用示例,回顾请参考:https://www.cnblogs.com/qiuhom-1874/p/14194944.html:今天 ...

  9. k8s使用ceph的rbd作后端存储

    k8s使用rbd作后端存储 k8s里的存储方式主要有三种.分别是volume.persistent volumes和dynamic volume provisioning. volume: 就是直接挂 ...

随机推荐

  1. LibreOJ #524. 「LibreOJ β Round #4」游戏

    二次联通门 : LibreOJ #524. 「LibreOJ β Round #4」游戏 /* LibreOJ #524. 「LibreOJ β Round #4」游戏 找找规律就会发现.. 当有X的 ...

  2. 36、将RDD转换为DataFrame

    一.概述 为什么要将RDD转换为DataFrame? 因为这样的话,我们就可以直接针对HDFS等任何可以构建为RDD的数据,使用Spark SQL进行SQL查询了.这个功能是无比强大的. 想象一下,针 ...

  3. 15、Work原理及源码分析

    一.Work原理 1.图解 Worker启动Driver的一个基本原理,就是Worker内部会启动一个线程,这个线程可以理解为,就是DriverRunner,然后DriverRunner就会去负责启动 ...

  4. 《挑战30天C++入门极限》对C++递增(增量)运算符重载的思考

        对C++递增(增量)运算符重载的思考 在前面的章节中我们已经接触过递增运算符的重载,那时候我们并没有区分前递增与后递增的差别,在通常情况下我们是分别不出++a与a++的差别的,但的确他们直接是 ...

  5. (1)Go变量声明、赋值和常量

     先简单了解一下控制台输出,在go中,我们使用fmt包中的函数进行在控制台中打印,一般用以下几个函数      fmt.Print()        #不换行输出      fmt.Printf()  ...

  6. ansys meshing当中共享节点的操作

    原视频下载地址: https://yunpan.cn/cYKuN9mIHMUxa  访问密码 5858

  7. Java ArrayList,LinkedList使用

    1.ArrayList底层采用数组实现,当使用不带参数的构造方法生成ArrayList对象时,实际上回在底层生成一个长度为10的Object类型数组. 2.如果增加的元素个数超过10个,那么Array ...

  8. nginx listen 端口 443 80 https 和 wss

    端口号 443 和 80 端口的区别 一般指定 443 和 80 端口都是使用域名时所需要的 当我们使用域名请求时,一般是不添加端口号的 例如:http://www.baidu.com 在不添加端口号 ...

  9. FFmpeg编译:mac下编译iOS平台的FFmpeg库(支持armv7, arm64, i386, x86_64)

    环境:FFmpeg 3.4.6Xcode 10.3macOS 10.14.6iOS SDK 12.4 一.准备工作 1. 下载FFmpeg我这里使用的是3.4.6版本的FFmpeg,可以从FFmpeg ...

  10. #软件更新#Visual Studio更新到16.3.8

    #软件更新#Visual Studio更新到16.3.8 此次更新包括以下内容:(1)支持Xcode 11.2.(2)修复无法从System.String类型转化的bug.(3)修复UWP开发中,加载 ...