From f576febb715500a72ed05eaaa911abbe5a8ddae9 Mon Sep 17 00:00:00 2001 From: amkrtychian Date: Thu, 5 Jun 2025 09:29:04 +0300 Subject: [PATCH 1/4] enable helm templating in affinity section using tpl --- charts/gateway/templates/deployment.yaml | 2 +- tests/gateway/test-values.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/gateway/templates/deployment.yaml b/charts/gateway/templates/deployment.yaml index 929bfee3..6ed27b8d 100644 --- a/charts/gateway/templates/deployment.yaml +++ b/charts/gateway/templates/deployment.yaml @@ -115,7 +115,7 @@ spec: {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: diff --git a/tests/gateway/test-values.yaml b/tests/gateway/test-values.yaml index d05466d0..c0de6e8d 100644 --- a/tests/gateway/test-values.yaml +++ b/tests/gateway/test-values.yaml @@ -34,3 +34,14 @@ resources: requests: cpu: 250m memory: 256Mi + +affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ .Release.Name }}" + topologyKey: "kubernetes.io/hostname" From c93b90305cf798ec49b78ab69f9b4c81cb318385 Mon Sep 17 00:00:00 2001 From: amkrtychian Date: Fri, 6 Jun 2025 21:17:49 +0300 Subject: [PATCH 2/4] enable helm templating in affinity section using tpl --- charts/gateway/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/gateway/README.md b/charts/gateway/README.md index 572bac2f..34d2f677 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -158,6 +158,7 @@ A Helm chart for Trino Gateway whenUnsatisfiable: ScheduleAnyway ``` * `affinity` - object, default: `{}` +* * `commonLabels` - object, default: `{}` Labels that get applied to every resource's metadata From 7749921a8b9ce600ea97581e39469bbbe13fba21 Mon Sep 17 00:00:00 2001 From: amkrtychian Date: Fri, 6 Jun 2025 21:18:28 +0300 Subject: [PATCH 3/4] enable helm templating in affinity section using tpl --- charts/gateway/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/gateway/README.md b/charts/gateway/README.md index 34d2f677..572bac2f 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -158,7 +158,6 @@ A Helm chart for Trino Gateway whenUnsatisfiable: ScheduleAnyway ``` * `affinity` - object, default: `{}` -* * `commonLabels` - object, default: `{}` Labels that get applied to every resource's metadata From 5a37720ef0102d45973994a67ae84b2b8c7d932a Mon Sep 17 00:00:00 2001 From: amkrtychian Date: Sun, 8 Jun 2025 21:38:55 +0300 Subject: [PATCH 4/4] enable helm templating in affinity section using tpl --- charts/gateway/templates/tests/test-connection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gateway/templates/tests/test-connection.yaml b/charts/gateway/templates/tests/test-connection.yaml index 808a1211..ec371945 100644 --- a/charts/gateway/templates/tests/test-connection.yaml +++ b/charts/gateway/templates/tests/test-connection.yaml @@ -22,7 +22,7 @@ spec: command: - "sh" - "-c" - - | + - > {{ $curlOpts := "--fail --retry 5 --retry-all-errors --connect-timeout 10 --retry-delay 10 --verbose" }} {{- if eq .Values.service.type "NodePort" }} if curl {{ $curlOpts }} --insecure https://${NODE_IP}:30443/entity/GATEWAY_BACKEND; then