From 43528e2d983f5eb1b00f1e1112d0b3fe593c819a Mon Sep 17 00:00:00 2001 From: Felix Delattre Date: Mon, 28 Oct 2024 16:34:06 +0100 Subject: [PATCH] Adjusted deployment for webapp. Co-authored-by: Ciaran Sweet --- .../helm/webapp-polder/templates/configmap.yaml | 11 +++++++++++ .../helm/webapp-polder/templates/deployment.yaml | 6 ++++++ deployment/helm/webapp-polder/values.yaml | 7 ++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 deployment/helm/webapp-polder/templates/configmap.yaml diff --git a/deployment/helm/webapp-polder/templates/configmap.yaml b/deployment/helm/webapp-polder/templates/configmap.yaml new file mode 100644 index 0000000..40e4e7f --- /dev/null +++ b/deployment/helm/webapp-polder/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "polder.fullname" . }}-configmap +data: + app_config.js: | + window.__APP_CONFIG__ = { + MAPBOX_TOKEN: "{{ .Values.mapboxToken }}", + STAC_API: "{{ .Values.stacApi }}", + TILER_API: "{{ .Values.tilerApi }}", + }; diff --git a/deployment/helm/webapp-polder/templates/deployment.yaml b/deployment/helm/webapp-polder/templates/deployment.yaml index ccf0400..3793fdc 100644 --- a/deployment/helm/webapp-polder/templates/deployment.yaml +++ b/deployment/helm/webapp-polder/templates/deployment.yaml @@ -48,10 +48,16 @@ spec: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.volumeMounts }} volumeMounts: + - name: {{ include "polder.fullname" . }}-config + mountPath: /usr/share/nginx/html/app_config.js + subPath: app_config.js {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.volumes }} volumes: + - name: {{ include "polder.fullname" . }}-config + configMap: + name: {{ include "polder.fullname" . }}-configmap {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} diff --git a/deployment/helm/webapp-polder/values.yaml b/deployment/helm/webapp-polder/values.yaml index ea97a29..4c0b9cf 100644 --- a/deployment/helm/webapp-polder/values.yaml +++ b/deployment/helm/webapp-polder/values.yaml @@ -32,7 +32,7 @@ serviceAccount: name: "" # This is for setting Kubernetes Annotations to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} # This is for setting Kubernetes Labels to a Pod. # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -121,3 +121,8 @@ nodeSelector: {} tolerations: [] affinity: {} + +# polder custom configuration +mapboxToken: "token" +stacApi: "http://localhost:8080" +tilerApi: "http://localhost:8081"