मैं अपने पॉड्स में एक एनएफएस वॉल्यूम माउंट करने की कोशिश कर रहा हूं लेकिन बिना किसी सफलता के।कुबर्नेट्स टाइमआउट के साथ पॉड के लिए वॉल्यूम माउंट करने में असमर्थ
मैं एक सर्वर NFS चल माउंट बिंदु, जब मैं कुछ अन्य चल सर्वर से कनेक्ट करने का प्रयास
sudo mount -t nfs -o proto=tcp,port=2049 10.0.0.4:/export /mnt
ठीक
एक और बात उल्लेख के लायक काम करता है जब मैं तैनाती से मात्रा को दूर किया है और फली चल रहा है। मैं इसमें लॉग इन करता हूं और मैं बंदरगाह 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 minions के रूप में एक ही सुरक्षा समूह) में है का उपयोग कर
पुनश्च: सर्वर है एक सरल ubuntu-> 50GB डिस्क
Kubernetes v1.3.4
तो मैं अपने पीवी
apiVersion: v1 kind: PersistentVolume metadata: name: nfs spec: capacity: storage: 50Gi accessModes: - ReadWriteMany nfs: server: 10.0.0.4 path: "/export"
का निर्माण शुरू और मेरे पीवीसी
यहाँ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
जब मैं अपने पॉड को तैनात मैं निम्नलिखित मिलती है:
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]
की कोशिश की सब कुछ मुझे पता है, और सब कुछ मैं के बारे में सोच सकते हैं। मैं यहाँ क्या याद कर रहा हूँ या गलत कर रहा हूँ?
मैं देख सकता हूं कि समस्या खोली गई है, इसलिए इसके लिए आधिकारिक सुधार की उम्मीद है: https://github.com/kubernetes/kubernetes/issues/30310 – dejwsz
असल में 'मास्टर' शाखा में फ़िक्स लागू किया गया है हाइपरक्यूब छवि का (डॉकरफाइल परिभाषा देखें) – dejwsz