我試圖在Google容器引擎(GKE)上創建一個kubernetes NFS卷並讓它用於部署。如何在Google容器引擎上創建一個kubernetes NFS卷
我在幾個步驟做這在本GitHub的倉庫kubernetes-nfs-volume-on-gke顯示它:
- 創建GKE集羣和GCE永久磁盤
- 配置上下文的kubectl應對GKE集羣
- 創建PersistentVolume(PV)和PersistentVolumeClaim(PVC)
- 創建NFS服務器
- 爲NFS服務器創建服務以便公開它(該服務的IP地址用於創建NFS PV和NFS PVC)
- 創建NFS卷
- 創建一個用於檢查NFS卷的busybox的部署是可訪問的。
fellowing這些步驟之後,這是所獲得的誤差:
$ 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
在kubernetes儀表盤,誤差如下:
無法裝入用於莢「NFS-busybox的卷-2762569073-lhb5p_default(b1e7c901-1f14-11e7-a084-42010a8e0116)「:超時過期等待卷掛載/掛載」默認「/」nfs-busybox-2762569073-lhb5p「。超時過期等待卷連接/掛載吊艙 「默認」/ 「NFS-的busybox-2762569073-lhb5p」:未婚/卸載量= [我-PVC-NFS]
錯誤同步莢,跳躍列表。未安裝/未安裝卷的列表= [my-pvc-nfs]
我錯過了什麼嗎?
感謝,
我打算在GKE教程上寫一個NFS。我不知道答案馬上,但謝謝你提出這個問題,因爲它驗證了這樣一個教程的需要。如果你想保持聯繫,我的電子郵件是ahmetb✳︎google.com。我可以在幾個星期內回答這個問題。 –
感謝您的建議......我仍在努力......如果我找到解決方案,我會在這裏發佈它......如果您想製作PR [kubernetes-nfs-volume-on-gke](https ://github.com/mappedinn/kubernetes-nfs-volume-on-gke)它會很棒! –