diff --git a/Dockerfile b/Dockerfile index cadbdca..f381f8d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,22 @@ # syntax=docker/dockerfile:1 #--------- Generic stuff all our Dockerfiles should start with so we get caching ------------ -FROM python:3.7.10 +FROM python:3.9-slim-bullseye MAINTAINER Tim Sutton #-------------Application Specific Stuff ---------------------------------------------------- RUN apt-get -y update && \ apt-get install -y \ gettext \ - python-yaml \ + python3-yaml \ libgeos-dev \ - python-lxml \ + python3-lxml \ libgdal-dev \ build-essential \ - python-dev \ + python3-dev \ libjpeg-dev \ zlib1g-dev \ libfreetype6-dev \ - python-virtualenv + python3-virtualenv COPY requirements.txt /requirements.txt RUN pip install -r requirements.txt @@ -48,9 +48,9 @@ RUN --mount=type=bind,source=config/patch/redis.py,target=redis.py \ --mount=type=bind,source=config/patch/loader.py,target=loader.py \ --mount=type=bind,source=config/patch/spec.py,target=spec.py \ if [ "${PATCH_FILES}" = true ]; then \ - cp redis.py /usr/local/lib/python3.7/site-packages/mapproxy/cache/redis.py; \ - cp loader.py /usr/local/lib/python3.7/site-packages/mapproxy/config/loader.py; \ - cp spec.py /usr/local/lib/python3.7/site-packages/mapproxy/config/spec.py; \ + cp redis.py /usr/local/lib/python3.9/site-packages/mapproxy/cache/redis.py; \ + cp loader.py /usr/local/lib/python3.9/site-packages/mapproxy/config/loader.py; \ + cp spec.py /usr/local/lib/python3.9/site-packages/mapproxy/config/spec.py; \ fi RUN chgrp -R 0 /mapproxy /settings /start.sh && \ @@ -60,4 +60,4 @@ USER user VOLUME [ "/mapproxy"] # USER mapproxy ENTRYPOINT [ "/start.sh" ] -CMD ["mapproxy-util", "serve-develop", "-b", "0.0.0.0:8080", "mapproxy.yaml"] +CMD ["mapproxy-util", "serve-develop", "-b", "0.0.0.0:8080", "mapproxy.yaml"] \ No newline at end of file diff --git a/helm/Chart.yaml b/helm/Chart.yaml index d6f4edd..5bb7591 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,9 +2,13 @@ apiVersion: v2 name: mapproxy description: A Helm chart for mapproxy service type: application -version: 1.8.6 -appVersion: 1.8.6 +version: 1.8.6-test-1 +appVersion: 1.8.6-test-1 dependencies: - name: nginx version: 1.3.0 repository: oci://acrarolibotnonprod.azurecr.io/helm + + - name: mclabels + version: 1.0.1 + repository: oci://acrarolibotnonprod.azurecr.io/helm/infra diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index d7b9726..661c57f 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -32,11 +32,23 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "mapproxy.labels" -}} +app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} +app.kubernetes.io/instance: {{ .Release.Name }}-{{ .type }} helm.sh/chart: {{ include "mapproxy.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{ include "mclabels.labels" . }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mapproxy.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} +app.kubernetes.io/instance: {{ .Release.Name }}-{{ .type }} +{{ include "mclabels.selectorLabels" . }} {{- end }} {{/* @@ -102,4 +114,4 @@ Returns the cloud provider image pull secret name from global if exists or from {{- $headerList = uniq $headerList -}} {{- quote (join "," $headerList) -}} {{- end -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/helm/templates/mapproxinator/mapproxinator-container.yaml b/helm/templates/mapproxinator/mapproxinator-container.yaml index f9ddf1a..808659f 100644 --- a/helm/templates/mapproxinator/mapproxinator-container.yaml +++ b/helm/templates/mapproxinator/mapproxinator-container.yaml @@ -48,10 +48,6 @@ name: {{ .postgresSecretName }} key: password {{- end }} - {{- if .Values.global.ca.secretName }} - - name: REQUESTS_CA_BUNDLE - value: {{ printf "%s/%s" .Values.global.ca.path .Values.global.ca.key | quote }} - {{- end }} envFrom: - configMapRef: name: {{ $mapproxinatorConfigmapName }} diff --git a/helm/templates/mapproxy-bundle.yaml b/helm/templates/mapproxy-bundle.yaml index 0ed8e79..edb3fb5 100644 --- a/helm/templates/mapproxy-bundle.yaml +++ b/helm/templates/mapproxy-bundle.yaml @@ -15,28 +15,23 @@ app: {{ .chartName }}-{{ .type }} release: {{ .releaseName }}-{{ .type }} run: {{ .releaseName }}-{{ .chartName }}-{{ .type }} - app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} - app.kubernetes.io/instance: {{ .releaseName }}-{{ .type }} + {{ include "mapproxy.selectorLabels" . | nindent 6 }} template: metadata: labels: app: {{ .chartName }}-{{ .type }} release: {{ .releaseName }}-{{ .type }} run: {{ .releaseName }}-{{ .chartName }}-{{ .type }} - app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} - app.kubernetes.io/instance: {{ .releaseName }}-{{ .type }} + {{ include "mapproxy.labels" . | nindent 8 }} annotations: {{- if .Values.resetOnConfigChange }} checksum/configmap: {{ include (print $.Template.BasePath "/mapproxy/mapproxy-configmap.yaml") . | sha256sum }} {{- end }} - {{- if $metrics.enabled }} - prometheus.io/port: {{ $metrics.prometheus.port | quote }} - prometheus.io/scrape: {{ $metrics.prometheus.scrape | quote }} - {{- end }} {{- if .Values.podAnnotations }} {{- toYaml .Values.podAnnotations | nindent 8 }} {{- end }} + {{ include "mclabels.annotations" . | nindent 8 }} spec: {{- if $cloudProviderImagePullSecretName }} imagePullSecrets: diff --git a/helm/templates/mapproxy/mapproxy-configmap.yaml b/helm/templates/mapproxy/mapproxy-configmap.yaml index 85bcf49..4c86eaa 100644 --- a/helm/templates/mapproxy/mapproxy-configmap.yaml +++ b/helm/templates/mapproxy/mapproxy-configmap.yaml @@ -24,9 +24,9 @@ data: CORS_ALLOWED_HEADERS: {{ template "map-proxy.cors.allowedHeaders" . }} CORS_ALLOWED_ORIGIN: {{ .Values.mapproxy.env.cors.allowedOrigin | quote }} AUTH_ENABLED: {{ .Values.nginx.authorization.enabled | quote }} - {{ if (and (.Values.global.opalaEnabled) (.Values.nginx.authorization.enabled) }} + {{ if (and (.Values.global.opalaEnabled) (.Values.nginx.authorization.enabled))}} AUTH_VALID_DOMAIN: {{ .Values.nginx.authorization.wms.domain | quote }} AUTH_HEADER_NAME: {{ .Values.mapproxy.env.cors.allowedHeaders | quote }} AUTH_QUERY_NAME: {{ .Values.nginx.authorization.token.queryName | quote }} - {{- end}} + {{- end }} {{- end }} diff --git a/helm/templates/mapproxy/mapproxy-container.yaml b/helm/templates/mapproxy/mapproxy-container.yaml index 72615ac..7283a0d 100644 --- a/helm/templates/mapproxy/mapproxy-container.yaml +++ b/helm/templates/mapproxy/mapproxy-container.yaml @@ -30,10 +30,6 @@ name: {{ .s3SecretName }} key: secretAccessKey {{- end }} - {{- if .Values.global.ca.enabled }} - - name: REQUESTS_CA_BUNDLE - value: '/usr/local/share/ca-certificates/ca.crt' - {{- end }} envFrom: - configMapRef: name: {{ $configmapName }} diff --git a/helm/templates/mapproxy/service.yaml b/helm/templates/mapproxy/service.yaml index 6dcdd78..dfd8340 100644 --- a/helm/templates/mapproxy/service.yaml +++ b/helm/templates/mapproxy/service.yaml @@ -29,6 +29,6 @@ spec: app: {{ $chartName }}-{{ .type }} release: {{ $releaseName }}-{{ .type }} run: {{ $releaseName }}-{{ $chartName }}-{{ .type }} - app.kubernetes.io/name: {{ include "mapproxy.name" . }}-{{ .type }} - app.kubernetes.io/instance: {{ $releaseName }}-{{ .type }} + {{- include "mapproxy.selectorLabels" . | nindent 4 }} {{- end }} + diff --git a/helm/values.yaml b/helm/values.yaml index a11523c..19b0f9e 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -106,6 +106,17 @@ cloudProvider: imagePullSecretName: "my-registry-secret" flavor: openshift +mclabels: + #environment: development + component: backend + partOf: serving + owner: raster + gisDomain: raster + prometheus: + enabled: true + port: 9117 + logScraping: true + mapproxy: enabled: true socket: @@ -228,7 +239,7 @@ nginx: nodePort: 30003 authorization: - enabled: true + enabled: false url: http://opa-int-opa-service.infra-services/v1/data/http/authz/decision token: queryName: token