kubernetes dynamically provisioned volume with aws efs

7/22/2021

i am using efs dynamic provisionsing but the issue happening is the ownership of the folders get change in the persitant volume and because of that we are not able to access the content which we want and we are getting 504 bad gateway i want the www-data permission to my files and folders but i am getting 1009 user group

here is my storage.yml file

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-csi
provisioner: efs.csi.aws.com
mountOptions:
  - tls
parameters:
  provisioningMode: efs-ap
  fileSystemId: fs-c6b55cc0
  directoryPerms: "777"
  basePath: "/test"

pvc.yml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claims
  namespace: {{ $.Values.namespace }}
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: efs-csi
  resources:
    requests:
      storage: 2Gi

i have also used the securityContext: in the deployment file

  securityContext:
    runAsUser: 0
    runAsGroup: 33
    fsGroup: 33

it is also not working! any suggestion will be helpful

-- Dhaval Shah
amazon-efs
amazon-web-services
kubernetes
kubernetes-ingress
linux

0 Answers