From 10018df907f7ef001b86f39a104728b50c2f7505 Mon Sep 17 00:00:00 2001 From: jusabatier Date: Thu, 22 Aug 2024 11:28:30 +0200 Subject: [PATCH 01/10] Add common.tplvalues helpers --- templates/_tplvalues.tpl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 templates/_tplvalues.tpl diff --git a/templates/_tplvalues.tpl b/templates/_tplvalues.tpl new file mode 100644 index 0000000..67452b6 --- /dev/null +++ b/templates/_tplvalues.tpl @@ -0,0 +1,38 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* vim: set filetype=mustache: */}} +{{/* +Renders a value that contains template perhaps with scope if the scope is present. +Usage: +{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }} +{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }} +*/}} +{{- define "common.tplvalues.render" -}} +{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} +{{- if contains "{{" (toJson .value) }} + {{- if .scope }} + {{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }} + {{- else }} + {{- tpl $value .context }} + {{- end }} +{{- else }} + {{- $value }} +{{- end }} +{{- end -}} + +{{/* +Merge a list of values that contains template after rendering them. +Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge +Usage: +{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }} +*/}} +{{- define "common.tplvalues.merge" -}} +{{- $dst := dict -}} +{{- range .values -}} +{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}} +{{- end -}} +{{ $dst | toYaml }} +{{- end -}} \ No newline at end of file From 8aae977039e4d3465b00363fc9956bcb2395eea9 Mon Sep 17 00:00:00 2001 From: jusabatier Date: Thu, 22 Aug 2024 11:36:10 +0200 Subject: [PATCH 02/10] Add ability to define hostAliases --- Chart.yaml | 2 +- templates/_tplvalues.tpl | 38 ------------------- templates/analytics/analytics-deployment.yaml | 4 ++ templates/cas/cas-deployment.yaml | 4 ++ templates/console/console-deployment.yaml | 4 ++ .../datafeeder/datafeeder-deployment.yaml | 4 ++ templates/datafeeder/import-deployment.yaml | 4 ++ templates/gateway/gateway-deployment.yaml | 4 ++ .../elasticsearch/es-deployment.yaml | 4 ++ .../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 | 4 ++ templates/mapstore/mapstore-deployment.yaml | 4 ++ .../security-proxy-deployment.yaml | 4 ++ templates/smtp-smarthost/smtp-deployment.yaml | 4 ++ values.yaml | 5 +++ 20 files changed, 74 insertions(+), 39 deletions(-) delete mode 100644 templates/_tplvalues.tpl diff --git a/Chart.yaml b/Chart.yaml index e0ede96..34b5bbc 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.5 +version: 1.2.0 # 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/_tplvalues.tpl b/templates/_tplvalues.tpl deleted file mode 100644 index 67452b6..0000000 --- a/templates/_tplvalues.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{{/* -Copyright Broadcom, Inc. All Rights Reserved. -SPDX-License-Identifier: APACHE-2.0 -*/}} - -{{/* vim: set filetype=mustache: */}} -{{/* -Renders a value that contains template perhaps with scope if the scope is present. -Usage: -{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }} -{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }} -*/}} -{{- define "common.tplvalues.render" -}} -{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} -{{- if contains "{{" (toJson .value) }} - {{- if .scope }} - {{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }} - {{- else }} - {{- tpl $value .context }} - {{- end }} -{{- else }} - {{- $value }} -{{- end }} -{{- end -}} - -{{/* -Merge a list of values that contains template after rendering them. -Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge -Usage: -{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }} -*/}} -{{- define "common.tplvalues.merge" -}} -{{- $dst := dict -}} -{{- range .values -}} -{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}} -{{- end -}} -{{ $dst | toYaml }} -{{- end -}} \ No newline at end of file diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index 9613c2e..af2097e 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..1ecd388 100644 --- a/values.yaml +++ b/values.yaml @@ -392,3 +392,8 @@ rabbitmq: # pv_name: rabbitmq-data # storage_class_name: default # size: 1Gi + +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "host.alias.com" \ No newline at end of file From 1dc9f7fb218e85ed5b2ae15dc3bd54fc78a24016 Mon Sep 17 00:00:00 2001 From: Julien Sabatier Date: Thu, 22 Aug 2024 16:08:24 +0200 Subject: [PATCH 03/10] Update version in Chart.yaml --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 379a86706bee22aefa23f6bd0c8f9d7c7f3bcddb Mon Sep 17 00:00:00 2001 From: Jean-Michel Crepel Date: Thu, 22 Aug 2024 17:12:30 +0200 Subject: [PATCH 04/10] correct syntaxe with simpler way --- templates/analytics/analytics-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index af2097e..ef3c73c 100644 --- a/templates/analytics/analytics-deployment.yaml +++ b/templates/analytics/analytics-deployment.yaml @@ -71,6 +71,6 @@ spec: {{- end }} {{- if .Values.hostAliases }} hostAliases: - {{- .Values.hostAliases | toYaml | nindent 8 }} + {{- .Values.hostAliases | toYaml | nindent 8 }} {{- end }} {{- end }} From 5048304e9e24450025edbd1a6e9c356414e71998 Mon Sep 17 00:00:00 2001 From: Jean-Michel Crepel Date: Fri, 23 Aug 2024 08:30:15 +0200 Subject: [PATCH 05/10] update with review --- values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 1ecd388..3f29ddc 100644 --- a/values.yaml +++ b/values.yaml @@ -396,4 +396,5 @@ rabbitmq: hostAliases: [] # - ip: "127.0.0.1" # hostnames: -# - "host.alias.com" \ No newline at end of file +# - "host.alias.com" + From 922ab17824853e2c7692e1a17bc9fa5ea4c5de2b Mon Sep 17 00:00:00 2001 From: Jean-Michel Crepel Date: Fri, 23 Aug 2024 08:34:37 +0200 Subject: [PATCH 06/10] change version of the chart --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 56642bb..a74bbaf 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.1 +version: 1.3.0 # 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 From 0735bb3e2cf9f011308489ce85de817eb9a6644f Mon Sep 17 00:00:00 2001 From: Jean-Michel Crepel Date: Fri, 23 Aug 2024 08:45:19 +0200 Subject: [PATCH 07/10] Revert "change version of the chart" This reverts commit a1ad137d07e79fde676e644007353138540f49d0. --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index a74bbaf..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.3.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 From 3de8eb3dfb0aaac80eb9b96e4b774118e52b816c Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:31:07 +0200 Subject: [PATCH 08/10] remove bump version + add more comments about hostAliases --- Chart.yaml | 2 +- values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 56642bb..e0ede96 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.1 +version: 1.2.5 # 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/values.yaml b/values.yaml index 3f29ddc..75c5ea6 100644 --- a/values.yaml +++ b/values.yaml @@ -393,6 +393,8 @@ rabbitmq: # 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: From 5fbda608d7337c54716d4aa342e74ab3eeae2cd3 Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:06:56 +0200 Subject: [PATCH 09/10] fix lint empty-lines --- values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/values.yaml b/values.yaml index 75c5ea6..efa440e 100644 --- a/values.yaml +++ b/values.yaml @@ -399,4 +399,3 @@ hostAliases: [] # - ip: "127.0.0.1" # hostnames: # - "host.alias.com" - From 96f02396a0099f861cac35992f2912b47404255d Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:11:04 +0200 Subject: [PATCH 10/10] fix ci trailing-spaces from commit 29d2466cfe79093de7266cfaee4fdbcefa4db560 --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index efa440e..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: