Skip to content

Enable shared EFS volume for all services #1300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/job/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ keywords:
- job
name: job
type: application
version: 0.77.0
version: 0.78.0
18 changes: 17 additions & 1 deletion applications/job/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ spec:
{{- else }}
memory: {{ .Values.resources.requests.memory }}
{{- end }}
{{ if .Values.awsEfsStorage }}
volumeMounts:
{{- range $v := .Values.awsEfsStorage }}
- name: {{ $v.name }}
mountPath: {{ $v.mountPath }}
{{ end }}
{{ end }}
- name: sidecar
image: ghcr.io/porter-dev/job_sidecar_container:31e471f4d
imagePullPolicy: Always
Expand Down Expand Up @@ -198,11 +205,20 @@ spec:
mountPath: /secrets/
readOnly: true
{{ end }}
{{ if .Values.cloudsql.enabled }}
{{ if or .Values.cloudsql.enabled .Values.awsEfsStorage }}
volumes:
{{ if .Values.cloudsql.enabled }}
- name: "sidecar-volume-{{ include "docker-template.fullname" . }}"
secret:
secretName: "{{ include "cloudsql.serviceAccountJSONSecret" . }}"
{{ end }}
{{ if .Values.awsEfsStorage }}
{{- range $v := .Values.awsEfsStorage }}
- name: {{ $v.name }}
persistentVolumeClaim:
claimName: {{ $v.name }}
{{ end }}
{{ end }}
{{ end }}
restartPolicy: Never
shareProcessNamespace: true
Expand Down
2 changes: 1 addition & 1 deletion applications/web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ keywords:
- web
name: web
type: application
version: 0.179.0
version: 0.180.0
9 changes: 6 additions & 3 deletions applications/web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ spec:
{{ if .Values.awsEfsStorage }}
volumeMounts:
{{- range $v := .Values.awsEfsStorage }}
- name: efs-{{ $.Values.fullnameOverride }}
- name: {{ $v.name }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you keep this name the same?

mountPath: /data/efs/{{ $.Values.fullnameOverride }}

- name: {{ $v.name }}
mountPath: {{ $v.mountPath }}
{{ end }}
{{ end }}
{{ if .Values.pvc.enabled }}
Expand Down Expand Up @@ -426,9 +429,9 @@ spec:
{{ end }}
{{ if .Values.awsEfsStorage }}
{{- range $v := .Values.awsEfsStorage }}
- name: efs-{{ $.Values.fullnameOverride }}
- name: {{ $v.name }}
persistentVolumeClaim:
claimName: efs-{{ $.Values.fullnameOverride }}
claimName: {{ $v.name }}
{{ end }}
{{ end }}
{{ if .Values.fileSecretMounts.enabled }}
Expand Down
6 changes: 3 additions & 3 deletions applications/web/templates/efs-storage-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-{{ $.Values.fullnameOverride }}
name: {{ $v.name }}
provisioner: efs.csi.aws.com
parameters:
provisioningMode: efs-ap
Expand All @@ -14,11 +14,11 @@ parameters:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-{{ $.Values.fullnameOverride }}
name: {{ $v.name }}
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-{{ $.Values.fullnameOverride }}
storageClassName: {{ $v.name }}
resources:
requests:
storage: 5Gi
Expand Down
2 changes: 1 addition & 1 deletion applications/worker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ keywords:
- worker
name: worker
type: application
version: 0.87.0
version: 0.88.0
16 changes: 15 additions & 1 deletion applications/worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ spec:
- name: "{{ include "docker-template.fullname" . }}-empty-dir-storage"
mountPath: {{ .Values.emptyDir.mountPath }}
{{ end }}
{{ if .Values.awsEfsStorage }}
volumeMounts:
{{- range $v := .Values.awsEfsStorage }}
- name: {{ $v.name }}
mountPath: {{ $v.mountPath }}
{{ end }}
{{ end }}
{{- if .Values.cloudsql.enabled }}
- name: cloud-sql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.17
Expand Down Expand Up @@ -335,7 +342,7 @@ spec:
{{- end }}
{{- end }}
{{ end }}
{{ if or .Values.pvc.enabled .Values.cloudsql.enabled .Values.emptyDir.enabled }}
{{ if or .Values.pvc.enabled .Values.cloudsql.enabled .Values.emptyDir.enabled .Values.awsEfsStorage }}
volumes:
{{ if .Values.cloudsql.enabled }}
- name: "sidecar-volume-{{ include "docker-template.fullname" . }}"
Expand All @@ -352,4 +359,11 @@ spec:
emptyDir:
{{- toYaml .Values.emptyDir.volumeOptions | nindent 8 }}
{{ end }}
{{ if .Values.awsEfsStorage }}
{{- range $v := .Values.awsEfsStorage }}
- name: {{ $v.name }}
persistentVolumeClaim:
claimName: {{ $v.name }}
{{ end }}
{{ end }}
{{ end }}