Skip to content

Commit

Permalink
feat: Support to pull bucket configurations from secrets (#224)
Browse files Browse the repository at this point in the history
Support to pull bucket configurations from secrets
  • Loading branch information
velotioaastha authored Sep 30, 2024
1 parent 43982fb commit dbd3973
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.18.1
version: 0.18.2
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
10 changes: 8 additions & 2 deletions charts/operator-wandb/templates/_bucket.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{{/*
Return name of secret where bucket information is stored
Return the bucket credentials secret name
*/}}
{{- define "wandb.bucket.secret" -}}
{{- print .Release.Name "-bucket" -}}
{{- if .Values.global.bucket.secretName -}}
{{ .Values.global.bucket.secretName }}
{{- else if .Values.global.defaultBucket.secretName -}}
{{ .Values.global.defaultBucket.secretName }}
{{- else }}
{{- print .Release.Name "-bucket" -}}
{{- end -}}
{{- end }}
4 changes: 3 additions & 1 deletion charts/operator-wandb/templates/bucket.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.global.bucket.secretName }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,4 +7,5 @@ metadata:
{{- include "wandb.commonLabels" . | nindent 4 }}
data:
ACCESS_KEY: {{ .Values.global.bucket.accessKey | default .Values.global.defaultBucket.accessKey | b64enc }}
SECRET_KEY: {{ .Values.global.bucket.secretKey | default .Values.global.defaultBucket.secretKey | b64enc }}
SECRET_KEY: {{ .Values.global.bucket.secretKey | default .Values.global.defaultBucket.secretKey | b64enc }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/operator-wandb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ global:
kmsKey: ""
secretKey: ""
accessKey: ""
secretName: ""

# If specified the application will use this bucket for all storage operations, and will not be overridable by the user.
bucket: {}
bucket:
secretName: ""

redis:
host: ""
Expand Down

0 comments on commit dbd3973

Please sign in to comment.