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
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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<tim@kartoza.com>

#-------------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
Expand Down Expand Up @@ -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 && \
Expand All @@ -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"]
8 changes: 6 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 13 additions & 1 deletion helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

{{/*
Expand Down Expand Up @@ -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 -}}
4 changes: 0 additions & 4 deletions helm/templates/mapproxinator/mapproxinator-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 3 additions & 8 deletions helm/templates/mapproxy-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/mapproxy/mapproxy-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 0 additions & 4 deletions helm/templates/mapproxy/mapproxy-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/mapproxy/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

13 changes: 12 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down