kubernetes-retired / external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Apache License 2.0
2.7k stars 1.6k forks source link

efs-provisioner can not work on EKS on AWS Beijing and Ningxia region #1293

Closed liangruibupt closed 4 years ago

liangruibupt commented 4 years ago

I followed the guides to use the EFS as persistent volume for EKS in AWS Ningxia region https://aws.amazon.com/premiumsupport/knowledge-center/eks-pods-efs/

  1. edit configmap.yaml change file.system.id and aws.region
  2. edit deployment.yaml file, change the volumes configuration to a path of / and server to fs-72d63897.efs.cn-northwest-1.amazonaws.com.cn
      volumes:
        - name: pv-volume
          nfs:
            server: fs-72d63897.efs.cn-northwest-1.amazonaws.com.cn
            path: /

After kubectl apply -f test-pod.yaml, I checked the pod status, it keep pending for a long time test-pod 0/1 Pending 0 15h

Then I checked the kubectl get event

ProvisioningFailed     persistentvolumeclaim/efs  Error creating provisioned PV object for claim default/efs: PersistentVolume "pvc-76b7ee16-5fc4-11ea-ab77-02aadf7bd768" is invalid: spec.nfs.path: Invalid value: "fs-72d63897.efs.cn-northwest-1.amazonaws.com.cn:/efs-pvc-76b7ee16-5fc4-11ea-ab77-02aadf7bd768": must be an absolute path. Deleting the volume.

Here is details of test-pod

kubectl get pod test-pod -o json
{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "annotations": {
            "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"name\":\"test-pod\",\"namespace\":\"default\"},\"spec\":{\"containers\":[{\"args\":[\"-c\",\"while true; do echo $(date -u) \\u003e\\u003e /mnt/out.txt; sleep 5; done\"],\"command\":[\"/bin/sh\"],\"image\":\"gcr.io/google_containers/busybox:1.24\",\"name\":\"test-pod\",\"volumeMounts\":[{\"mountPath\":\"/mnt\",\"name\":\"efs-pvc\"}]}],\"restartPolicy\":\"Never\",\"volumes\":[{\"name\":\"efs-pvc\",\"persistentVolumeClaim\":{\"claimName\":\"efs\"}}]}}\n",
            "kubernetes.io/psp": "eks.privileged"
        },
        "creationTimestamp": "2020-03-06T16:07:02Z",
        "name": "test-pod",
        "namespace": "default",
        "resourceVersion": "602753",
        "selfLink": "/api/v1/namespaces/default/pods/test-pod",
        "uid": "8421c90e-5fc4-11ea-ae40-06252b3d34d0"
    },
    "spec": {
        "containers": [
            {
                "args": [
                    "-c",
                    "while true; do echo $(date -u) \u003e\u003e /mnt/out.txt; sleep 5; done"
                ],
                "command": [
                    "/bin/sh"
                ],
                "image": "gcr.io/google_containers/busybox:1.24",
                "imagePullPolicy": "IfNotPresent",
                "name": "test-pod",
                "resources": {},
                "terminationMessagePath": "/dev/termination-log",
                "terminationMessagePolicy": "File",
                "volumeMounts": [
                    {
                        "mountPath": "/mnt",
                        "name": "efs-pvc"
                    },
                    {
                        "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                        "name": "default-token-8hv2z",
                        "readOnly": true
                    }
                ]
            }
        ],
        "dnsPolicy": "ClusterFirst",
        "enableServiceLinks": true,
        "priority": 0,
        "restartPolicy": "Never",
        "schedulerName": "default-scheduler",
        "securityContext": {},
        "serviceAccount": "default",
        "serviceAccountName": "default",
        "terminationGracePeriodSeconds": 30,
        "tolerations": [
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/not-ready",
                "operator": "Exists",
                "tolerationSeconds": 300
            },
            {
                "effect": "NoExecute",
                "key": "node.kubernetes.io/unreachable",
                "operator": "Exists",
                "tolerationSeconds": 300
            }
        ],
        "volumes": [
            {
                "name": "efs-pvc",
                "persistentVolumeClaim": {
                    "claimName": "efs"
                }
            },
            {
                "name": "default-token-8hv2z",
                "secret": {
                    "defaultMode": 420,
                    "secretName": "default-token-8hv2z"
                }
            }
        ]
    },
    "status": {
        "conditions": [
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2020-03-06T16:07:02Z",
                "message": "pod has unbound immediate PersistentVolumeClaims (repeated 3 times)",
                "reason": "Unschedulable",
                "status": "False",
                "type": "PodScheduled"
            }
        ],
        "phase": "Pending",
        "qosClass": "BestEffort"
    }
}
ggaaooppeenngg commented 4 years ago

"dns.name" should be set explicitly, because efs-provisioner didn't default dns domain have a .cn suffix for mainland China.

liangruibupt commented 4 years ago

@ggaaooppeenngg thx. set "dns.name" worked.