Skip to content

Commit 0c6a3e8

Browse files
authored
feat: add valueFrom option to auth.secret (#9932)
1 parent c27f32d commit 0c6a3e8

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

helm/templates/phoenix/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@ spec:
8383
{{- range $authSecrets := .Values.auth.secret }}
8484
- name: {{ $authSecrets.key }}
8585
valueFrom:
86+
{{- if $authSecrets.valueFrom }}
87+
{{- $authSecrets.valueFrom | toYaml | nindent 16 }}
88+
{{- else }}
8689
secretKeyRef:
8790
name: {{ $.Values.auth.name }}
8891
key: {{ $authSecrets.key }}
92+
{{- end }}
8993
{{- end }}
9094
{{- end }}
9195
{{- if and .Values.auth.oauth2.enabled .Values.auth.oauth2.providers }}

helm/templates/phoenix/secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ type: Opaque
99
data:
1010
{{- if .Values.auth.secret }}
1111
{{- range $authSecrets := .Values.auth.secret }}
12-
{{- if eq $authSecrets.key "PHOENIX_DEFAULT_ADMIN_INITIAL_PASSWORD" }}
12+
{{- if and (eq $authSecrets.key "PHOENIX_DEFAULT_ADMIN_INITIAL_PASSWORD") (not $authSecrets.valueFrom) }}
1313
{{ $authSecrets.key }}: {{ (empty $authSecrets.value | ternary $.Values.auth.defaultAdminPassword $authSecrets.value) | b64enc }}
14-
{{- else }}
14+
{{- else if not $authSecrets.valueFrom }}
1515
{{ $authSecrets.key }}: {{ $authSecrets.value | default (randAlphaNum 32) | b64enc }}
1616
{{- end }}
1717
{{- end }}

helm/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ auth:
333333
- key: "PHOENIX_SECRET"
334334
# -- Autogenerated if empty
335335
value: ""
336+
# -- Use this for existing Secrets / Configmaps, takes precedence over auth.secret[].value
337+
# valueFrom:
338+
# secretKeyRef:
339+
# name: my-secret
340+
# key: phoenix-secret-key
336341

337342
# -- Environment variable name for the admin secret key
338343
- key: "PHOENIX_ADMIN_SECRET"
@@ -366,6 +371,8 @@ auth:
366371
# -- List of OAuth2 identity providers to configure
367372
# Each provider requires client_id, client_secret, and oidc_config_url
368373
# Optional settings include display_name, allow_sign_up, and auto_login
374+
# You can also define corresponding ENVs via auth.secrets[].valueFrom to use existing secrets
375+
# ENVs: PHOENIX_OAUTH2_{{ $provider_upper }}_{{ setting }}, e.g. PHOENIX_OAUTH2_GOOGLE_CLIENT_SECRET
369376
providers:
370377
# Example Google configuration:
371378
# google:

0 commit comments

Comments
 (0)