From 509ff70d679c95859c99c09b5a89bfd907c3369d Mon Sep 17 00:00:00 2001 From: Julien Sabatier Date: Tue, 17 Sep 2024 16:50:25 +0200 Subject: [PATCH] Allow hostAliases definition (#109) * Add common.tplvalues helpers * Add ability to define hostAliases * Update version in Chart.yaml * correct syntaxe with simpler way * update with review * change version of the chart * Revert "change version of the chart" This reverts commit a1ad137d07e79fde676e644007353138540f49d0. * remove bump version + add more comments about hostAliases * fix lint empty-lines * fix ci trailing-spaces from commit 29d2466cfe79093de7266cfaee4fdbcefa4db560 --------- Co-authored-by: Jean-Michel Crepel Co-authored-by: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> --- 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 ++++ templates/geonetwork/elasticsearch/es-deployment.yaml | 4 ++++ templates/geonetwork/geonetwork-deployment.yaml | 4 ++++ templates/geonetwork/kibana/kibana-deployment.yaml | 4 ++++ .../ogc-api-records/ogc-api-records-deployment.yaml | 4 ++++ templates/geoserver/geoserver-deployment.yaml | 4 ++++ templates/geowebcache/geowebcache-deployment.yaml | 4 ++++ templates/header/header-deployment.yaml | 4 ++++ templates/ldap/openldap-deployment.yaml | 4 ++++ templates/mapstore/mapstore-deployment.yaml | 4 ++++ templates/security-proxy/security-proxy-deployment.yaml | 4 ++++ templates/smtp-smarthost/smtp-deployment.yaml | 4 ++++ values.yaml | 9 ++++++++- 18 files changed, 76 insertions(+), 1 deletion(-) diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index 9613c2e..ef3c73c 100644 --- a/templates/analytics/analytics-deployment.yaml +++ b/templates/analytics/analytics-deployment.yaml @@ -69,4 +69,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/cas/cas-deployment.yaml b/templates/cas/cas-deployment.yaml index 83db0b6..3bd4f99 100644 --- a/templates/cas/cas-deployment.yaml +++ b/templates/cas/cas-deployment.yaml @@ -71,4 +71,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index cbdbfc3..915838e 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -78,4 +78,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/datafeeder/datafeeder-deployment.yaml b/templates/datafeeder/datafeeder-deployment.yaml index 1ab8727..83a709e 100644 --- a/templates/datafeeder/datafeeder-deployment.yaml +++ b/templates/datafeeder/datafeeder-deployment.yaml @@ -128,4 +128,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/datafeeder/import-deployment.yaml b/templates/datafeeder/import-deployment.yaml index b4a09f5..c989ee8 100644 --- a/templates/datafeeder/import-deployment.yaml +++ b/templates/datafeeder/import-deployment.yaml @@ -73,4 +73,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index 8be8eda..013db63 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -78,4 +78,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/elasticsearch/es-deployment.yaml b/templates/geonetwork/elasticsearch/es-deployment.yaml index 532b354..6cf0c03 100644 --- a/templates/geonetwork/elasticsearch/es-deployment.yaml +++ b/templates/geonetwork/elasticsearch/es-deployment.yaml @@ -60,5 +60,9 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/geonetwork-deployment.yaml b/templates/geonetwork/geonetwork-deployment.yaml index 18c3f1f..590dedc 100644 --- a/templates/geonetwork/geonetwork-deployment.yaml +++ b/templates/geonetwork/geonetwork-deployment.yaml @@ -120,4 +120,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geonetwork/kibana/kibana-deployment.yaml b/templates/geonetwork/kibana/kibana-deployment.yaml index 736adbc..25b2748 100644 --- a/templates/geonetwork/kibana/kibana-deployment.yaml +++ b/templates/geonetwork/kibana/kibana-deployment.yaml @@ -45,4 +45,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | 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 a4dbc3c..bedd1ab 100644 --- a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml +++ b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml @@ -90,4 +90,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end -}} diff --git a/templates/geoserver/geoserver-deployment.yaml b/templates/geoserver/geoserver-deployment.yaml index 04341e0..04f3614 100644 --- a/templates/geoserver/geoserver-deployment.yaml +++ b/templates/geoserver/geoserver-deployment.yaml @@ -260,4 +260,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/geowebcache/geowebcache-deployment.yaml b/templates/geowebcache/geowebcache-deployment.yaml index b20858b..61df4eb 100644 --- a/templates/geowebcache/geowebcache-deployment.yaml +++ b/templates/geowebcache/geowebcache-deployment.yaml @@ -110,4 +110,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/header/header-deployment.yaml b/templates/header/header-deployment.yaml index 07d8a2e..c0cd860 100644 --- a/templates/header/header-deployment.yaml +++ b/templates/header/header-deployment.yaml @@ -81,5 +81,9 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/ldap/openldap-deployment.yaml b/templates/ldap/openldap-deployment.yaml index a9c476f..bff6b37 100644 --- a/templates/ldap/openldap-deployment.yaml +++ b/templates/ldap/openldap-deployment.yaml @@ -88,4 +88,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/mapstore/mapstore-deployment.yaml b/templates/mapstore/mapstore-deployment.yaml index a2b95cf..7684847 100644 --- a/templates/mapstore/mapstore-deployment.yaml +++ b/templates/mapstore/mapstore-deployment.yaml @@ -94,5 +94,9 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/security-proxy/security-proxy-deployment.yaml b/templates/security-proxy/security-proxy-deployment.yaml index 2e04893..86b926f 100644 --- a/templates/security-proxy/security-proxy-deployment.yaml +++ b/templates/security-proxy/security-proxy-deployment.yaml @@ -118,4 +118,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end }} diff --git a/templates/smtp-smarthost/smtp-deployment.yaml b/templates/smtp-smarthost/smtp-deployment.yaml index 3d57695..7c0886c 100644 --- a/templates/smtp-smarthost/smtp-deployment.yaml +++ b/templates/smtp-smarthost/smtp-deployment.yaml @@ -68,4 +68,8 @@ spec: tolerations: {{- $webapp.tolerations | toYaml | nindent 8 }} {{- end }} + {{- if .Values.hostAliases }} + hostAliases: + {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- end }} {{- end -}} diff --git a/values.yaml b/values.yaml index 09345f2..6e748a5 100644 --- a/values.yaml +++ b/values.yaml @@ -115,7 +115,7 @@ georchestra: harvester_logs: enabled: false schedule: "0 1 * * *" - tolerations: [] + tolerations: [] service: annotations: {} geoserver: @@ -392,3 +392,10 @@ rabbitmq: # pv_name: rabbitmq-data # storage_class_name: default # size: 1Gi + +# Allow to override /etc/hosts for ALL apps +# https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "host.alias.com"