Skip to content

Commit

Permalink
Add extraenv secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaspi committed Oct 30, 2024
1 parent 17e2976 commit 91b5193
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
8 changes: 4 additions & 4 deletions charts/jupyter-python/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ spec:
- name: DARK_MODE
value: "true"
{{- end }}
{{- range .Values.extraEnvVars }}
- name: {{ .name }}
value: {{ tpl .value $.Values }}
{{- end }}
envFrom:
- secretRef:
name: {{ include "library-chart.secretNameToken" . }}
Expand Down Expand Up @@ -222,6 +218,10 @@ spec:
- secretRef:
name: {{ include "library-chart.secretNameMLFlow" . }}
{{- end }}
{{- if .Values.extraEnvVars }}
- secretRef:
name: {{ include "library-chart.secretNameExtraEnv" . }}
{{- end }}
livenessProbe:
httpGet:
path: /
Expand Down
2 changes: 1 addition & 1 deletion charts/library-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
name: library-chart
version: 1.5.28
version: 1.5.29
type: library
33 changes: 28 additions & 5 deletions charts/library-chart/templates/_secret.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ stringData:
{{/* Secret for CoreSite.xml Metastore */}}
{{- define "library-chart.coreSite" -}}
{{ printf "<?xml version=\"1.0\"?>" }}
{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>" }}
{{ printf "<configuration>"}}
{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>" }}
{{ printf "<configuration>"}}
{{ printf "<property>"}}
{{ printf "<name>fs.s3a.connection.ssl.enabled</name>" | indent 4}}
{{ printf "<value>true</value>" | indent 4}}
Expand Down Expand Up @@ -255,8 +255,8 @@ stringData:
{{/* Secret for Hive Metastore */}}
{{- define "hiveMetastore.secret" -}}
{{- printf "<?xml version=\"1.0\"?>\n" }}
{{- printf "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>\n" }}
{{- printf "<configuration>\n"}}
{{- printf "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>\n" }}
{{- printf "<configuration>\n"}}
{{- range $index, $secret := (lookup "v1" "Secret" .Release.Namespace "").items }}
{{- if (index $secret "metadata" "annotations") }}
{{- if and (index $secret "metadata" "annotations" "onyxia/discovery") (eq "hive" (index $secret "metadata" "annotations" "onyxia/discovery" | toString)) }}
Expand Down Expand Up @@ -422,7 +422,6 @@ Flag to disable certificate checking for Spark
{{- end }}
{{- end }}


{{/* Template to generate a Secret for SparkConf */}}
{{- define "library-chart.secretSparkConf" -}}
{{- if .Values.spark.default -}}
Expand Down Expand Up @@ -473,3 +472,27 @@ stringData:
{{- end }}
{{- end }}
{{- end }}



{{/* Name of the extraEnv secret */}}
{{- define "library-chart.secretNameExtraEnv" -}}
{{- printf "%s-secretextraenv" (include "library-chart.fullname" .) }}
{{- end }}

{{/* Template to generate a secret for extra environment variables */}}
{{- define "library-chart.secretExtraEnv" -}}
{{- if .Values.extraEnvVars }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "library-chart.secretNameExtraEnv" . }}
labels:
{{- include "library-chart.labels" . | nindent 4 }}
type: Opaque
stringData:
{{- range .Values.extraEnvVars }}
{{ .name | trim }}: {{ tpl .value $.Values | quote }}
{{- end }}
{{- end }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/vscode-python/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ spec:
- name: DARK_MODE
value: "true"
{{- end }}
{{- range .Values.extraEnvVars }}
- name: {{ .name }}
value: {{ tpl .value $.Values }}
{{- end }}
envFrom:
- secretRef:
name : {{ include "library-chart.secretNameToken" . }}
Expand Down Expand Up @@ -208,6 +204,10 @@ spec:
- secretRef:
name: {{ include "library-chart.secretNameMLFlow" . }}
{{- end }}
{{- if .Values.extraEnvVars }}
- secretRef:
name: {{ include "library-chart.secretNameExtraEnv" . }}
{{- end }}
livenessProbe:
httpGet:
path: /
Expand Down

0 comments on commit 91b5193

Please sign in to comment.