From 22399771e5ef04b95f97d7d3e5f48c7cdd9c7c36 Mon Sep 17 00:00:00 2001 From: Bengisu Akkir Date: Fri, 4 Jul 2025 16:42:13 +0200 Subject: [PATCH 1/5] add topologySpreadConstraints for coordinator --- charts/trino/README.md | 21 +++++++++++++++ .../templates/deployment-coordinator.yaml | 4 +++ charts/trino/values.yaml | 26 +++++++++++++++++++ tests/trino/test-values.yaml | 16 ++++++++++++ 4 files changed, 67 insertions(+) diff --git a/charts/trino/README.md b/charts/trino/README.md index 0d1590ec..1a391ccb 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -569,6 +569,27 @@ Fast distributed SQL query engine for big data analytics that helps you explore * `coordinator.nodeSelector` - object, default: `{}` * `coordinator.tolerations` - list, default: `[]` * `coordinator.affinity` - object, default: `{}` +* `coordinator.topologySpreadConstraints` - list, default: `[]` + + Configure [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) to control how coordinator pods are spread across your cluster among failure-domains such as nodes, zones, and regions. + Example of spreading coordinators across hostnames and zones: + ```yaml + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: "kubernetes.io/hostname" + whenUnsatisfiable: "ScheduleAnyway" + labelSelector: + matchLabels: + app.kubernetes.io/name: trino + app.kubernetes.io/component: coordinator + - maxSkew: 1 + topologyKey: "topology.kubernetes.io/zone" + whenUnsatisfiable: "DoNotSchedule" + labelSelector: + matchLabels: + app.kubernetes.io/name: trino + app.kubernetes.io/component: coordinator + ``` * `coordinator.additionalConfigFiles` - object, default: `{}` Additional config files placed in the default configuration directory. Supports templating the files' contents with `tpl`. diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index d6906f91..f7ff76d4 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -262,6 +262,10 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.coordinator.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.coordinator.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 9d9e102c..ddf5d0a6 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -664,6 +664,32 @@ coordinator: affinity: {} + topologySpreadConstraints: [] + # coordinator.topologySpreadConstraints -- Configure [topology spread + # constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) + # to control how coordinator pods are spread across your cluster among failure-domains + # such as nodes, zones, and regions. + # + # @raw + # Example of spreading coordinator across hostnames and zones: + # ```yaml + # topologySpreadConstraints: + # - maxSkew: 1 + # topologyKey: "kubernetes.io/hostname" + # whenUnsatisfiable: "ScheduleAnyway" + # labelSelector: + # matchLabels: + # app.kubernetes.io/name: trino + # app.kubernetes.io/component: coordinator + # - maxSkew: 1 + # topologyKey: "topology.kubernetes.io/zone" + # whenUnsatisfiable: "DoNotSchedule" + # labelSelector: + # matchLabels: + # app.kubernetes.io/name: trino + # app.kubernetes.io/component: coordinator + # ``` + additionalConfigFiles: {} # coordinator.additionalConfigFiles -- Additional config files placed in the default configuration directory. # Supports templating the files' contents with `tpl`. diff --git a/tests/trino/test-values.yaml b/tests/trino/test-values.yaml index 5c5b23b1..6849779b 100644 --- a/tests/trino/test-values.yaml +++ b/tests/trino/test-values.yaml @@ -103,6 +103,22 @@ coordinator: annotations: custom/name: value + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: "kubernetes.io/hostname" + whenUnsatisfiable: "ScheduleAnyway" + labelSelector: + matchLabels: + app.kubernetes.io/name: trino + app.kubernetes.io/component: coordinator + - maxSkew: 1 + topologyKey: "topology.kubernetes.io/zone" + whenUnsatisfiable: "ScheduleAnyway" + labelSelector: + matchLabels: + app.kubernetes.io/name: trino + app.kubernetes.io/component: coordinator + worker: deployment: annotations: From 004cd68bf1f613dd5aac0d26e4ab1890621ed63a Mon Sep 17 00:00:00 2001 From: Bengisu Akkir Date: Wed, 30 Jul 2025 09:12:08 +0200 Subject: [PATCH 2/5] Update values.yaml --- charts/trino/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index ddf5d0a6..211c3300 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -667,7 +667,7 @@ coordinator: topologySpreadConstraints: [] # coordinator.topologySpreadConstraints -- Configure [topology spread # constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) - # to control how coordinator pods are spread across your cluster among failure-domains + # to control how the coordinator pod is places in your cluster among failure-domains # such as nodes, zones, and regions. # # @raw From 634931843fd19b385b31076b76f19e841d57d977 Mon Sep 17 00:00:00 2001 From: Bengisu Akkir Date: Wed, 30 Jul 2025 09:13:37 +0200 Subject: [PATCH 3/5] fix typo --- charts/trino/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 211c3300..868a2ac2 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -667,7 +667,7 @@ coordinator: topologySpreadConstraints: [] # coordinator.topologySpreadConstraints -- Configure [topology spread # constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) - # to control how the coordinator pod is places in your cluster among failure-domains + # to control how the coordinator pod is placed in your cluster among failure-domains # such as nodes, zones, and regions. # # @raw From 1692754c959c95af5e36d772c5070d40f79f6cb1 Mon Sep 17 00:00:00 2001 From: Bengisu Akkir Date: Tue, 19 Aug 2025 08:46:10 +0200 Subject: [PATCH 4/5] fix trailing space --- charts/trino/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 868a2ac2..edba94b5 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -689,7 +689,7 @@ coordinator: # app.kubernetes.io/name: trino # app.kubernetes.io/component: coordinator # ``` - + additionalConfigFiles: {} # coordinator.additionalConfigFiles -- Additional config files placed in the default configuration directory. # Supports templating the files' contents with `tpl`. From b7d26e97d2a99f155dad6f3a833e1e6aba5a8d84 Mon Sep 17 00:00:00 2001 From: Bengisu Akkir Date: Tue, 19 Aug 2025 08:51:49 +0200 Subject: [PATCH 5/5] make documentation consistent --- charts/trino/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/trino/README.md b/charts/trino/README.md index 1a391ccb..1e0dd2e3 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -571,7 +571,7 @@ Fast distributed SQL query engine for big data analytics that helps you explore * `coordinator.affinity` - object, default: `{}` * `coordinator.topologySpreadConstraints` - list, default: `[]` - Configure [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) to control how coordinator pods are spread across your cluster among failure-domains such as nodes, zones, and regions. + Configure [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) to control how the coordinator pod is placed in your cluster among failure-domains such as nodes, zones, and regions. Example of spreading coordinators across hostnames and zones: ```yaml topologySpreadConstraints: