diff --git a/charts/quickwit/Chart.yaml b/charts/quickwit/Chart.yaml index b74ecab..56aee95 100644 --- a/charts/quickwit/Chart.yaml +++ b/charts/quickwit/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: quickwit description: Sub-second search & analytics engine on cloud storage. type: application -version: 0.8.7 +version: 0.8.8 appVersion: v0.8.2 keywords: - quickwit diff --git a/charts/quickwit/templates/_helpers.tpl b/charts/quickwit/templates/_helpers.tpl index 4dacd69..7a0f54a 100644 --- a/charts/quickwit/templates/_helpers.tpl +++ b/charts/quickwit/templates/_helpers.tpl @@ -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 }} diff --git a/charts/quickwit/templates/indexer-statefulset.yaml b/charts/quickwit/templates/indexer-statefulset.yaml index 4168c7f..585d7f7 100644 --- a/charts/quickwit/templates/indexer-statefulset.yaml +++ b/charts/quickwit/templates/indexer-statefulset.yaml @@ -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 }} + {{- end }} + {{- with $tsc }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- if .Values.indexer.persistentVolume.enabled }} volumeClaimTemplates: diff --git a/charts/quickwit/templates/service.yaml b/charts/quickwit/templates/service.yaml index 71b7b73..4d1334e 100644 --- a/charts/quickwit/templates/service.yaml +++ b/charts/quickwit/templates/service.yaml @@ -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 }} diff --git a/charts/quickwit/values.yaml b/charts/quickwit/values.yaml index 28cd800..4c997a0 100644 --- a/charts/quickwit/values.yaml +++ b/charts/quickwit/values.yaml @@ -74,6 +74,14 @@ volumeMounts: [] # -- Configure [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/). topologySpreadConstraints: [] +# Availability Zone awareness +azAwareness: + # -- 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