From 9efe1a44eccb99e01e6c984971fab5897ad80a7a Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Thu, 18 Mar 2021 08:40:54 -0700 Subject: [PATCH] feat(helm): Add optional apt-get install to superset_bootstrap.sh (#13678) * add conditional apt install * move install switch to correct command. --- helm/superset/templates/_helpers.tpl | 12 +++++++++--- helm/superset/values.yaml | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/helm/superset/templates/_helpers.tpl b/helm/superset/templates/_helpers.tpl index c093bf5a5..67496aae1 100644 --- a/helm/superset/templates/_helpers.tpl +++ b/helm/superset/templates/_helpers.tpl @@ -49,11 +49,17 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "superset-bootstrap" }} +{{- define "superset-bootstrap" -}} #!/bin/sh - +{{ if .Values.additionalAptPackages }} +apt-get update -y \ + && apt-get install -y --no-install-recommends \ + {{ range .Values.additionalAptPackages }}{{ . }} {{ end }}\ + && rm -rf /var/lib/apt/lists/* +{{ end -}} +{{ if .Values.additionalRequirements }} pip install {{ range .Values.additionalRequirements }}{{ . }} {{ end }} - +{{ end -}} {{ end -}} {{- define "superset-config" }} diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index ab247f2d8..b0116704e 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -27,6 +27,10 @@ additionalRequirements: - "psycopg2==2.8.5" - "redis==3.2.1" +## These apt packages are applied on init of superset containers +additionalAptPackages: {} + # - nano + ## The name of the secret which we will use to generate a superset_config.py file ## Note: this secret must have the key superset_config.py in it and can include other files as well ##