NFS卷装入会导致Kubernetes上的退出代码为32? [英] NFS volume mount results in exit code 32 on in Kubernetes?

查看:121
本文介绍了NFS卷装入会导致Kubernetes上的退出代码为32?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在复制控制器中挂载外部nfs共享.当我创建复制控制器时,该Pod处于挂起状态.在pod上获取详细信息,我会收到以下事件:

I'm trying to mount an external nfs share in a Replication Controller. When I create the replication controller, the pod is pending. Getting the details on the pod, I get these events:

Events:
  FirstSeen             LastSeen            Count   From            SubobjectPath   Reason      Message
  Thu, 05 Nov 2015 11:28:33 -0700   Thu, 05 Nov 2015 11:28:33 -0700 1   {scheduler }                scheduled   Successfully assigned web-worker-hthjq to jolt-server-5
  Thu, 05 Nov 2015 11:28:43 -0700   Thu, 05 Nov 2015 11:28:43 -0700 1   {kubelet jolt-server-5}         failedMount Unable to mount volumes for pod "web-worker-hthjq_default": exit status 32
  Thu, 05 Nov 2015 11:28:43 -0700   Thu, 05 Nov 2015 11:28:43 -0700 1   {kubelet jolt-server-5}         failedSync  Error syncing pod, skipping: exit status 32

我的设置是本地计算机上的一个主节点和一个节点.这些机器正在运行CoreOS. nfs共享存在于网络上的另一台计算机上.如果我将Shell装入主机,则可以成功挂载nfs共享,因此我相信导出配置正确.在网上环顾四周,似乎唯一使用nfs共享的示例是在Kubernetes(一个Pod与另一个Pod共享)中定义的共享.没有办法直接从Kubernetes挂载外部共享(我不想先将其挂载到主机,然后再从主机挂载到容器).

My set up is one master and one node on local machines. These machines are running CoreOS. The nfs share exists on another machine on the network. If I shell into the host machine, I can successfully mount the nfs share, so I believe the export is configured correctly. Looking around online, it seems like the only examples of using nfs shares are those defined within Kubernetes (one pod sharing with another). Is there not a way to mount an external share directly from Kubernetes (I don't want to have to mount it to the host machine and then mount from the host machine to the container).

这是我的复制控制器:

apiVersion: v1
kind: ReplicationController
metadata:
  labels:
    name: web-worker
  name: web-worker
spec:
  replicas: 1
  selector:
    component: web-worker
  template:
    metadata:
      labels:
        app: task-queue
        component: web-worker
    spec:
      containers:
        - command:
            - /sbin/my_init
          image: quincy/php-apache2:latest
          name: web-worker
          ports:
            - containerPort: 80
              protocol: TCP
          volumeMounts:
            - name: code-base
              mountPath: /var/www/html
            - name: local-secrets
              mountPath: /secrets
      volumes:
        - name: code-base
          nfs:
            server: thuey.jolt.local
            path: "/Users/thuey/Sites/jolt/jolt-web"
        - name: local-secrets
          secret:
            secretName: local-secret

更新

更多考虑之后,我意识到问题可能在于它找不到服务器(thuey.jolt.local).它可能只是在查看内部DNS.准确吗?如果是这样,那有什么办法解决?

After thinking about it more, I realized the problem is probably that it can't find the server (thuey.jolt.local). It's probably just looking at the internal DNS. Is that accurate? If so, is there any way around that?

更新

再次尝试此操作后,现在可以将其直接从Pod安装到联网的nfs服务器.

After attempting this again, it is now working mounting directly from the pod to the networked nfs server.

推荐答案

在@rwehner的帮助下,我终于能够弄清楚.检查kubelet日志显示:

With @rwehner's help, I was finally able to figure it out. Checking the kubelet log revealed:

Output: mount.nfs: rpc.statd is not running but is required for remote locking.

一旦我运行rpcbind,挂载就起作用了.

As soon as I got rpcbind running, the mount worked.

这篇关于NFS卷装入会导致Kubernetes上的退出代码为32?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆