AWS Kubernetes Persistent Volumes EFS

6/10/2021

I have deployed EFS file system in AWS EKS cluster after the deployment my storage pod is up and running.

kubectl get pod -n storage
NAME                                     READY   STATUS    RESTARTS   AGE
nfs-client-provisioner-968445d79-g8wjr   1/1     Running   0          136m

When I'm trying deploy application pod is not not coming up its pending state 0/1 at the same time PVC is not bounded its pending state.

Here are the logs for after the actual application deployment.

I0610 13:26:11.875109       1 controller.go:987] provision "default/logs" class "efs": started
E0610 13:26:11.894816       1 controller.go:1004] provision "default/logs" class "efs": unexpected error getting claim reference: selfLink was empty, can't make reference

I'm using k8 version 1.20 could you please some one help me on this.

-- Gowmi
amazon-efs
amazon-eks
kubernetes
persistent-volumes

1 Answer

6/11/2021

Kubernetes 1.20 stopped propagating selfLink.
There is a workaround available, but it does not always work.

After the lines

spec:
  containers:
  - command:
    - kube-apiserver

add

- --feature-gates=RemoveSelfLink=false

then reapply API server configuration

kubectl apply -f /etc/kubernetes/manifests/kube-apiserver.yaml

This workaround will not work after version 1.20 (1.21 and up), as selfLink will be completely removed.


Another solution is to use newer NFS provisioner image:
gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0

-- p10l
Source: StackOverflow