From 55fb2566ffb35b7076d6153e7e2280c181caf01b Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Wed, 22 Nov 2023 11:33:21 +0100 Subject: [PATCH 1/2] use as much webapps shortcut as possible --- templates/analytics/analytics-deployment.yaml | 2 +- templates/analytics/analytics-svc.yaml | 3 +- templates/cas/cas-deployment.yaml | 2 +- templates/cas/cas-svc.yaml | 3 +- templates/console/console-deployment.yaml | 2 +- templates/console/console-svc.yaml | 3 +- .../datafeeder/datafeeder-deployment.yaml | 4 +-- templates/datafeeder/datafeeder-svc.yaml | 3 +- templates/datafeeder/import-deployment.yaml | 2 +- templates/datafeeder/import-svc.yaml | 3 +- .../extractorapp/extractorapp-deployment.yaml | 2 +- templates/extractorapp/extractorapp-svc.yaml | 3 +- templates/gateway/gateway-deployment.yaml | 2 +- templates/gateway/gateway-svc.yaml | 3 +- .../geonetwork/elasticsearch/es-data-pvc.yaml | 3 +- .../elasticsearch/es-deployment.yaml | 4 +-- .../geonetwork/elasticsearch/es-svc.yaml | 3 +- .../geonetwork/geonetwork-datadir-pvc.yaml | 3 +- .../geonetwork/geonetwork-deployment.yaml | 2 +- templates/geonetwork/geonetwork-svc.yaml | 3 +- .../housekeeping/clean-harvester-logs.yaml | 2 +- .../geonetwork/kibana/kibana-deployment.yaml | 5 +-- .../ogc-api-records-deployment.yaml | 4 +-- .../geoserver/geoserver-datadir-pvc.yaml | 3 +- templates/geoserver/geoserver-deployment.yaml | 2 +- .../geoserver/geoserver-geodata-pvc.yaml | 3 +- templates/geoserver/geoserver-svc.yaml | 3 +- templates/geoserver/geoserver-tiles-pvc.yaml | 3 +- templates/ldap/openldap-deployment.yaml | 2 +- templates/ldap/openldap-pvc.yaml | 3 +- templates/ldap/openldap-svc.yaml | 3 +- .../mapfishapp/mapfishapp-deployment.yaml | 2 +- templates/mapfishapp/mapfishapp-svc.yaml | 3 +- templates/mapstore/mapstore-deployment.yaml | 10 +++--- templates/mapstore/mapstore-pvc.yaml | 3 +- templates/mapstore/mapstore-svc.yaml | 3 +- .../security-proxy-deployment.yaml | 4 +-- .../security-proxy/security-proxy-svc.yaml | 3 +- templates/smtp-smarthost/smtp-deployment.yaml | 33 ++++++++++--------- templates/smtp-smarthost/smtp-svc.yaml | 3 +- 40 files changed, 88 insertions(+), 64 deletions(-) diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index b36d6eb..8d19b3f 100644 --- a/templates/analytics/analytics-deployment.yaml +++ b/templates/analytics/analytics-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.analytics.enabled -}} {{- $webapp := .Values.georchestra.webapps.analytics -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/analytics/analytics-svc.yaml b/templates/analytics/analytics-svc.yaml index 15011a5..6abc8ab 100644 --- a/templates/analytics/analytics-svc.yaml +++ b/templates/analytics/analytics-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.analytics.enabled -}} +{{- $webapp := .Values.georchestra.webapps.analytics -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/cas/cas-deployment.yaml b/templates/cas/cas-deployment.yaml index 4fa3d13..510c9c4 100644 --- a/templates/cas/cas-deployment.yaml +++ b/templates/cas/cas-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.cas.enabled -}} {{- $webapp := .Values.georchestra.webapps.cas -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/cas/cas-svc.yaml b/templates/cas/cas-svc.yaml index e209ef5..4cc9cc0 100644 --- a/templates/cas/cas-svc.yaml +++ b/templates/cas/cas-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.cas.enabled -}} +{{- $webapp := .Values.georchestra.webapps.cas -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index 7b37602..9314d77 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.console.enabled -}} {{- $webapp := .Values.georchestra.webapps.console -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/console/console-svc.yaml b/templates/console/console-svc.yaml index a557805..5637e97 100644 --- a/templates/console/console-svc.yaml +++ b/templates/console/console-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.console.enabled -}} +{{- $webapp := .Values.georchestra.webapps.console -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/datafeeder/datafeeder-deployment.yaml b/templates/datafeeder/datafeeder-deployment.yaml index 4a30abb..806e145 100644 --- a/templates/datafeeder/datafeeder-deployment.yaml +++ b/templates/datafeeder/datafeeder-deployment.yaml @@ -1,5 +1,5 @@ -{{- if and .Values.georchestra.webapps.datafeeder.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} {{- $webapp := .Values.georchestra.webapps.datafeeder -}} +{{- if and $webapp.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} {{- $database := .Values.database -}} {{- $database_secret_datafeeder_name := printf "%s-database-datafeeder-secret" (include "georchestra.fullname" .) -}} apiVersion: apps/v1 @@ -29,7 +29,7 @@ spec: {{- end }} initContainers: {{- include "georchestra.bootstrap_georchestra_datadir" . | nindent 6 }} - {{- if .Values.georchestra.webapps.datafeeder.envsubst.enabled }} + {{- if $webapp.envsubst.enabled }} - name: envsubst image: georchestra/k8s-initcontainer-envsubst volumeMounts: diff --git a/templates/datafeeder/datafeeder-svc.yaml b/templates/datafeeder/datafeeder-svc.yaml index f9fc2ae..0dad37e 100644 --- a/templates/datafeeder/datafeeder-svc.yaml +++ b/templates/datafeeder/datafeeder-svc.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.georchestra.webapps.datafeeder.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} +{{- $webapp := .Values.georchestra.webapps.datafeeder -}} +{{- if and $webapp.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/datafeeder/import-deployment.yaml b/templates/datafeeder/import-deployment.yaml index 1cbe499..1eeb7b2 100644 --- a/templates/datafeeder/import-deployment.yaml +++ b/templates/datafeeder/import-deployment.yaml @@ -1,5 +1,5 @@ -{{- if and .Values.georchestra.webapps.datafeeder.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} {{- $webapp := .Values.georchestra.webapps.datafeeder_frontend -}} +{{- if and .Values.georchestra.webapps.datafeeder.enabled $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/datafeeder/import-svc.yaml b/templates/datafeeder/import-svc.yaml index 31f9621..eb58f6a 100644 --- a/templates/datafeeder/import-svc.yaml +++ b/templates/datafeeder/import-svc.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.georchestra.webapps.datafeeder.enabled .Values.georchestra.webapps.datafeeder_frontend.enabled -}} +{{- $webapp := .Values.georchestra.webapps.datafeeder_frontend -}} +{{- if and .Values.georchestra.webapps.datafeeder.enabled $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/extractorapp/extractorapp-deployment.yaml b/templates/extractorapp/extractorapp-deployment.yaml index 433469b..49be033 100644 --- a/templates/extractorapp/extractorapp-deployment.yaml +++ b/templates/extractorapp/extractorapp-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.extractorapp.enabled -}} {{- $webapp := .Values.georchestra.webapps.extractorapp -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/extractorapp/extractorapp-svc.yaml b/templates/extractorapp/extractorapp-svc.yaml index a182717..d8a3fa5 100644 --- a/templates/extractorapp/extractorapp-svc.yaml +++ b/templates/extractorapp/extractorapp-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.extractorapp.enabled -}} +{{- $webapp := .Values.georchestra.webapps.extractorapp -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index d89cbad..2545516 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.gateway.enabled -}} {{- $webapp := .Values.georchestra.webapps.gateway -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/gateway/gateway-svc.yaml b/templates/gateway/gateway-svc.yaml index d6543a7..b707f6e 100644 --- a/templates/gateway/gateway-svc.yaml +++ b/templates/gateway/gateway-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.gateway.enabled -}} +{{- $webapp := .Values.georchestra.webapps.gateway -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/geonetwork/elasticsearch/es-data-pvc.yaml b/templates/geonetwork/elasticsearch/es-data-pvc.yaml index f90aaf2..59963d7 100644 --- a/templates/geonetwork/elasticsearch/es-data-pvc.yaml +++ b/templates/geonetwork/elasticsearch/es-data-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geonetwork.elasticsearch -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/geonetwork/elasticsearch/es-deployment.yaml b/templates/geonetwork/elasticsearch/es-deployment.yaml index 8d1f3e9..dc0f690 100644 --- a/templates/geonetwork/elasticsearch/es-deployment.yaml +++ b/templates/geonetwork/elasticsearch/es-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} {{- $webapp := .Values.georchestra.webapps.geonetwork.elasticsearch -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -38,7 +38,7 @@ spec: name: gn4-es-data containers: - name: elasticsearch - image: {{ .Values.georchestra.webapps.geonetwork.elasticsearch.image }} + image: {{ $webapp.image }} env: - name: ES_JAVA_OPTS value: -Dlog4j2.formatMsgNoLookups=true -Dlog4j2.disable.jmx=true diff --git a/templates/geonetwork/elasticsearch/es-svc.yaml b/templates/geonetwork/elasticsearch/es-svc.yaml index 9e23070..967bf7f 100644 --- a/templates/geonetwork/elasticsearch/es-svc.yaml +++ b/templates/geonetwork/elasticsearch/es-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geonetwork.elasticsearch -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/geonetwork/geonetwork-datadir-pvc.yaml b/templates/geonetwork/geonetwork-datadir-pvc.yaml index 1d13280..2970f6d 100644 --- a/templates/geonetwork/geonetwork-datadir-pvc.yaml +++ b/templates/geonetwork/geonetwork-datadir-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geonetwork -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/geonetwork/geonetwork-deployment.yaml b/templates/geonetwork/geonetwork-deployment.yaml index 8c5437f..3164024 100644 --- a/templates/geonetwork/geonetwork-deployment.yaml +++ b/templates/geonetwork/geonetwork-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} {{- $webapp := .Values.georchestra.webapps.geonetwork -}} +{{- if $webapp.enabled -}} {{- $database := .Values.database -}} apiVersion: apps/v1 kind: Deployment diff --git a/templates/geonetwork/geonetwork-svc.yaml b/templates/geonetwork/geonetwork-svc.yaml index 159777e..1130ab3 100644 --- a/templates/geonetwork/geonetwork-svc.yaml +++ b/templates/geonetwork/geonetwork-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geonetwork.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geonetwork -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/geonetwork/housekeeping/clean-harvester-logs.yaml b/templates/geonetwork/housekeeping/clean-harvester-logs.yaml index b03f281..669e386 100644 --- a/templates/geonetwork/housekeeping/clean-harvester-logs.yaml +++ b/templates/geonetwork/housekeeping/clean-harvester-logs.yaml @@ -1,5 +1,5 @@ -{{- if and .Values.georchestra.webapps.geonetwork.enabled .Values.georchestra.webapps.geonetwork.housekeeping.harvester_logs.enabled -}} {{- $webapp := .Values.georchestra.webapps.geonetwork -}} +{{- if and $webapp.enabled $webapp.housekeeping.harvester_logs.enabled -}} apiVersion: batch/v1 kind: CronJob metadata: diff --git a/templates/geonetwork/kibana/kibana-deployment.yaml b/templates/geonetwork/kibana/kibana-deployment.yaml index 5c9cf3e..0205628 100644 --- a/templates/geonetwork/kibana/kibana-deployment.yaml +++ b/templates/geonetwork/kibana/kibana-deployment.yaml @@ -1,3 +1,4 @@ +{{- $webapp := .Values.georchestra.webapps.geonetwork.kibana -}} {{- if .Values.georchestra.webapps.geonetwork.enabled -}} apiVersion: apps/v1 kind: Deployment @@ -7,7 +8,7 @@ metadata: {{- include "georchestra.labels" . | nindent 4 }} app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-gn4-kibana spec: - replicas: {{ .Values.georchestra.webapps.geonetwork.kibana.replicaCount }} + replicas: {{ $webapp.replicaCount }} selector: matchLabels: {{- include "georchestra.selectorLabels" . | nindent 6 }} @@ -26,7 +27,7 @@ spec: {{- end }} containers: - name: kibana - image: {{ .Values.georchestra.webapps.geonetwork.kibana.image }} + image: {{ $webapp.image }} env: - name: ELASTICSEARCH_HOSTS value: http://{{ include "georchestra.fullname" . }}-gn4-elasticsearch-svc:9200 diff --git a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml index a295b8a..ed10ada 100644 --- a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml +++ b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.georchestra.webapps.geonetwork.enabled .Values.georchestra.webapps.geonetwork.ogc_api_records.enabled -}} +{{- if and .Values.georchestra.webapps.geonetwork.enabled $webapp.enabled -}} {{- $webapp := .Values.georchestra.webapps.geonetwork.ogc_api_records -}} {{- $database := .Values.database -}} apiVersion: apps/v1 @@ -30,7 +30,7 @@ spec: fsGroup: 999 initContainers: {{- include "georchestra.bootstrap_georchestra_datadir" . | nindent 6 }} - {{- if .Values.georchestra.webapps.geonetwork.ogc_api_records.envsubst.enabled }} + {{- if $webapp.envsubst.enabled }} - name: envsubst image: georchestra/k8s-initcontainer-envsubst volumeMounts: diff --git a/templates/geoserver/geoserver-datadir-pvc.yaml b/templates/geoserver/geoserver-datadir-pvc.yaml index 5dbc84e..a7456f5 100644 --- a/templates/geoserver/geoserver-datadir-pvc.yaml +++ b/templates/geoserver/geoserver-datadir-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geoserver.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geoserver -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/geoserver/geoserver-deployment.yaml b/templates/geoserver/geoserver-deployment.yaml index 7f2267b..67594c0 100644 --- a/templates/geoserver/geoserver-deployment.yaml +++ b/templates/geoserver/geoserver-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.geoserver.enabled -}} {{- $webapp := .Values.georchestra.webapps.geoserver -}} +{{- if $webapp.enabled -}} {{- $database := .Values.database -}} {{- $database_secret_geodata_name := printf "%s-database-geodata-secret" (include "georchestra.fullname" .) -}} {{- $database_secret_datafeeder_name := printf "%s-database-datafeeder-secret" (include "georchestra.fullname" .) -}} diff --git a/templates/geoserver/geoserver-geodata-pvc.yaml b/templates/geoserver/geoserver-geodata-pvc.yaml index b309c6e..543b12b 100644 --- a/templates/geoserver/geoserver-geodata-pvc.yaml +++ b/templates/geoserver/geoserver-geodata-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geoserver.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geoserver -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/geoserver/geoserver-svc.yaml b/templates/geoserver/geoserver-svc.yaml index 0cb5477..0dae3b1 100644 --- a/templates/geoserver/geoserver-svc.yaml +++ b/templates/geoserver/geoserver-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.geoserver.enabled -}} +{{- $webapp := .Values.georchestra.webapps.geoserver -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/geoserver/geoserver-tiles-pvc.yaml b/templates/geoserver/geoserver-tiles-pvc.yaml index 82f35dc..2d615d8 100644 --- a/templates/geoserver/geoserver-tiles-pvc.yaml +++ b/templates/geoserver/geoserver-tiles-pvc.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.georchestra.webapps.geoserver.enabled .Values.georchestra.storage.geoserver_tiles -}} +{{- $webapp := .Values.georchestra.webapps.geoserver -}} +{{- if and $webapp.enabled .Values.georchestra.storage.geoserver_tiles -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/ldap/openldap-deployment.yaml b/templates/ldap/openldap-deployment.yaml index 9e8d8da..07fc00f 100644 --- a/templates/ldap/openldap-deployment.yaml +++ b/templates/ldap/openldap-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.openldap.enabled -}} {{- $webapp := .Values.georchestra.webapps.openldap -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/ldap/openldap-pvc.yaml b/templates/ldap/openldap-pvc.yaml index c7471dd..26c3223 100644 --- a/templates/ldap/openldap-pvc.yaml +++ b/templates/ldap/openldap-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.openldap.enabled -}} +{{- $webapp := .Values.georchestra.webapps.openldap -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/ldap/openldap-svc.yaml b/templates/ldap/openldap-svc.yaml index c7525e7..1bc8d46 100644 --- a/templates/ldap/openldap-svc.yaml +++ b/templates/ldap/openldap-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.openldap.enabled -}} +{{- $webapp := .Values.georchestra.webapps.openldap -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/mapfishapp/mapfishapp-deployment.yaml b/templates/mapfishapp/mapfishapp-deployment.yaml index 7fad2b3..bc63f28 100644 --- a/templates/mapfishapp/mapfishapp-deployment.yaml +++ b/templates/mapfishapp/mapfishapp-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.mapfishapp.enabled -}} {{- $webapp := .Values.georchestra.webapps.mapfishapp -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/mapfishapp/mapfishapp-svc.yaml b/templates/mapfishapp/mapfishapp-svc.yaml index c93d5cf..b64c9bb 100644 --- a/templates/mapfishapp/mapfishapp-svc.yaml +++ b/templates/mapfishapp/mapfishapp-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.mapfishapp.enabled -}} +{{- $webapp := .Values.georchestra.webapps.mapfishapp -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/mapstore/mapstore-deployment.yaml b/templates/mapstore/mapstore-deployment.yaml index 59f5ba5..13a8f2c 100644 --- a/templates/mapstore/mapstore-deployment.yaml +++ b/templates/mapstore/mapstore-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.mapstore.enabled -}} -{{- $webapp := .Values.georchestra.webapps.mapstore -}} +{{- if $webapp.mapstore.enabled -}} +{{- $webapp := $webapp.mapstore -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -33,13 +33,13 @@ spec: - name: georchestra-mapstore image: {{ $webapp.docker_image }} imagePullPolicy: Always - {{ if and .Values.georchestra.webapps.mapstore.command .Values.georchestra.webapps.mapstore.args -}} + {{ if and $webapp.mapstore.command $webapp.mapstore.args -}} command: - {{- range .Values.georchestra.webapps.mapstore.command }} + {{- range $webapp.mapstore.command }} - {{ . }} {{- end }} args: - {{- range .Values.georchestra.webapps.mapstore.args }} + {{- range $webapp.mapstore.args }} - {{ . }} {{- end }} {{- end }} diff --git a/templates/mapstore/mapstore-pvc.yaml b/templates/mapstore/mapstore-pvc.yaml index c43ac03..9045610 100644 --- a/templates/mapstore/mapstore-pvc.yaml +++ b/templates/mapstore/mapstore-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.mapstore.enabled -}} +{{- if $webapp.mapstore.enabled -}} +{{- $webapp := $webapp.mapstore -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/mapstore/mapstore-svc.yaml b/templates/mapstore/mapstore-svc.yaml index 6dfd815..2f348b4 100644 --- a/templates/mapstore/mapstore-svc.yaml +++ b/templates/mapstore/mapstore-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.mapstore.enabled -}} +{{- if $webapp.mapstore.enabled -}} +{{- $webapp := $webapp.mapstore -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/security-proxy/security-proxy-deployment.yaml b/templates/security-proxy/security-proxy-deployment.yaml index afe27a8..d3f5cd7 100644 --- a/templates/security-proxy/security-proxy-deployment.yaml +++ b/templates/security-proxy/security-proxy-deployment.yaml @@ -1,5 +1,5 @@ -{{- if .Values.georchestra.webapps.proxy.enabled -}} {{- $webapp := .Values.georchestra.webapps.proxy -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -34,7 +34,7 @@ spec: {{- end }} initContainers: {{ include "georchestra.bootstrap_georchestra_datadir" . | nindent 6 }} - {{- if .Values.georchestra.webapps.proxy.envsubst.enabled }} + {{- if $webapp.envsubst.enabled }} - name: envsubst image: georchestra/k8s-initcontainer-envsubst volumeMounts: diff --git a/templates/security-proxy/security-proxy-svc.yaml b/templates/security-proxy/security-proxy-svc.yaml index 63f4e38..29687ea 100644 --- a/templates/security-proxy/security-proxy-svc.yaml +++ b/templates/security-proxy/security-proxy-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.webapps.proxy.enabled -}} +{{- $webapp := .Values.georchestra.webapps.proxy -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: diff --git a/templates/smtp-smarthost/smtp-deployment.yaml b/templates/smtp-smarthost/smtp-deployment.yaml index 702f32b..ecc5939 100644 --- a/templates/smtp-smarthost/smtp-deployment.yaml +++ b/templates/smtp-smarthost/smtp-deployment.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.smtp_smarthost.enabled -}} +{{- $webapp := .Values.georchestra.smtp_smarthost -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -7,7 +8,7 @@ metadata: {{- include "georchestra.labels" . | nindent 4 }} app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-smtp spec: - replicas: {{ .Values.georchestra.smtp_smarthost.replicaCount }} + replicas: {{ $webapp.replicaCount }} selector: matchLabels: {{- include "georchestra.selectorLabels" . | nindent 6 }} @@ -28,32 +29,32 @@ spec: - name: georchestra-smtp image: camptocamp/exim:latest env: - {{- if .Values.georchestra.smtp_smarthost.relay_host }} + {{- if $webapp.relay_host }} - name: RELAY_HOST - value: {{ .Values.georchestra.smtp_smarthost.relay_host }} + value: {{ $webapp.relay_host }} {{- end -}} - {{- if .Values.georchestra.smtp_smarthost.relay_port }} + {{- if $webapp.relay_port }} - name: RELAY_PORT - value: {{ .Values.georchestra.smtp_smarthost.relay_port | quote }} + value: {{ $webapp.relay_port | quote }} {{- end -}} - {{- if .Values.georchestra.smtp_smarthost.mailname }} + {{- if $webapp.mailname }} - name: MAILNAME - value: {{ .Values.georchestra.smtp_smarthost.mailname }} + value: {{ $webapp.mailname }} {{- end -}} - {{- if .Values.georchestra.smtp_smarthost.postmaster }} + {{- if $webapp.postmaster }} - name: POSTMASTER - value: {{ .Values.georchestra.smtp_smarthost.postmaster }} + value: {{ $webapp.postmaster }} {{- end -}} - {{- if .Values.georchestra.smtp_smarthost.relay_username }} + {{- if $webapp.relay_username }} - name: RELAY_USERNAME - value: {{ .Values.georchestra.smtp_smarthost.relay_username }} + value: {{ $webapp.relay_username }} {{- end -}} - {{- if .Values.georchestra.smtp_smarthost.relay_password }} + {{- if $webapp.relay_password }} - name: RELAY_PASSWORD - value: {{ .Values.georchestra.smtp_smarthost.relay_password }} + value: {{ $webapp.relay_password }} {{ end -}} - {{- if .Values.georchestra.smtp_smarthost.extra_environment }} - {{- .Values.georchestra.smtp_smarthost.extra_environment | toYaml | nindent 10 }} + {{- if $webapp.extra_environment }} + {{- $webapp.extra_environment | toYaml | nindent 10 }} {{- end }} imagePullPolicy: Always ports: diff --git a/templates/smtp-smarthost/smtp-svc.yaml b/templates/smtp-smarthost/smtp-svc.yaml index ab29409..50fb69d 100644 --- a/templates/smtp-smarthost/smtp-svc.yaml +++ b/templates/smtp-smarthost/smtp-svc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.georchestra.smtp_smarthost.enabled -}} +{{- $webapp := .Values.georchestra.smtp_smarthost -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: From 0ace80ad8e32a300aba7cfe8d1e37231d0969714 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Wed, 22 Nov 2023 14:02:50 +0100 Subject: [PATCH 2/2] fix wrong refactor for some webapps shortcut --- .../ogc-api-records/ogc-api-records-deployment.yaml | 2 +- templates/mapstore/mapstore-deployment.yaml | 10 +++++----- templates/mapstore/mapstore-pvc.yaml | 4 ++-- templates/mapstore/mapstore-svc.yaml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml index ed10ada..4ab4694 100644 --- a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml +++ b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml @@ -1,5 +1,5 @@ -{{- if and .Values.georchestra.webapps.geonetwork.enabled $webapp.enabled -}} {{- $webapp := .Values.georchestra.webapps.geonetwork.ogc_api_records -}} +{{- if and .Values.georchestra.webapps.geonetwork.enabled $webapp.enabled -}} {{- $database := .Values.database -}} apiVersion: apps/v1 kind: Deployment diff --git a/templates/mapstore/mapstore-deployment.yaml b/templates/mapstore/mapstore-deployment.yaml index 13a8f2c..153db29 100644 --- a/templates/mapstore/mapstore-deployment.yaml +++ b/templates/mapstore/mapstore-deployment.yaml @@ -1,5 +1,5 @@ -{{- if $webapp.mapstore.enabled -}} -{{- $webapp := $webapp.mapstore -}} +{{- $webapp := .Values.georchestra.webapps.mapstore -}} +{{- if $webapp.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -33,13 +33,13 @@ spec: - name: georchestra-mapstore image: {{ $webapp.docker_image }} imagePullPolicy: Always - {{ if and $webapp.mapstore.command $webapp.mapstore.args -}} + {{ if and $webapp.command $webapp.args -}} command: - {{- range $webapp.mapstore.command }} + {{- range $webapp.command }} - {{ . }} {{- end }} args: - {{- range $webapp.mapstore.args }} + {{- range $webapp.args }} - {{ . }} {{- end }} {{- end }} diff --git a/templates/mapstore/mapstore-pvc.yaml b/templates/mapstore/mapstore-pvc.yaml index 9045610..901f833 100644 --- a/templates/mapstore/mapstore-pvc.yaml +++ b/templates/mapstore/mapstore-pvc.yaml @@ -1,5 +1,5 @@ -{{- if $webapp.mapstore.enabled -}} -{{- $webapp := $webapp.mapstore -}} +{{- $webapp := .Values.georchestra.webapps.mapstore -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/mapstore/mapstore-svc.yaml b/templates/mapstore/mapstore-svc.yaml index 2f348b4..4b0cd9c 100644 --- a/templates/mapstore/mapstore-svc.yaml +++ b/templates/mapstore/mapstore-svc.yaml @@ -1,5 +1,5 @@ -{{- if $webapp.mapstore.enabled -}} -{{- $webapp := $webapp.mapstore -}} +{{- $webapp := .Values.georchestra.webapps.mapstore -}} +{{- if $webapp.enabled -}} apiVersion: v1 kind: Service metadata: