Skip to content

Commit 7b635ef

Browse files
GeorgianaElenajnywong
authored andcommitted
Don't manage the k8s secret for prometheus auth from this chart
1 parent f23bec1 commit 7b635ef

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

helm/jupyterhub-cost-monitoring/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ spec:
3434
{{- with .Values.extraEnv }}
3535
{{- tpl (. | toYaml) $ | nindent 12 }}
3636
{{- end }}
37+
{{- if .Values.prometheusAuth.enabled }}
3738
- name: PROMETHEUS_USERNAME
3839
valueFrom:
3940
secretKeyRef:
40-
name: {{ include "jupyterhub-cost-monitoring.webserver.fullname" . }}
41+
name: {{ .Values.prometheusAuth.envFromSecret }}
4142
key: username
4243
- name: PROMETHEUS_PASSWORD
4344
valueFrom:
4445
secretKeyRef:
45-
name: {{ include "jupyterhub-cost-monitoring.webserver.fullname" . }}
46+
name: {{ .Values.prometheusAuth.envFromSecret }}
4647
key: password
48+
{{- end }}
4749
resources:
4850
{{- .Values.resources | toYaml | nindent 12 }}
4951
securityContext:

helm/jupyterhub-cost-monitoring/templates/secret.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

helm/jupyterhub-cost-monitoring/values.schema.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,16 @@ prometheusAuth:
172172
properties:
173173
enabled:
174174
type: boolean
175-
username:
175+
envFromSecret:
176176
type: string
177-
password:
178-
type: string
179-
required: [enabled]
177+
required: [enabled]
178+
# If enabled, then make envFromSecret mandatory
179+
anyOf:
180+
- properties:
181+
enabled:
182+
const: true
183+
required:
184+
- envFromSecret
185+
- properties:
186+
enabled:
187+
const: false

helm/jupyterhub-cost-monitoring/values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,4 @@ networkPolicy:
7575
#
7676
prometheusAuth:
7777
enabled: false
78-
username: ""
79-
password: ""
78+
envFromSecret: ""

0 commit comments

Comments
 (0)