diff --git a/helm/templates/_tplValues.tpl b/helm/templates/_tplValues.tpl index bf10856..db4945c 100644 --- a/helm/templates/_tplValues.tpl +++ b/helm/templates/_tplValues.tpl @@ -45,6 +45,14 @@ End of usage example Custom definitions */}} +{{- define "common.initContainer.configManagement.merged" -}} +{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.initContainer.configManagement .Values.global.configManagement ) "context" . ) }} +{{- end -}} + +{{- define "common.mapproxinator.configManagement.merged" -}} +{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.mapproxinator.configManagement .Values.global.configManagement ) "context" . ) }} +{{- end -}} + {{- define "common.storage.merged" -}} {{- include "common.tplvalues.merge" ( dict "values" ( list .Values.storage .Values.global.storage ) "context" . ) }} {{- end -}} diff --git a/helm/templates/intital-container/initial-container-configmap.yaml b/helm/templates/intital-container/initial-container-configmap.yaml index abe49aa..4fb0450 100644 --- a/helm/templates/intital-container/initial-container-configmap.yaml +++ b/helm/templates/intital-container/initial-container-configmap.yaml @@ -2,6 +2,7 @@ {{- $chartName := include "mapproxy.name" . -}} {{- $releaseName := .Release.Name -}} {{- $initConfigmapName := include "init-configmap.fullname" . -}} +{{- $configManagement := (include "common.initContainer.configManagement.merged" .) | fromYaml }} {{- $db := (include "common.db.merged" .) | fromYaml }} {{- $s3 := (include "common.s3.merged" .) | fromYaml }} {{- $storage := (include "common.storage.merged" .) | fromYaml }} @@ -16,6 +17,12 @@ metadata: release: {{ $releaseName }} data: LOG_LEVEL: {{ .Values.initContainer.env.logLevel | quote }} + {{- with $configManagement }} + CONFIG_NAME: {{ .name | quote }} + CONFIG_VERSION: {{ .version | quote }} + CONFIG_OFFLINE_MODE: {{ .offlineMode | quote }} + CONFIG_SERVER_URL: {{ .serverUrl | quote }} + {{- end }} CONFIG_PROVIDER: {{ $storage.mapproxyConfigProvider }} S3_ENDPOINT_URL: {{ $s3.endpointUrl }} S3_BUCKET: {{ $s3.tilesBucket }} diff --git a/helm/templates/mapproxinator/mapproxinator-configmap.yaml b/helm/templates/mapproxinator/mapproxinator-configmap.yaml index 753c8a5..44c36e3 100644 --- a/helm/templates/mapproxinator/mapproxinator-configmap.yaml +++ b/helm/templates/mapproxinator/mapproxinator-configmap.yaml @@ -2,6 +2,7 @@ {{- $chartName := include "mapproxy.name" . -}} {{- $releaseName := .Release.Name -}} {{- $mapproxinatorConfigmapName := include "mapproxinator-configmap.fullname" . -}} +{{- $configManagement := (include "common.mapproxinator.configManagement.merged" .) | fromYaml }} {{- $db := (include "common.db.merged" .) | fromYaml }} {{- $s3 := (include "common.s3.merged" .) | fromYaml }} {{- $storage := (include "common.storage.merged" .) | fromYaml }} @@ -22,14 +23,20 @@ data: RESPONSE_COMPRESSION_ENABLED: {{ .Values.mapproxinator.env.responseCompressionEnabled | quote }} LOG_LEVEL: {{ .Values.mapproxinator.env.logLevel | quote }} LOG_PRETTY_PRINT_ENABLED: {{ .Values.mapproxinator.env.logPrettyPrintEnabled | quote }} - {{ if $tracing.enabled }} + {{- if $tracing.enabled }} TELEMETRY_TRACING_ENABLED: 'true' TELEMETRY_TRACING_URL: {{ $tracing.url }} - {{ end }} - {{ if $metrics.enabled }} + {{- end }} + {{- if $metrics.enabled }} TELEMETRY_METRICS_ENABLED: 'true' TELEMETRY_METRICS_URL: {{ $metrics.url }} - {{ end }} + {{- end }} + {{- with $configManagement }} + CONFIG_NAME: {{ .name | quote }} + CONFIG_VERSION: {{ .version | quote }} + CONFIG_OFFLINE_MODE: {{ .offlineMode | quote }} + CONFIG_SERVER_URL: {{ .serverUrl | quote }} + {{- end }} SERVER_PORT: {{ .Values.mapproxinator.targetPort | quote }} CONFIG_PROVIDER: {{ $storage.mapproxyConfigProvider | quote }} POLL_TIMEOUT_FREQUENCY_MS: {{ .Values.mapproxinator.env.poll.timeout.frequencyMS | quote }} diff --git a/helm/values.yaml b/helm/values.yaml index a9fb67d..84f586e 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -3,6 +3,7 @@ global: dockerRegistryUrl: my-registry-url.io imagePullSecretName: "my-registry-secret" flavor: openshift + configManagement: {} tracing: enabled: false url: "" @@ -213,6 +214,11 @@ initContainer: image: repository: mapproxinator tag: "latest" + configManagement: + offlineMode: false + name: 'mapproxinator' + version: 'latest' + serverUrl: 'http://localhost:8080/api' env: logLevel: warn ssl: @@ -394,6 +400,11 @@ mapproxinator: port: 80 targetPort: 8081 nodePort: 30002 + configManagement: + offlineMode: false + name: 'mapproxinator' + version: 'latest' + serverUrl: 'http://localhost:8080/api' env: logLevel: warn poll: