How to share an EFS volume across multiple namespaces

11/8/2021

I have read through all the available docs and can't find anything about this problem. If i need to share EFS storage in multiple namespaces, i'm lost as to how to achieve this.

I have tried, creating multiple storage classes and then a corresponding PV and PVC scoped to the namespace. This fails with an authentication error, i assume because you cant create multiple storeclasses for the same resource.

If i try to create a pvc in a different namespace i get storageclass.storage.k8s.io "efs-sc" not found

It appears to be the case (though again very little documentation about this) that storage classes are cluster wide? so lost as to why the storage class doesnt appear to be visible when scoped to a namespace

The offending pvc:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claim
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: efs-sc
  resources:
    requests:
      storage: 5Gi
-- Happy Machine
amazon-efs
amazon-eks
kubernetes
kubernetes-pvc

0 Answers