From da64b52f974019e450d120f6bd2794503a3a9c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gaspard=20F=C3=A9rey?= Date: Wed, 30 Oct 2024 11:04:34 +0100 Subject: [PATCH] Add add custom environment variables in services (extraEnvVars value) (#170) --- charts/jupyter-pyspark/Chart.yaml | 2 +- .../templates/statefulset.yaml | 3 +++ charts/jupyter-pyspark/values.schema.json | 20 +++++++++++++++++++ charts/jupyter-pyspark/values.yaml | 7 +++++++ charts/jupyter-python/Chart.yaml | 2 +- .../jupyter-python/templates/statefulset.yaml | 3 +++ charts/jupyter-python/values.schema.json | 20 +++++++++++++++++++ charts/jupyter-python/values.yaml | 7 +++++++ charts/rstudio-sparkr/Chart.yaml | 2 +- .../rstudio-sparkr/templates/statefulset.yaml | 3 +++ charts/rstudio-sparkr/values.schema.json | 20 +++++++++++++++++++ charts/rstudio-sparkr/values.yaml | 9 +++++++-- charts/rstudio/Chart.yaml | 2 +- charts/rstudio/templates/statefulset.yaml | 3 +++ charts/rstudio/values.schema.json | 20 +++++++++++++++++++ charts/rstudio/values.yaml | 7 +++++++ charts/vscode-pyspark/Chart.yaml | 2 +- .../vscode-pyspark/templates/statefulset.yaml | 3 +++ charts/vscode-pyspark/values.schema.json | 20 +++++++++++++++++++ charts/vscode-pyspark/values.yaml | 8 +++++++- charts/vscode-python/Chart.yaml | 2 +- .../vscode-python/templates/statefulset.yaml | 3 +++ charts/vscode-python/values.schema.json | 20 +++++++++++++++++++ charts/vscode-python/values.yaml | 7 +++++++ 24 files changed, 186 insertions(+), 9 deletions(-) diff --git a/charts/jupyter-pyspark/Chart.yaml b/charts/jupyter-pyspark/Chart.yaml index 06c2c21e..6c6548b3 100644 --- a/charts/jupyter-pyspark/Chart.yaml +++ b/charts/jupyter-pyspark/Chart.yaml @@ -24,7 +24,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.8 +version: 2.1.9 dependencies: - name: library-chart diff --git a/charts/jupyter-pyspark/templates/statefulset.yaml b/charts/jupyter-pyspark/templates/statefulset.yaml index 493d66a7..2f65e94a 100644 --- a/charts/jupyter-pyspark/templates/statefulset.yaml +++ b/charts/jupyter-pyspark/templates/statefulset.yaml @@ -240,6 +240,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: - secretRef: name: {{ include "library-chart.secretNameToken" . }} diff --git a/charts/jupyter-pyspark/values.schema.json b/charts/jupyter-pyspark/values.schema.json index ecf92590..5fc6f134 100644 --- a/charts/jupyter-pyspark/values.schema.json +++ b/charts/jupyter-pyspark/values.schema.json @@ -264,6 +264,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/jupyter-pyspark/values.yaml b/charts/jupyter-pyspark/values.yaml index 5a920322..6fbf4142 100644 --- a/charts/jupyter-pyspark/values.yaml +++ b/charts/jupyter-pyspark/values.yaml @@ -49,6 +49,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + environment: user: onyxia group: users diff --git a/charts/jupyter-python/Chart.yaml b/charts/jupyter-python/Chart.yaml index 659714df..12e6d799 100644 --- a/charts/jupyter-python/Chart.yaml +++ b/charts/jupyter-python/Chart.yaml @@ -22,7 +22,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.7 +version: 2.1.8 dependencies: - name: library-chart diff --git a/charts/jupyter-python/templates/statefulset.yaml b/charts/jupyter-python/templates/statefulset.yaml index bf02d975..08344d78 100644 --- a/charts/jupyter-python/templates/statefulset.yaml +++ b/charts/jupyter-python/templates/statefulset.yaml @@ -191,6 +191,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: - secretRef: name: {{ include "library-chart.secretNameToken" . }} diff --git a/charts/jupyter-python/values.schema.json b/charts/jupyter-python/values.schema.json index 895afbf6..fcca49ed 100644 --- a/charts/jupyter-python/values.schema.json +++ b/charts/jupyter-python/values.schema.json @@ -217,6 +217,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/jupyter-python/values.yaml b/charts/jupyter-python/values.yaml index 6d563077..cc8b3951 100644 --- a/charts/jupyter-python/values.yaml +++ b/charts/jupyter-python/values.yaml @@ -25,6 +25,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + environment: user: onyxia group: users diff --git a/charts/rstudio-sparkr/Chart.yaml b/charts/rstudio-sparkr/Chart.yaml index 754d4dbd..1a40676d 100644 --- a/charts/rstudio-sparkr/Chart.yaml +++ b/charts/rstudio-sparkr/Chart.yaml @@ -23,7 +23,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.6 +version: 2.1.7 dependencies: - name: library-chart version: 1.5.28 diff --git a/charts/rstudio-sparkr/templates/statefulset.yaml b/charts/rstudio-sparkr/templates/statefulset.yaml index e1fb55b8..61840561 100644 --- a/charts/rstudio-sparkr/templates/statefulset.yaml +++ b/charts/rstudio-sparkr/templates/statefulset.yaml @@ -215,6 +215,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: - secretRef: name: {{ include "library-chart.secretNameToken" . }} diff --git a/charts/rstudio-sparkr/values.schema.json b/charts/rstudio-sparkr/values.schema.json index 40f55806..f04c205e 100644 --- a/charts/rstudio-sparkr/values.schema.json +++ b/charts/rstudio-sparkr/values.schema.json @@ -222,6 +222,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/rstudio-sparkr/values.yaml b/charts/rstudio-sparkr/values.yaml index 705e9a03..4e007ac2 100644 --- a/charts/rstudio-sparkr/values.yaml +++ b/charts/rstudio-sparkr/values.yaml @@ -49,6 +49,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + environment: root: true user: onyxia @@ -75,7 +82,6 @@ s3: secretAccessKey: "" sessionToken: "" - vault: # Specifies whether a config map should be created enabled: true @@ -105,7 +111,6 @@ git: # Declare variables to be passed into your templates. replicaCount: 1 - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" diff --git a/charts/rstudio/Chart.yaml b/charts/rstudio/Chart.yaml index a12e6e1c..2aa12de8 100644 --- a/charts/rstudio/Chart.yaml +++ b/charts/rstudio/Chart.yaml @@ -22,7 +22,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.4 +version: 2.1.5 dependencies: - name: library-chart version: 1.5.28 diff --git a/charts/rstudio/templates/statefulset.yaml b/charts/rstudio/templates/statefulset.yaml index ebee21ea..678a7be4 100644 --- a/charts/rstudio/templates/statefulset.yaml +++ b/charts/rstudio/templates/statefulset.yaml @@ -150,6 +150,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: {{- if .Values.s3.enabled }} - secretRef: diff --git a/charts/rstudio/values.schema.json b/charts/rstudio/values.schema.json index a97c3d56..1e9e74dc 100644 --- a/charts/rstudio/values.schema.json +++ b/charts/rstudio/values.schema.json @@ -217,6 +217,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/rstudio/values.yaml b/charts/rstudio/values.yaml index 6eb185ae..b2fc2ea8 100644 --- a/charts/rstudio/values.yaml +++ b/charts/rstudio/values.yaml @@ -25,6 +25,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + environment: user: onyxia group: users diff --git a/charts/vscode-pyspark/Chart.yaml b/charts/vscode-pyspark/Chart.yaml index 260888da..e5d83571 100644 --- a/charts/vscode-pyspark/Chart.yaml +++ b/charts/vscode-pyspark/Chart.yaml @@ -24,7 +24,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.9 +version: 2.1.10 dependencies: - name: library-chart diff --git a/charts/vscode-pyspark/templates/statefulset.yaml b/charts/vscode-pyspark/templates/statefulset.yaml index bf201a3a..b1ba9fd7 100644 --- a/charts/vscode-pyspark/templates/statefulset.yaml +++ b/charts/vscode-pyspark/templates/statefulset.yaml @@ -237,6 +237,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: - secretRef: name: {{ include "library-chart.secretNameToken" . }} diff --git a/charts/vscode-pyspark/values.schema.json b/charts/vscode-pyspark/values.schema.json index a4abfdae..87e6d991 100644 --- a/charts/vscode-pyspark/values.schema.json +++ b/charts/vscode-pyspark/values.schema.json @@ -248,6 +248,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/vscode-pyspark/values.yaml b/charts/vscode-pyspark/values.yaml index c954802b..fc61a839 100644 --- a/charts/vscode-pyspark/values.yaml +++ b/charts/vscode-pyspark/values.yaml @@ -49,6 +49,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + environment: user: onyxia group: users @@ -125,7 +132,6 @@ metaflow: # Declare variables to be passed into your templates. replicaCount: 1 - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" diff --git a/charts/vscode-python/Chart.yaml b/charts/vscode-python/Chart.yaml index 96fd32a8..10f02167 100644 --- a/charts/vscode-python/Chart.yaml +++ b/charts/vscode-python/Chart.yaml @@ -22,7 +22,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.8 +version: 2.1.9 dependencies: - name: library-chart diff --git a/charts/vscode-python/templates/statefulset.yaml b/charts/vscode-python/templates/statefulset.yaml index 8a991f53..fc6b6215 100644 --- a/charts/vscode-python/templates/statefulset.yaml +++ b/charts/vscode-python/templates/statefulset.yaml @@ -177,6 +177,9 @@ spec: - name: DARK_MODE value: "true" {{- end }} + {{- with .Values.extraEnvVars }} + {{- tpl (toYaml .) $.Values | nindent 12 }} + {{- end }} envFrom: - secretRef: name : {{ include "library-chart.secretNameToken" . }} diff --git a/charts/vscode-python/values.schema.json b/charts/vscode-python/values.schema.json index 6a6e1a6b..34f1fc69 100644 --- a/charts/vscode-python/values.schema.json +++ b/charts/vscode-python/values.schema.json @@ -226,6 +226,26 @@ } } }, + "extraEnvVars": { + "description": "environment variables available within your service", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteSchemaWith": "ide/extraenv.json" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "kubernetes": { "description": "configuration of your kubernetes access", "type": "object", diff --git a/charts/vscode-python/values.yaml b/charts/vscode-python/values.yaml index 95a2ea39..1e447688 100644 --- a/charts/vscode-python/values.yaml +++ b/charts/vscode-python/values.yaml @@ -26,6 +26,13 @@ init: personalInit: "" personalInitArgs: "" +# Array with (templated) extra environment variables to be made accessible within the service +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" +extraEnvVars: [] + s3: # Specifies whether a config map should be created enabled: true