学习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. 数据结构实验之排序三:bucket sort (SDUT 3400)

    桶排序: #include <stdio.h> #include <string.h> int a[5555555]; int main() { int n,m; scanf( ...

  2. LoadRunner学习目录

    已更新: 未更新: 1.loadrunner 11破解版及破解包 2.如何录制一个LR脚本 3.自定义loadrunner脚本

  3. LeetCode之找零钱

    题目:已知不同面值的钞票,求如 何用最少数量的钞票组成某个金额,求可 以使用的最少钞票数量.如果任意数量的已知面值钞票都无法组成该金额, 则返回-1. 示例: Input: coins = [1, 2 ...

  4. 深度学习面试题25:分离卷积(separable卷积)

    目录 举例 单个张量与多个卷积核的分离卷积 参考资料 举例 分离卷积就是先在深度上分别卷积,然后再进行卷积,对应代码为: import tensorflow as tf # [batch, in_he ...

  5. linux下终端字体彩色显示

     linux下python彩色显示   跨平台彩色显示库https://pypi.python.org/pypi/colorama   jlive@MacBook-Pro:py_demo $pytho ...

  6. uefi下如何启动linux?

    1. 有两种方式 1.1 直接从uefi shell启动linux内核 1.2 从uefi shell启动grub,然后再从grub启动linux内核 2. 需要哪些东西? 2.1 linux内核 2 ...

  7. 国人开发的api测试工具 ApiPost

    挺好用的 ApiPost https://www.apipost.cn/download.html 需要注册,免费试用.感觉比postman好用

  8. 获取Excel中的图片

    如下图,上传要获取这里面的图片,而又不能直接选择,怎么办呢? 1.首先复制一份Excel文件命名copy.xlsx 2.修改copy.xlsx文件的后缀名变成copy.rar 3.解压copy.rar ...

  9. osg Node getParentalNodePaths()报错

    node->getBound().center() * osg::computeLocalToWorld(node->getParentalNodePaths()[0]) osg::Vec ...

  10. Source Insight 4.0配置格式化工具AStyle.exe

    Source Insight 4.0配置格式化工具AStyle.exe 摘自:https://blog.csdn.net/u012156133/article/details/81566871 1. ...