Skip to content

Commit

Permalink
Fix minio secret handling
Browse files Browse the repository at this point in the history
* Add note to vector volume mount
  • Loading branch information
drpsyko101 committed Apr 13, 2024
1 parent e0ee868 commit 1614614
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
16 changes: 16 additions & 0 deletions charts/supabase/templates/secrets/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,19 @@ Expand the name of the s3 secret.
{{- define "supabase.secret.s3" -}}
{{- printf "%s-s3" (include "supabase.fullname" .) }}
{{- end -}}

{{/*
Check if both s3 keys are valid
*/}}
{{- define "supabase.secret.s3.isValid" -}}
{{- $isValid := "false" -}}
{{- if .Values.secret.s3.keyId -}}
{{- if .Values.secret.s3.accessKey -}}
{{- printf "true" -}}
{{- else -}}
{{- printf "false" -}}
{{- end -}}
{{- else -}}
{{- printf "false" -}}
{{- end -}}
{{- end -}}
12 changes: 11 additions & 1 deletion charts/supabase/templates/storage/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,27 @@ spec:
- name: IMGPROXY_URL
value: http://{{ include "supabase.imgproxy.fullname" . }}:{{ .Values.imgproxy.service.port | int }}
{{- end }}
{{- if .Values.secret.s3 }}
{{- if eq (include "supabase.secret.s3.isValid" .) "true" }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
{{- if .Values.secret.s3.secretRef }}
name: {{ .Values.secret.s3.secretRef }}
key: {{ .Values.secret.s3.secretRefKey.keyId | default "keyId" }}
{{- else }}
name: {{ include "supabase.secret.s3" . }}
key: keyId
{{- end }}
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
{{- if .Values.secret.s3.secretRef }}
name: {{ .Values.secret.s3.secretRef }}
key: {{ .Values.secret.s3.secretRefKey.keyId | default "accessKey" }}
{{- else }}
name: {{ include "supabase.secret.s3" . }}
key: accessKey
{{- end }}
{{- end }}
{{- if .Values.minio.enabled }}
- name: GLOBAL_S3_ENDPOINT
Expand Down
3 changes: 3 additions & 0 deletions charts/supabase/values.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ vector:
path: /health
port: 9001
initialDelaySeconds: 3
## Vector requires logs from the control plane to function.
## This is normally stored in /var/log/pods
## Modify these values according to your environment.
volumeMounts:
- name: pod-logs
mountPath: /var/log/pods
Expand Down

0 comments on commit 1614614

Please sign in to comment.