Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 4 additions & 0 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
26 changes: 26 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this sentence was copied from workers and adjusted to singular form, it doesn't make much sense. One coordinator can't be spread out.

A better example would be to avoid deploying it on some nodes.

# ```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`.
Expand Down
16 changes: 16 additions & 0 deletions tests/trino/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down