2016-08-17 2 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로 텔넷 할 수 있습니다. 나는 (

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기가바이트 디스크

01 23,516,

는 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. 

포드 배포 :

내 POD를 배포 할 때
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 

난 다음 얻을 :

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

Kubernetes 버전 1.3.4 및 1.3.5를 테스트했는데 NFS 마운트가 제대로 작동하지 않았습니다. 나중에 나는 1.2.5 버전으로 바꾸었다. 그리고 그 버전은 나에게 좀 더 상세한 정보를 주었다. (kubectl은 pod를 묘사한다 ...). hyperkube 이미지에서 'nfs-common'이 누락되었습니다. 마스터 및 작업자 노드의 hyperkube 이미지를 기반으로 모든 컨테이너 인스턴스에 nfs-common을 추가 한 후 NFS 공유가 정상적으로 작동하기 시작했습니다 (마운트가 성공했습니다). 그래서 그것이 여기에 해당됩니다. 나는 그것을 실제로 시험해 보았고 나의 문제를 해결했다.

+0

이 문제가 열리기 때문에 공식 수정본이 나올 수 있습니다. https://github.com/kubernetes/kubernetes/issues/30310 – dejwsz

+0

사실 수정본이 'master'분기에 적용됩니다. hyperkube 이미지 (Dockerfile 정의 참조) – dejwsz

관련 문제