diff --git a/helm/Chart.yaml b/helm/Chart.yaml index d6f4edd..8a2799f 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -8,3 +8,7 @@ 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/mapproxy-wms-deployment.yaml b/helm/templates/mapproxy/mapproxy-wms-deployment.yaml index 7810016..e1c368d 100644 --- a/helm/templates/mapproxy/mapproxy-wms-deployment.yaml +++ b/helm/templates/mapproxy/mapproxy-wms-deployment.yaml @@ -25,7 +25,7 @@ metadata: component: {{ $chartName }} environment: {{ include "mapproxy.environment" . }} release: {{ $releaseName }} - {{- include "mapproxy.labels" . | nindent 4 }} + {{- include "mapproxy.labels" (dict "type" $type | merge .) | nindent 4 }} spec: {{- template "mapproxy-chart.mapproxy-bundle" (merge (dict "releaseName" $releaseName "chartName" $chartName "type" $type "replicaCount" $replicaCount "resources" .Values.mapproxy.wms.resources) .)}} {{- end -}} diff --git a/helm/templates/mapproxy/mapproxy-wmts-deployment.yaml b/helm/templates/mapproxy/mapproxy-wmts-deployment.yaml index b3a150c..c4fc8a0 100644 --- a/helm/templates/mapproxy/mapproxy-wmts-deployment.yaml +++ b/helm/templates/mapproxy/mapproxy-wmts-deployment.yaml @@ -30,7 +30,7 @@ metadata: component: {{ $chartName }} environment: {{ include "mapproxy.environment" . }} release: {{ $releaseName }} - {{- include "mapproxy.labels" . | nindent 4 }} + {{- include "mapproxy.labels" (dict "type" $type | merge .) | nindent 4 }} spec: {{- template "mapproxy-chart.mapproxy-bundle" (merge (dict "releaseName" $releaseName "chartName" $chartName "type" $type "replicaCount" $replicaCount "resources" .Values.mapproxy.wmts.resources) .)}} {{- end -}} diff --git a/helm/templates/mapproxy/service.yaml b/helm/templates/mapproxy/service.yaml index 6dcdd78..10160ac 100644 --- a/helm/templates/mapproxy/service.yaml +++ b/helm/templates/mapproxy/service.yaml @@ -29,6 +29,5 @@ 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