1

Google Container Engine (GKE)에서 kubernetes NFS 볼륨을 생성하고 배포에서 사용하려고합니다. 그것은이 GitHub의 저장소 kubernetes-nfs-volume-on-gke 같이Google Container Engine에서 kubernetes NFS 볼륨을 만드는 방법

나는 여러 단계로 이런 짓을 :

  1. GKE 클러스터 및 GCE 영구 디스크
  2. 구성 GKE 클러스터를 처리 할 수있는 kubectl에 대한 컨텍스트를 작성
  3. PersistentVolume (PV) 및 PersistentVolumeClaim (PVC) 만들기
  4. NFS 서버 만들기
  5. 공개 할 NFS 서버에 대한 서비스 만들기 (해당 서비스의 IP 주소는 NFS PV 및 NFS PVC 생성에 사용됩니다.)
  6. NFS 볼륨 생성
  7. NFS 볼륨에 액세스 할 수 있는지 확인하기위한 작업 표시 줄 배포를 만듭니다.

이러한 공정 fellowing 후,이 얻어진 오류가 다음는 Kubernetes 대시 보드

$ kubectl describe pods nfs-busybox-2762569073-lhb5p 
Name:  nfs-busybox-2762569073-lhb5p 
Namespace: default 
Node:  gke-mappedinn-cluster-default-pool-f94cb0d4-fmfb/10.240.0.3 
Start Time: Wed, 12 Apr 2017 04:12:20 +0400 
Labels:  name=nfs-busybox 
     pod-template-hash=2762569073 
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"nfs-busybox-2762569073","uid":"b1e523ae-1f14-11e7-a084-42010a8e0... 
     kubernetes.io/limit-ranger=LimitRanger plugin set: cpu request for container busybox 
Status:  Pending 
IP:  
Controllers: ReplicaSet/nfs-busybox-2762569073 
Containers: 
    busybox: 
    Container ID: 
    Image:  busybox 
    Image ID:  
    Port:  
    Command: 
     sh 
     -c 
     while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done 
    State:  Waiting 
     Reason:  ContainerCreating 
    Ready:  False 
    Restart Count: 0 
    Requests: 
     cpu:  100m 
    Environment: <none> 
    Mounts: 
     /mnt from my-pvc-nfs (rw) 
     /var/run/secrets/kubernetes.io/serviceaccount from default-token-20n4b (ro) 
Conditions: 
    Type  Status 
    Initialized True 
    Ready  False 
    PodScheduled True 
Volumes: 
    my-pvc-nfs: 
    Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) 
    ClaimName: nfs 
    ReadOnly: false 
    default-token-20n4b: 
    Type: Secret (a volume populated by a Secret) 
    SecretName: default-token-20n4b 
    Optional: false 
QoS Class: Burstable 
Node-Selectors: <none> 
Tolerations: <none> 
Events: 
    FirstSeen LastSeen Count From        SubObjectPath Type  Reason  Message 
    --------- -------- ----- ----        ------------- -------- ------  ------- 
    5m  5m  1 default-scheduler        Normal  Scheduled Successfully assigned nfs-busybox-2762569073-lhb5p to gke-mappedinn-cluster-default-pool-f94cb0d4-fmfb 
    3m  48s  2 kubelet, gke-mappedinn-cluster-default-pool-f94cb0d4-fmfb   Warning  FailedMount Unable to mount volumes for pod "nfs-busybox-2762569073-lhb5p_default(b1e7c901-1f14-11e7-a084-42010a8e0116)": timeout expired waiting for volumes to attach/mount for pod "default"/"nfs-busybox-2762569073-lhb5p". list of unattached/unmounted volumes=[my-pvc-nfs] 
    3m  48s  2 kubelet, gke-mappedinn-cluster-default-pool-f94cb0d4-fmfb   Warning  FailedSync Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"nfs-busybox-2762569073-lhb5p". list of unattached/unmounted volumes=[my-pvc-nfs] 
    37s  37s  1 kubelet, gke-mappedinn-cluster-default-pool-f94cb0d4-fmfb   Warning  FailedMount MountVolume.SetUp failed for volume "kubernetes.io/nfs/b1e7c901-1f14-11e7-a084-42010a8e0116-nfs" (spec.Name: "nfs") pod "b1e7c901-1f14-11e7-a084-42010a8e0116" (UID: "b1e7c901-1f14-11e7-a084-42010a8e0116") with: mount failed: exit status 32 
Mounting command: /home/kubernetes/bin/mounter 
Mounting arguments: 10.247.250.208:/exports /var/lib/kubelet/pods/b1e7c901-1f14-11e7-a084-42010a8e0116/volumes/kubernetes.io~nfs/nfs nfs [] 
Output: Running mount using a rkt fly container 
run: group "rkt" not found, will use default gid when rendering images 

에러는 다음과 같다 :

포드 "NFS-비지에 대한 볼륨을 장착 할 수 없습니다 -2762569073-lhb5p_default (b1e7c901-1f14-11e7-a084-42010a8e0116) ": 볼륨이"/ "nfs-busybox-2762569073-lhb5p"에 대한 기본 장착/마운트 대기를 기다리는 중 시간이 만료되었습니다. 타임 아웃 볼륨/첨부 포드 "기본"/ "NFS-비지 박스 - 2,762,569,073 - lhb5p"마운트를 기다리고 만료 : 무소속/마운트 해제 볼륨 = [내-PVC가-NFS]

오류 동기화 포드, 건너 뛰는이 목록 . 연결되지 않은/마운트 해제 된 볼륨의 목록 = [my-pvc-nfs]

내가 놓친 것이 있습니까? 는 Kubernetes에

감사의 issue에서

+0

저는 GKE 튜토리얼에 요즘 NFS를 쓸 계획입니다. 나는 당장 그 해답을 알지 못하지만,이 튜토리얼의 필요성을 입증하면서이 질문을 해줘서 고맙다. 연결 상태를 유지하려면 내 이메일 주소가 ahmetb✳︎google.com입니다. 나는 이것을 몇 주 안에 대답 할 수있다. –

+0

제안 해 주셔서 감사합니다 ... 아직 해결 중입니다 ... 해결책을 찾으면 여기에 게시 할 것입니다 ... PR [kubernetes-nfs-volume-on-gke] (https : //github.com/mappedinn/kubernetes-nfs-volume-on-gke) 좋을 것입니다! –

답변

1

comment는 GKE에이 NFS 문제를 해결하는 것 같다.

그 의견을 Qutoing :

Edit examples/volumes/nfs/nfs-pv.yaml change the last line to path: "/" .

Edit examples/volumes/nfs/nfs-server-rc.yaml change the image to the one that enabled NFSv4 image: gcr.io/google_containers/volume-nfs:0.8

또한이 herehere을 추적 다른 문제가 있습니다.