From a7b4e47855afc707582c250fe651933500334d68 Mon Sep 17 00:00:00 2001 From: Jean-Michel Crepel Date: Wed, 4 Sep 2024 09:53:33 +0200 Subject: [PATCH] add a way to configure tolerations for multinode support --- Chart.yaml | 2 +- templates/analytics/analytics-deployment.yaml | 4 ++++ templates/cas/cas-deployment.yaml | 4 ++++ templates/console/console-deployment.yaml | 4 ++++ templates/datafeeder/datafeeder-deployment.yaml | 4 ++++ templates/datafeeder/import-deployment.yaml | 4 ++++ templates/gateway/gateway-deployment.yaml | 4 ++++ .../geonetwork/elasticsearch/es-deployment.yaml | 4 ++++ templates/geonetwork/geonetwork-deployment.yaml | 4 ++++ .../geonetwork/kibana/kibana-deployment.yaml | 4 ++++ .../ogc-api-records-deployment.yaml | 4 ++++ templates/geoserver/geoserver-deployment.yaml | 4 ++++ .../geowebcache/geowebcache-deployment.yaml | 4 ++++ templates/header/header-deployment.yaml | 4 ++++ templates/ldap/openldap-deployment.yaml | 5 ++++- templates/mapstore/mapstore-deployment.yaml | 4 ++++ .../security-proxy-deployment.yaml | 4 ++++ templates/smtp-smarthost/smtp-deployment.yaml | 4 ++++ values.yaml | 16 ++++++++++++++++ 19 files changed, 85 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 34b5bbc..56642bb 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.2.0 +version: 1.2.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index 8d19b3f..031b947 100644 --- a/templates/analytics/analytics-deployment.yaml +++ b/templates/analytics/analytics-deployment.yaml @@ -65,4 +65,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/cas/cas-deployment.yaml b/templates/cas/cas-deployment.yaml index 849310e..b033de8 100644 --- a/templates/cas/cas-deployment.yaml +++ b/templates/cas/cas-deployment.yaml @@ -67,4 +67,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index 9314d77..90bc860 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -74,4 +74,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/datafeeder/datafeeder-deployment.yaml b/templates/datafeeder/datafeeder-deployment.yaml index 69f6a23..738ab10 100644 --- a/templates/datafeeder/datafeeder-deployment.yaml +++ b/templates/datafeeder/datafeeder-deployment.yaml @@ -124,4 +124,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/datafeeder/import-deployment.yaml b/templates/datafeeder/import-deployment.yaml index b4f679e..4791da1 100644 --- a/templates/datafeeder/import-deployment.yaml +++ b/templates/datafeeder/import-deployment.yaml @@ -69,4 +69,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index 2545516..731b45d 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -74,4 +74,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/elasticsearch/es-deployment.yaml b/templates/geonetwork/elasticsearch/es-deployment.yaml index 967827a..40728bd 100644 --- a/templates/geonetwork/elasticsearch/es-deployment.yaml +++ b/templates/geonetwork/elasticsearch/es-deployment.yaml @@ -56,5 +56,9 @@ spec: - name: gn4-es-data persistentVolumeClaim: claimName: {{ include "georchestra.fullname" . }}-gn4-es-data + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/geonetwork-deployment.yaml b/templates/geonetwork/geonetwork-deployment.yaml index fc2a0fc..09f96d0 100644 --- a/templates/geonetwork/geonetwork-deployment.yaml +++ b/templates/geonetwork/geonetwork-deployment.yaml @@ -116,4 +116,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/kibana/kibana-deployment.yaml b/templates/geonetwork/kibana/kibana-deployment.yaml index 0205628..e69abb0 100644 --- a/templates/geonetwork/kibana/kibana-deployment.yaml +++ b/templates/geonetwork/kibana/kibana-deployment.yaml @@ -41,4 +41,8 @@ spec: - name: gn4-kibana-config configMap: name: {{ include "georchestra.fullname" . }}-gn4-kibana-config + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} 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 044272c..c8acb1d 100644 --- a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml +++ b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml @@ -86,4 +86,8 @@ spec: secretName: {{ .Values.georchestra.datadir.git.ssh_secret }} defaultMode: 0400 {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end -}} diff --git a/templates/geoserver/geoserver-deployment.yaml b/templates/geoserver/geoserver-deployment.yaml index 06a5a05..a7fee92 100644 --- a/templates/geoserver/geoserver-deployment.yaml +++ b/templates/geoserver/geoserver-deployment.yaml @@ -256,4 +256,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geowebcache/geowebcache-deployment.yaml b/templates/geowebcache/geowebcache-deployment.yaml index f5d41a2..63a37d3 100644 --- a/templates/geowebcache/geowebcache-deployment.yaml +++ b/templates/geowebcache/geowebcache-deployment.yaml @@ -106,4 +106,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/header/header-deployment.yaml b/templates/header/header-deployment.yaml index 0b37251..83c5714 100644 --- a/templates/header/header-deployment.yaml +++ b/templates/header/header-deployment.yaml @@ -77,5 +77,9 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/ldap/openldap-deployment.yaml b/templates/ldap/openldap-deployment.yaml index c0946b9..9174f58 100644 --- a/templates/ldap/openldap-deployment.yaml +++ b/templates/ldap/openldap-deployment.yaml @@ -84,5 +84,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} - + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/mapstore/mapstore-deployment.yaml b/templates/mapstore/mapstore-deployment.yaml index 153db29..f3e2042 100644 --- a/templates/mapstore/mapstore-deployment.yaml +++ b/templates/mapstore/mapstore-deployment.yaml @@ -90,5 +90,9 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/security-proxy/security-proxy-deployment.yaml b/templates/security-proxy/security-proxy-deployment.yaml index d19f271..73afadb 100644 --- a/templates/security-proxy/security-proxy-deployment.yaml +++ b/templates/security-proxy/security-proxy-deployment.yaml @@ -114,4 +114,8 @@ spec: imagePullSecrets: - name: {{ $webapp.registry_secret }} {{- end }} + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/smtp-smarthost/smtp-deployment.yaml b/templates/smtp-smarthost/smtp-deployment.yaml index ecc5939..f8f8856 100644 --- a/templates/smtp-smarthost/smtp-deployment.yaml +++ b/templates/smtp-smarthost/smtp-deployment.yaml @@ -64,4 +64,8 @@ spec: tcpSocket: port: smtp initialDelaySeconds: 30 + {{- if $webapp.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end -}} diff --git a/values.yaml b/values.yaml index cfb66fe..83c0803 100644 --- a/values.yaml +++ b/values.yaml @@ -21,6 +21,7 @@ georchestra: # registry_secret: default service: annotations: {} + tolerations: [] cas: enabled: true replicaCount: "1" @@ -29,6 +30,7 @@ georchestra: # registry_secret: default service: annotations: {} + tolerations: [] console: enabled: true replicaCount: "1" @@ -38,6 +40,7 @@ georchestra: # registry_secret: default service: annotations: {} + tolerations: [] datafeeder: enabled: true # won't deploy if datafeeder_frontend is not enable replicaCount: "1" @@ -52,6 +55,7 @@ georchestra: enabled: true service: annotations: {} + tolerations: [] datafeeder_frontend: # Matches datafeeder/import-xxx.yaml templates in the helm chart enabled: true # won't deploy if datafeeder is not enable @@ -62,6 +66,7 @@ georchestra: # registry_secret: default service: annotations: {} + tolerations: [] geonetwork: enabled: true replicaCount: "1" @@ -77,6 +82,7 @@ georchestra: # container extra volume. It should match an item from the extra_volumes.name # variable above. extra_volumeMounts: [] + tolerations: [] ogc_api_records: enabled: true replicaCount: "1" @@ -86,6 +92,7 @@ georchestra: enabled: true service: annotations: {} + tolerations: [] elasticsearch: replicaCount: "1" resources: @@ -96,11 +103,13 @@ georchestra: image: docker.elastic.co/elasticsearch/elasticsearch:7.17.21 service: annotations: {} + tolerations: [] kibana: replicaCount: "1" image: docker.elastic.co/kibana/kibana:7.15.1 service: annotations: {} + tolerations: [] # automatically clean some logs of geonetwork housekeeping: harvester_logs: @@ -121,6 +130,7 @@ georchestra: # container extra volume. It should match an item from the extra_volumes.name # variable above. extra_volumeMounts: [] + tolerations: [] # registry_secret: default service: annotations: {} @@ -131,6 +141,7 @@ georchestra: enabled: true docker_image: georchestra/geowebcache:latest extra_environment: [] + tolerations: [] service: annotations: {} header: @@ -138,6 +149,7 @@ georchestra: replicaCount: "1" docker_image: georchestra/header:latest extra_environment: [] + tolerations: [] # registry_secret: default service: annotations: {} @@ -148,6 +160,7 @@ georchestra: # registry_secret: default # no need to put the original command already managed extra_environment: [] + tolerations: [] command: [] args: [] lifecycle: {} @@ -169,6 +182,7 @@ georchestra: # registry_secret: default service: annotations: {} + tolerations: [] proxy: enabled: false replicaCount: "1" @@ -180,6 +194,7 @@ georchestra: enabled: true service: annotations: {} + tolerations: [] gateway: enabled: true replicaCount: "1" @@ -189,6 +204,7 @@ georchestra: extra_environment: [] service: annotations: {} + tolerations: [] datadir: volume: - name: georchestra-datadir