From 0b45cf8292d8b5f7e4e0fe8928935137dd8cc881 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:03:39 +0300 Subject: [PATCH 1/3] chore: config management support --- helm/templates/_tplValues.tpl | 8 ++++++++ .../initial-container-configmap.yaml | 7 +++++++ .../mapproxinator/mapproxinator-configmap.yaml | 7 ++++++- helm/values.yaml | 11 +++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) 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..fa69777 100644 --- a/helm/templates/mapproxinator/mapproxinator-configmap.yaml +++ b/helm/templates/mapproxinator/mapproxinator-configmap.yaml @@ -29,7 +29,12 @@ data: {{ if $metrics.enabled }} TELEMETRY_METRICS_ENABLED: 'true' TELEMETRY_METRICS_URL: {{ $metrics.url }} - {{ 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 19b0f9e..cabe007 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: "" @@ -192,6 +193,11 @@ initContainer: image: repository: mapproxinator tag: "latest" + configManagement: + offlineMode: false + name: 'mapproxinator' + version: '' + serverUrl: '' env: logLevel: warn ssl: @@ -321,6 +327,11 @@ mapproxinator: port: 80 targetPort: 8081 nodePort: 30002 + configManagement: + offlineMode: false + name: 'mapproxinator' + version: '' + serverUrl: '' env: logLevel: warn poll: From ea7c309f1f90788acefb7fa65f94ec75c49e5f80 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:03:49 +0300 Subject: [PATCH 2/3] chore: cleanup templates --- helm/templates/mapproxinator/mapproxinator-configmap.yaml | 8 +++++--- helm/templates/mapproxy/mapproxy-container.yaml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helm/templates/mapproxinator/mapproxinator-configmap.yaml b/helm/templates/mapproxinator/mapproxinator-configmap.yaml index fa69777..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,13 +23,14 @@ 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 }} {{- with $configManagement }} CONFIG_NAME: {{ .name | quote }} CONFIG_VERSION: {{ .version | quote }} diff --git a/helm/templates/mapproxy/mapproxy-container.yaml b/helm/templates/mapproxy/mapproxy-container.yaml index b9bb8ea..00c8e6f 100644 --- a/helm/templates/mapproxy/mapproxy-container.yaml +++ b/helm/templates/mapproxy/mapproxy-container.yaml @@ -4,7 +4,7 @@ {{- $fs := (include "common.fs.merged" .) | fromYaml }} - name: mapproxy image: {{ .cloudProviderDockerRegistryUrl }}{{ .Values.mapproxy.image.repository }}:{{ .Values.mapproxy.image.tag }} - imagePullPolicy: {{ .Values.imagePullPolicy }} + imagePullPolicy: {{ .Values.imagePullPolicy }} env: - name: REDIS_TLS value: {{ .Values.mapproxy.redis.tls | quote }} From f8423a267becf7c3f60e2185dfd796e704c738a7 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:45:31 +0300 Subject: [PATCH 3/3] chore: cleanup templates --- helm/templates/_helpers.tpl | 2 +- helm/templates/mapproxy-bundle.yaml | 13 ++++++------- helm/values.yaml | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 661c57f..3344739 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -48,7 +48,7 @@ Selector labels {{- define "mapproxy.selectorLabels" -}} app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} app.kubernetes.io/instance: {{ .Release.Name }}-{{ .type }} -{{ include "mclabels.selectorLabels" . }} +{{- include "mclabels.selectorLabels" . }} {{- end }} {{/* diff --git a/helm/templates/mapproxy-bundle.yaml b/helm/templates/mapproxy-bundle.yaml index f5f732c..917b88b 100644 --- a/helm/templates/mapproxy-bundle.yaml +++ b/helm/templates/mapproxy-bundle.yaml @@ -15,23 +15,22 @@ app: {{ .chartName }}-{{ .type }} release: {{ .releaseName }}-{{ .type }} run: {{ .releaseName }}-{{ .chartName }}-{{ .type }} - {{ include "mapproxy.selectorLabels" . | nindent 6 }} + {{- include "mapproxy.selectorLabels" . | nindent 6 }} template: metadata: labels: app: {{ .chartName }}-{{ .type }} release: {{ .releaseName }}-{{ .type }} run: {{ .releaseName }}-{{ .chartName }}-{{ .type }} - {{ include "mapproxy.labels" . | nindent 8 }} + {{- include "mapproxy.labels" . | nindent 8 }} annotations: {{- if .Values.resetOnConfigChange }} - checksum/configmap: {{ - include (print $.Template.BasePath "/mapproxy/mapproxy-configmap.yaml") . | sha256sum }} + checksum/configmap: {{ include (print $.Template.BasePath "/mapproxy/mapproxy-configmap.yaml") . | sha256sum }} {{- end }} {{- if .Values.podAnnotations }} {{- toYaml .Values.podAnnotations | nindent 8 }} {{- end }} - {{ include "mclabels.annotations" . | nindent 8 }} + {{- include "mclabels.annotations" . | nindent 8 }} spec: {{- if $cloudProviderImagePullSecretName }} imagePullSecrets: @@ -73,12 +72,12 @@ items: - key: certFile path: cert.pem - {{- end }} + {{- end }} {{- if .Values.global.ca.secretName }} - name: root-ca secret: secretName: {{ .Values.global.ca.secretName }} - {{- end }} + {{- end }} {{- if .Values.authentication.ssl.enabled }} - name: open-ssl secret: diff --git a/helm/values.yaml b/helm/values.yaml index cabe007..9c25e4a 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -113,7 +113,7 @@ mclabels: partOf: serving owner: raster gisDomain: raster - prometheus: + prometheus: enabled: true port: 9117 logScraping: true