From e087f331f2156345bd980b80d1bdcc46e2407f3e Mon Sep 17 00:00:00 2001 From: Fabio Todaro Date: Fri, 1 Jun 2018 18:15:56 +0200 Subject: [PATCH] [stable/superset] Add env vars from values or secret (#5745) * Add env from value file or secret * Update README * Update variables naming, Update Chart version --- stable/superset/Chart.yaml | 2 +- stable/superset/README.md | 2 ++ stable/superset/templates/deployment.yaml | 10 ++++++++++ stable/superset/values.yaml | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/stable/superset/Chart.yaml b/stable/superset/Chart.yaml index c8e05e4de2..9116fcd22c 100644 --- a/stable/superset/Chart.yaml +++ b/stable/superset/Chart.yaml @@ -1,6 +1,6 @@ description: Apache Superset (incubating) is a modern, enterprise-ready business intelligence web application name: superset -version: 0.1.1 +version: 0.1.2 appVersion: "0.24.0" keywords: - bi diff --git a/stable/superset/README.md b/stable/superset/README.md index 902edf1d14..b040e2a514 100644 --- a/stable/superset/README.md +++ b/stable/superset/README.md @@ -47,6 +47,8 @@ The command removes all the Kubernetes components associated with the chart and | `configFile` | Content of [`superset_config.py`](https://superset.incubator.apache.org/installation.html) | See values.yaml](./values.yaml) | | `initFile` | Content of init shell script | See [values.yaml](./values.yaml) | | `replicas` | Number of replicas of superset | `1` | +| `extraEnv` | Extra environment variables passed to pods | `{}` | +| `extraEnvFromSecret` | The name of a Kubernetes secret (must be manually created in the same namespace) containing values to be added to the environment | `""` | | `persistence.enabled` | Enable persistence | `false` | | `persistence.existingClaim`| Provide an existing PersistentVolumeClaim | `""` | | `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | diff --git a/stable/superset/templates/deployment.yaml b/stable/superset/templates/deployment.yaml index 6799fbdca4..cf1c72ee0a 100644 --- a/stable/superset/templates/deployment.yaml +++ b/stable/superset/templates/deployment.yaml @@ -56,6 +56,16 @@ spec: - name: http containerPort: 8088 protocol: TCP + env: + {{- range $key, $value := .Values.extraEnv }} + - name: "{{ $key }}" + value: "{{ $value }}" + {{- end }} + {{- if .Values.extraEnvFromSecret }} + envFrom: + - secretRef: + name: {{ .Values.extraEnvFromSecret }} + {{- end }} {{- with .Values.resources }} resources: {{ toYaml . | indent 12 }} diff --git a/stable/superset/values.yaml b/stable/superset/values.yaml index 3f7461a638..ecb2a22018 100644 --- a/stable/superset/values.yaml +++ b/stable/superset/values.yaml @@ -47,6 +47,14 @@ configFile: |- # Set this API key to enable Mapbox visualizations MAPBOX_API_KEY = '' +## Extra environment variables that will be passed onto deployment pod +## +extraEnv: {} + +## The name of a secret in the same kubernetes namespace which contain values to be added to the environment +## This can be useful for secret keys, etc +## +extraEnvFromSecret: "" persistence: