Skip to content
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

fix(worker-deployment): include S3 credentials when using MinIO #91

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
63 changes: 50 additions & 13 deletions templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,32 +116,69 @@ spec:
name: {{ .Release.Name }}-secrets
key: license
{{ end }}
{{ if .Values.global.s3.enabled }}

{{ if or .Values.global.s3.enabled .Values.minio.enabled }}
- name: LAGO_USE_AWS_S3
value: "true"
{{ if .Values.global.s3.endpoint }}
{{- if .Values.minio.enabled }}
- name: LAGO_AWS_S3_PATH_STYLE
value: "true"
{{- end }}
{{ if or .Values.global.s3.endpoint .Values.minio.endpoint }}
- name: LAGO_AWS_S3_ENDPOINT
value: {{ .Values.global.s3.endpoint | quote }}
value: {{ if .Values.minio.enabled }}
{{ .Values.minio.endpoint | quote }}
{{ else }}
{{ .Values.global.s3.endpoint | quote }}
{{ end }}
{{ end }}
{{ if or .Values.global.s3.accessKeyId .Values.global.existingSecret }}

{{ if or .Values.global.s3.accessKeyId .Values.minio.enabled .Values.global.existingSecret }}
- name: LAGO_AWS_S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ include "secret-path" . }}
key: awsS3AccessKeyId
name: {{ if .Values.minio.enabled }}
{{ .Release.Name }}-minio
{{ else }}
{{ include "secret-path" . }}
{{ end }}
key: {{ if .Values.minio.enabled }}
rootUser
{{ else }}
awsS3AccessKeyId
{{ end }}
{{ end }}
{{ if or .Values.global.s3.secretAccessKey .Values.global.existingSecret }}

{{ if or .Values.global.s3.secretAccessKey .Values.minio.enabled .Values.global.existingSecret }}
- name: LAGO_AWS_S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "secret-path" . }}
key: awsS3SecretAccessKey
name: {{ if .Values.minio.enabled }}
{{ .Release.Name }}-minio
{{ else }}
{{ include "secret-path" . }}
{{ end }}
key: {{ if .Values.minio.enabled }}
rootPassword
{{ else }}
awsS3SecretAccessKey
{{ end }}
{{ end }}

- name: LAGO_AWS_S3_BUCKET
value: {{ .Values.global.s3.bucket | quote }}
value: {{ if .Values.minio.enabled }}
{{ (index .Values.minio.buckets 0).name | quote }}
{{ else }}
{{ .Values.global.s3.bucket | quote }}
{{ end }}
- name: LAGO_AWS_S3_REGION
value: {{ .Values.global.s3.region | quote }}
value: {{ if .Values.global.s3.enabled }}
{{ .Values.global.s3.region | quote }}
{{ else if .Values.minio.enabled }}
{{ default "us-east-1" .Values.minio.region | quote }}
{{ end }}
{{ end }}

{{ if .Values.global.smtp.enabled }}
- name: LAGO_FROM_EMAIL
value: {{ .Values.global.smtp.fromEmail }}
Expand Down Expand Up @@ -176,13 +213,13 @@ spec:
resources:
{{- toYaml . | nindent 12}}
{{- end }}
{{- if and (not .Values.global.s3.enabled) (not .Values.minio.enabled) }}
{{ if and (not .Values.global.s3.enabled) (not .Values.minio.enabled) }}
volumeMounts:
- mountPath: /app/storage
name: {{ .Release.Name }}-storage-data
{{ end }}
restartPolicy: Always
{{- if and (not .Values.global.s3.enabled) (not .Values.minio.enabled) }}
{{ if and (not .Values.global.s3.enabled) (not .Values.minio.enabled) }}
volumes:
- name: {{ .Release.Name }}-storage-data
persistentVolumeClaim:
Expand Down
Loading