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
13 changes: 13 additions & 0 deletions charts/quickwit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,16 @@ List format (recommended): [{ name: KEY, value: VALUE, valueFrom: ... }]
{{- end -}}
{{- end -}}
{{- end }}

{{/*
AZ awareness topology spread constraint for a component.
Accepts the component's selector labels YAML string as its argument.
*/}}
{{- define "quickwit.azTopologySpreadConstraint" -}}
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- . | nindent 6 }}
{{- end }}
9 changes: 7 additions & 2 deletions charts/quickwit/templates/indexer-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ spec:
runtimeClassName: {{ .Values.indexer.runtimeClassName | quote }}
{{- end }}
{{- $tsc := concat .Values.topologySpreadConstraints .Values.indexer.topologySpreadConstraints | compact }}
{{- if $tsc }}
{{- if or $tsc .Values.azAwareness.enabled }}
topologySpreadConstraints:
{{- toYaml $tsc | nindent 8 }}
{{- if .Values.azAwareness.enabled }}
{{- include "quickwit.azTopologySpreadConstraint" (include "quickwit.indexer.selectorLabels" .) | nindent 8 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid duplicating zone spread constraints

When an install already sets a global or indexer topologySpreadConstraints entry with topologyKey: topology.kubernetes.io/zone and whenUnsatisfiable: ScheduleAnyway, enabling azAwareness unconditionally prepends another constraint with the same pair before rendering the user-supplied list. Kubernetes only permits one topologySpreadConstraint for each topologyKey/whenUnsatisfiable pair, so that common existing zone-spread configuration renders an invalid StatefulSet and blocks the upgrade; skip or merge the generated constraint when the user already supplies one.

Useful? React with 👍 / 👎.

{{- end }}
{{- with $tsc }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.indexer.persistentVolume.enabled }}
volumeClaimTemplates:
Expand Down
3 changes: 3 additions & 0 deletions charts/quickwit/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ metadata:
labels:
{{- include "quickwit.labels" . | nindent 4 }}
annotations:
{{- if .Values.azAwareness.enabled }}
service.kubernetes.io/topology-mode: Auto
{{- end }}
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
8 changes: 8 additions & 0 deletions charts/quickwit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ volumeMounts: []
# -- Configure [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/).
topologySpreadConstraints: []

# Availability Zone awareness
azAwareness:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I’d prefer not to introduce a dedicated azAwareness value here. The more values we add, the more featurs we need to support, so I’d like to keep this as minimal as possible.

The chart already exposes indexer.topologySpreadConstraints and indexer.serviceAnnotations, so could we use those instead?

# -- Enable AZ awareness. Adds a topology spread constraint to distribute indexer pods
# evenly across zones, and enables topology-aware routing on the indexer service so
# traffic prefers same-zone endpoints. Uses the node-level `topology.kubernetes.io/zone`
# label.
enabled: false

searcher:
enabled: true
replicaCount: 3
Expand Down
Loading