1

我试图在Google容器引擎(GKE)上创建一个kubernetes NFS卷并让它用于部署。如何在Google容器引擎上创建一个kubernetes NFS卷

我在几个步骤做这在本GitHub的仓库kubernetes-nfs-volume-on-gke显示它:

  1. 创建GKE集群和GCE永久磁盘
  2. 配置上下文的kubectl应对GKE集群
  3. 创建PersistentVolume(PV)和PersistentVolumeClaim(PVC)
  4. 创建NFS服务器
  5. 为NFS服务器创建服务以便公开它(该服务的IP地址用于创建NFS PV和NFS PVC)
  6. 创建NFS卷
  7. 创建一个用于检查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]

我错过了什么吗?

感谢,

+0

我打算在GKE教程上写一个NFS。我不知道答案马上,但谢谢你提出这个问题,因为它验证了这样一个教程的需要。如果你想保持联系,我的电子邮件是ahmetb✳︎google.com。我可以在几个星期内回答这个问题。 –

+0

感谢您的建议......我仍在努力......如果我找到解决方案,我会在这里发布它......如果您想制作PR [kubernetes-nfs-volume-on-gke](https ://github.com/mappedinn/kubernetes-nfs-volume-on-gke)它会很棒! –

回答

1

commentissue上kubernetes似乎来解决这个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等问题。

相关问题