Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions helm/config/mapProxyUwsgi.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[uwsgi]
{{- $metrics := (include "common.metrics.merged" .) | fromYaml }}
; based on https://github.com/kartoza/docker-mapproxy/blob/master/build_data/uwsgi.ini
chdir = /mapproxy
wsgi-file = app.py
Expand Down Expand Up @@ -35,7 +34,7 @@ worker-reload-mercy = 60 ; How long to wait before forcefully killin
wsgi-disable-file-wrapper = true
harakiri = {{ .Values.mapproxy.uwsgi.harakiri }}
chmod-socket = 664
{{ if $metrics.enabled }}
{{ if .Values.telemetry.metrics.enabled }}
stats = :{{ .Values.mapproxy.uwsgi.statsServer.stats }}
stats-http = true
stats-min = {{ .Values.mapproxy.uwsgi.statsServer.statsMinify }}
Expand Down
13 changes: 12 additions & 1 deletion helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,15 @@ Returns the cloud provider image pull secret name from global if exists or from
{{- $headerList = uniq $headerList -}}
{{- quote (join "," $headerList) -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Returns the tracing url from global if exists or from the chart's values
*/}}
{{- define "mapproxy.tracingUrl" -}}
{{- if .Values.global.telemetry.tracing.url }}
{{- .Values.global.telemetry.tracing.url -}}
{{- else if .Values.telemetry.tracing.url -}}
{{- .Values.telemetry.tracing.url -}}
{{- end -}}
{{- end -}}
8 changes: 0 additions & 8 deletions helm/templates/_tplValues.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,3 @@ Custom definitions
{{- define "common.fs.merged" -}}
{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.storage.fs .Values.global.storage.fs ) "context" . ) }}
{{- end -}}

{{- define "common.tracing.merged" -}}
{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.tracing .Values.global.tracing ) "context" . ) }}
{{- end -}}

{{- define "common.metrics.merged" -}}
{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics .Values.global.metrics ) "context" . ) }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
name: internal-storage
subPath: config/mapproxy.yaml
{{- end }}
{{- if .Values.global.ca.enabled }}
{{- if .Values.global.ca.secretName }}
- name: REQUESTS_CA_BUNDLE
value: {{ printf "%s/%s" .Values.global.ca.path .Values.global.ca.key | quote }}
{{- end }}
Expand Down
17 changes: 7 additions & 10 deletions helm/templates/mapproxinator/mapproxinator-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{{- $db := (include "common.db.merged" .) | fromYaml }}
{{- $s3 := (include "common.s3.merged" .) | fromYaml }}
{{- $storage := (include "common.storage.merged" .) | fromYaml }}
{{- $metrics := (include "common.metrics.merged" .) | fromYaml }}
{{- $tracing := (include "common.tracing.merged" .) | fromYaml }}
{{- $telemetry := .Values.telemetry -}}
{{- $tracingUrl := include "mapproxy.tracingUrl" . -}}

apiVersion: v1
kind: ConfigMap
Expand All @@ -22,14 +22,11 @@ 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 }}
TELEMETRY_TRACING_ENABLED: 'true'
TELEMETRY_TRACING_URL: {{ $tracing.url }}
{{ end }}
{{ if $metrics.enabled }}
TELEMETRY_METRICS_ENABLED: 'true'
TELEMETRY_METRICS_URL: {{ $metrics.url }}
{{ end }}
TELEMETRY_TRACING_ENABLED: {{ $telemetry.tracing.enabled | quote }}
{{- if $telemetry.tracing.enabled }}
TELEMETRY_TRACING_URL: {{ $tracingUrl | quote }}
{{- end }}
TELEMETRY_METRICS_ENABLED: {{ $telemetry.metrics.enabled | quote }}
SERVER_PORT: {{ .Values.mapproxinator.targetPort | quote }}
CONFIG_PROVIDER: {{ $storage.mapproxyConfigProvider | quote }}
POLL_TIMEOUT_FREQUENCY_MS: {{ .Values.mapproxinator.env.poll.timeout.frequencyMS | quote }}
Expand Down
3 changes: 1 addition & 2 deletions helm/templates/mapproxy-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{{- $sslSecretName := ternary .Values.authentication.ssl.externalSecretName (printf "%s%s" .Release.Name "-open-ssl") .Values.authentication.ssl.useExternal }}
{{- $postgresSecretName := ternary $db.secrets.externalSecretName (printf "%s%s" .Release.Name "-postgres-secret") $db.secrets.useExternal }}
{{- $s3SecretName := ternary $s3.secretName (printf "%s%s" .Release.Name "-s3-secret") (ne $s3.secretName "") }}
{{- $metrics := (include "common.metrics.merged" .) | fromYaml }}
replicas: {{ .replicaCount }}
selector:
matchLabels:
Expand Down Expand Up @@ -46,7 +45,7 @@
######################################################### Mapproxinator Deployment #########################################################
{{- template "mapproxy-chart.mapproxinator-container" (merge (dict "releaseName" .releaseName "chartName" .chartName "cloudProviderDockerRegistryUrl" $cloudProviderDockerRegistryUrl "s3SecretName" $s3SecretName "postgresSecretName" $postgresSecretName) .) }}
######################################################### uwsgi Deployment #########################################################
{{- if $metrics.enabled }}
{{- if .Values.telemetry.metrics.enabled }}
{{- template "mapproxy-chart.uwsgi-exporter-container" (merge (dict "releaseName" .releaseName "chartName" .chartName "cloudProviderDockerRegistryUrl" $cloudProviderDockerRegistryUrl "resources" .Values.uwsgiExporter.resources) .) }}
{{- end }}
volumes:
Expand Down
7 changes: 5 additions & 2 deletions helm/templates/mapproxy/mapproxy-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{{- $releaseName := .Release.Name -}}
{{- $configmapName := include "configmap.fullname" . -}}
{{- $s3 := (include "common.s3.merged" .) | fromYaml }}
{{- $tracing := (include "common.tracing.merged" .) | fromYaml }}
{{- $tracing := .Values.telemetry.tracing -}}
{{- $tracingUrl := include "mapproxy.tracingUrl" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -21,7 +22,9 @@ data:
S3_USERNAME: {{ $s3.username | quote }}
# ── Telemetry / Tracing ───────────────────────────────────────────────────
TELEMETRY_TRACING_ENABLED: {{ $tracing.enabled | quote }}
TELEMETRY_TRACING_ENDPOINT: {{ $tracing.url | quote }}
{{- if $tracing.enabled }}
TELEMETRY_TRACING_ENDPOINT: {{ $tracingUrl | quote }}
{{- end }}
TELEMETRY_TRACING_SAMPLING_RATIO_DENOMINATOR: {{ $tracing.samplingRatioDenominator | quote }}
TELEMETRY_BOTO_ENABLED: {{ .Values.mapproxy.env.telemetry.boto.enabled | quote }}
TELEMETRY_BOTO_CAPTURE_HEADERS: {{ .Values.mapproxy.env.telemetry.boto.captureHeaders | quote }}
Expand Down
3 changes: 1 addition & 2 deletions helm/templates/mapproxy/mapproxy-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{{- $configmapName := include "configmap.fullname" . -}}
{{- $storage := (include "common.storage.merged" .) | fromYaml }}
{{- $fs := (include "common.fs.merged" .) | fromYaml }}
{{- $metrics := (include "common.metrics.merged" .) | fromYaml }}
{{- $caCertPath := printf "%s/%s" .Values.global.ca.path .Values.global.ca.key }}
- name: mapproxy
image: {{ .cloudProviderDockerRegistryUrl }}{{ .Values.mapproxy.image.repository }}:{{ .Values.mapproxy.image.tag }}
Expand Down Expand Up @@ -47,7 +46,7 @@
value: {{ .Values.mapproxy.uwsgi.threads | quote }}
- name: HARAKIRI
value: {{ .Values.mapproxy.uwsgi.harakiri | quote }}
{{- if $metrics.enabled }}
{{- if .Values.telemetry.metrics.enabled }}
# Stats server for uwsgi-exporter / Prometheus
- name: UWSGI_STATS_ENABLED
value: "true"
Expand Down
6 changes: 0 additions & 6 deletions helm/templates/mapproxy/mapproxy-wmts-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
{{- $replicaCount := .Values.mapproxy.wmts.replicaCount }}
{{- $wmtsDeploymentName := include "wmts-deployment.fullname" . }}

{{- if .Values.global.ca.enabled }}
{{- if and .Values.global.ca.secretName (not .Values.global.ca.secretName) }}
{{- fail "When using external ca secret the value for .Values.global.ca.secretName should be set" }}
{{- end }}
{{- end }}

{{- if .Values.authentication.ssl.enabled }}
{{- if and .Values.authentication.ssl.useExternal (not .Values.authentication.ssl.externalSecretName) }}
{{- fail "When using external ssl secret the value for .Values.authentication.ssl.externalSecretName should be set" }}
Expand Down
36 changes: 11 additions & 25 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ global:
dockerRegistryUrl: my-registry-url.io
imagePullSecretName: "my-registry-secret"
flavor: openshift
tracing:
enabled: false
url: ""
samplingRatioDenominator: 1000
metrics:
enabled: false
url: ""
prometheus:
scrape: false
port: 9117
telemetry:
tracing: {}
environment: ""
authentication:
jwtPublicKeySecretName: map-colonies-jwks
Expand Down Expand Up @@ -73,22 +65,19 @@ db:
name: ""
port: 5432
sslEnabled: false
schema: ""
schema: MapproxyConfig
rejectUnauthorized: false
secrets:
useExternal: false
externalSecretName: ""

tracing:
enabled: false
url: ""
# samplingRatioDenominator: 1000
metrics:
enabled: false
url: ""
prometheus:
scrape: false
port: 9117
telemetry:
tracing:
enabled: true
url: http://localhost:4317
samplingRatioDenominator: 1000
metrics:
enabled: true

# add pod annotations
# example:
Expand All @@ -101,7 +90,7 @@ environment: development
initialDelaySeconds: 60
splunkIndex: ""
resetOnConfigChange: true
imagePullPolicy: Always
imagePullPolicy: IfNotPresent

cloudProvider:
dockerRegistryUrl: my-registry-url.io
Expand Down Expand Up @@ -160,9 +149,6 @@ mapproxy:
image:
repository: docker-mapproxy
tag: "latest"
db:
nameOverride:
schema: MapproxyConfig
port: 80
targetPort: 8080
uwsgi:
Expand Down
Loading