Skip to content

Commit

Permalink
Merge pull request #91 from getlago/worker-minio
Browse files Browse the repository at this point in the history
fix(worker-deployment): include S3 credentials when using MinIO
  • Loading branch information
electrosenpai authored Oct 29, 2024
2 parents 2c8fc40 + e46a5bc commit 0d09f34
Showing 1 changed file with 50 additions and 13 deletions.
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 @@ -180,13 +217,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

0 comments on commit 0d09f34

Please sign in to comment.