diff --git a/deployment/helm/webapp-polder/templates/configmap.yaml b/deployment/helm/webapp-polder/templates/configmap.yaml new file mode 100644 index 0000000..89077a5 --- /dev/null +++ b/deployment/helm/webapp-polder/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "webapp-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..627fdc3 100644 --- a/deployment/helm/webapp-polder/templates/deployment.yaml +++ b/deployment/helm/webapp-polder/templates/deployment.yaml @@ -46,14 +46,20 @@ spec: {{- toYaml .Values.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumeMounts }} volumeMounts: + {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.volumes }} + - name: {{ include "webapp-polder.fullname" . }}-config + mountPath: /usr/share/nginx/html/app_config.js + subPath: app_config.js volumes: + {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} + - name: {{ include "webapp-polder.fullname" . }}-config + configMap: + name: {{ include "webapp-polder.fullname" . }}-configmap {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} 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"