diff --git a/bert_e/server/__init__.py b/bert_e/server/__init__.py index f26f54b8..4888e86f 100644 --- a/bert_e/server/__init__.py +++ b/bert_e/server/__init__.py @@ -71,6 +71,7 @@ def setup_server(bert_e): app = Flask(__name__) app.config.update({ + 'APPLICATION_ROOT': os.getenv('APPLICATION_ROOT', '/'), 'WEBHOOK_LOGIN': os.environ['WEBHOOK_LOGIN'], 'WEBHOOK_PWD': os.environ['WEBHOOK_LOGIN'], 'CLIENT_ID': os.environ['BERT_E_CLIENT_ID'], diff --git a/charts/bert-e/templates/deployment.yaml b/charts/bert-e/templates/deployment.yaml index 88b70c57..b702e0e0 100644 --- a/charts/bert-e/templates/deployment.yaml +++ b/charts/bert-e/templates/deployment.yaml @@ -22,6 +22,7 @@ spec: annotations: checksum/settings: {{ include (print $.Template.BasePath "/settings.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} + checksum/env: {{ include (print $.Template.BasePath "/env.yaml") . | sha256sum }} spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -36,6 +37,10 @@ spec: envFrom: - secretRef: name: {{ template "fullname" $ }} + {{- if .Values.deployment.env }} + - configMapRef: + name: {{ template "fullname" $ }}-env + {{- end }} ports: - name: http containerPort: {{ .Values.deployment.servicePort }} diff --git a/charts/bert-e/templates/env.yaml b/charts/bert-e/templates/env.yaml new file mode 100644 index 00000000..647f9acc --- /dev/null +++ b/charts/bert-e/templates/env.yaml @@ -0,0 +1,15 @@ +{{- if .Values.deployment.env }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" $ }}-env + labels: + app: {{ template "fullname" $ }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: +{{ .Values.deployment.env | toYaml | indent 2 }} +{{- end }} diff --git a/charts/bert-e/values.yaml b/charts/bert-e/values.yaml index 1315fd16..04dfb2bc 100644 --- a/charts/bert-e/values.yaml +++ b/charts/bert-e/values.yaml @@ -313,6 +313,9 @@ image: ## Kubernetes deployment configuration deployment: + # Setup env vars on the deployment + env: {} + # MY_VAR: MY_VALUE ## Configure extra options for liveness and readiness probes livenessProbe: