2016-08-17 10 views
5

NFSボリュームをポッドにマウントしようとしていますが、成功しません。Kubernetesポッドのボリュームをタイムアウトでマウントできない

私はいくつかの他の実行中のサーバー

sudo mount -t nfs -o proto=tcp,port=2049 10.0.0.4:/export /mntから、それに接続しようとすると、私は、NFSマウントポイントを実行しているサーバーを持っているが、私は、展開からボリュームを削除すると言及する価値もう一つは細かい

の作品ポッドが動作しています。私はそれにログインし、ポート111と2049を使って10.0.0.4にtelnetで接続することができます。これが本当にdoesntの任意の通信の問題

などのように見える:

showmount -e 10.0.0.4 
Export list for 10.0.0.4: 
/export/drive 10.0.0.0/16 
/export  10.0.0.0/16 

だから私は、サーバーとクライアント間のネットワークまたは構成の問題が存在しないと仮定することができます(私はアマゾンと私がテストしたK8S手下たちと同じセキュリティグループ)にあるサーバーを使用して

PS: サーバーは、単純なubuntu-> 50ギガバイトのディスク

Kubernetes

は、だから私は私のPV

apiVersion: v1 
kind: PersistentVolume 
metadata: 
    name: nfs 
spec: 
    capacity: 
    storage: 50Gi 
    accessModes: 
    - ReadWriteMany 
    nfs: 
    server: 10.0.0.4 
    path: "/export" 

の作成を開始v1.3.4そして、私のPVC

kind: PersistentVolumeClaim 
apiVersion: v1 
metadata: 
    name: nfs-claim 
spec: 
    accessModes: 
    - ReadWriteMany 
    resources: 
    requests: 
     storage: 50Gi 
ここ

はkubectlがそれらを記述する方法です:

Name:  nfs 
    Labels:  <none> 
    Status:  Bound 
    Claim:  default/nfs-claim 
    Reclaim Policy: Retain 
    Access Modes: RWX 
    Capacity: 50Gi 
    Message: 
    Source: 
     Type: NFS (an NFS mount that lasts the lifetime of a pod) 
     Server: 10.0.0.4 
     Path: /export 
     ReadOnly: false 
    No events. 

Name:  nfs-claim 
    Namespace: default 
    Status:  Bound 
    Volume:  nfs 
    Labels:  <none> 
    Capacity: 0 
    Access Modes: 
    No events. 

ポッドの展開:

apiVersion: extensions/v1beta1 
    kind: Deployment 
    metadata: 
     name: mypod 
     labels: 
     name: mypod 
    spec: 
     replicas: 1 
     strategy: 
     rollingUpdate: 
      maxSurge: 1 
      maxUnavailable: 0 
     type: RollingUpdate 
     template: 
     metadata: 
      name: mypod 
      labels: 
      # Important: these labels need to match the selector above, the api server enforces this constraint 
      name: mypod 
     spec: 
      containers: 
      - name: abcd 
      image: irrelevant to the question 
      ports: 
      - containerPort: 80 
      env: 
      - name: hello 
       value: world 
      volumeMounts: 
      - mountPath: "/mnt" 
       name: nfs 
      volumes: 
      - name: nfs 
       persistentVolumeClaim: 
       claimName: nfs-claim 

私はPODを展開するとき、私は以下の取得:

Volumes: 
     nfs: 
     Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) 
     ClaimName: nfs-claim 
     ReadOnly: false 
     default-token-6pd57: 
     Type: Secret (a volume populated by a Secret) 
     SecretName: default-token-6pd57 
    QoS Tier: BestEffort 
    Events: 
     FirstSeen LastSeen Count From       SubobjectPath Type  Reason  Message 
     --------- -------- ----- ----       ------------- -------- ------  ------- 
     13m  13m  1 {default-scheduler }       Normal  Scheduled Successfully assigned xxx-2140451452-hjeki to ip-10-0-0-157.us-west-2.compute.internal 
     11m  7s  6 {kubelet ip-10-0-0-157.us-west-2.compute.internal}   Warning  FailedMount Unable to mount volumes for pod "xxx-2140451452-hjeki_default(93ca148d-6475-11e6-9c49-065c8a90faf1)": timeout expired waiting for volumes to attach/mount for pod "xxx-2140451452-hjeki"/"default". list of unattached/unmounted volumes=[nfs] 
     11m  7s  6 {kubelet ip-10-0-0-157.us-west-2.compute.internal}   Warning  FailedSync Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "xxx-2140451452-hjeki"/"default". list of unattached/unmounted volumes=[nfs] 

は、私が知っているすべて、と私は考えることができるすべてのものを試してみました。何が私が行方不明か、ここで間違っていますか?

答えて

1

バージョン1.3.4と1.3.5のKubernetesがテストされ、NFSマウントが動作しませんでした。後で私は1.2.5に切り替え、そのバージョンは私にもっと詳細な情報を与えました(kubectlはポッドを記述しています...)。ハイパーキューブの画像に「nfs-common」がないことが判明しました。マスターノードとワーカーノードのハイパーキューブイメージに基づいてすべてのコンテナインスタンスにnfs-commonを追加した後、NFS共有は正常に動作し始めました(マウントは成功しました)。それがここに当てはまります。私は実際にそれをテストし、私の問題を解決しました。

+0

この問題は公開されているので、公式の修正プログラムがこれに含まれることを期待しています。https://github.com/kubernetes/kubernetes/issues/30310 – dejwsz

+0

実際には、修正は 'master'ブランチハイパーキューブ画像の(Dockerfileの定義を参照) – dejwsz

関連する問題