helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Support EFS CSI by changing volume claim

Open cep21 opened this issue 4 years ago • 8 comments

Hi,

EFS is great for atlantis since it's not locked to a single AZ. The future of EFS kubernetes is https://github.com/kubernetes-sigs/aws-efs-csi-driver. There's no way (I know of) to use volumeclaimtemplates (which this helm chart uses) with the CSI spec. There are details here: https://github.com/kubernetes-sigs/aws-efs-csi-driver/issues/42

Rather than a storageclass inside the volumeclaimtemplates, can we use our own PersistentVolume (where we can configure a volumeHandle) ?

cep21 avatar Dec 22 '20 03:12 cep21

+1

nilsSure avatar Sep 15 '21 07:09 nilsSure

Looks like you can provide your own StorageClass using name efs-atlantis

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-atlantis
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemId: <EFS ID>
  directoryPerms: "777"

Then set the volume claim to the new storage class

# values.yaml
volumeClaim:
  storageClassName: efs-atlantis

https://github.com/runatlantis/helm-charts/blob/bc9db325f8f023a282fabe03de6a5fb9b969ac7a/charts/atlantis/templates/statefulset.yaml#L540-L542

https://github.com/kubernetes-sigs/aws-efs-csi-driver/issues/541#issuecomment-1027226852

nitrocode avatar Dec 30 '22 16:12 nitrocode

@cep21 can you confirm if @nitrocode suggestion addresses your issue?

GenPage avatar Jan 20 '23 18:01 GenPage

@nitrocode I tested it and it didn't work for me, can you tell me what else you did?

davirodriguesrezende avatar Jun 13 '23 12:06 davirodriguesrezende

hello everything is fine?

sorry for the intrusion, but I have noticed that the atlantis replicas do not use the same access point when using the aws-efs-csi plugin

Is it possible that atlantis replicas use the same access point?

i tested it and i didn't work for me @nitrocode

Gabryel8818 avatar Jun 15 '23 22:06 Gabryel8818

Trying to revive this; I'm trying to use EFS with Atlantis and I'm having a hard time while using this Helm Chart.

pof-jhansilva avatar Oct 18 '23 21:10 pof-jhansilva

Setting up EFS with the chart is doable on both EC2 and Fargate.

  1. Install and configure aws-efs-csi-driver
  2. Create a StorageClass, PersistentVolumeClaim, and in case of Fargate PersistentVolume outside the chart, because Fargate doesn't support dynamically provisioned PersistentVolume
  3. Set .Values.volumeClaim.enabled to false
  4. Mount the new volume via .Values.extraVolumes and .Values.extraVolumeMounts

StatefulSet creates a new PersistentVolumeClaim for each replica, so if you want a common filesystem for all your pods, you need to create the PVC separately https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-storage

Example from efs-csi docs: https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/examples/kubernetes/statefulset/specs/example.yaml

Balsir avatar Oct 26 '23 20:10 Balsir

Looks like this is not an issue anymore? Please let us know.

GMartinez-Sisti avatar May 04 '24 11:05 GMartinez-Sisti

This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month.'

github-actions[bot] avatar Jun 05 '24 02:06 github-actions[bot]