Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master / unreleased

* [FEATURE] Support zone awareness on Ingester. #632

## 3.3.0 / 2026-04-27

* [FEATURE] Add a parquet labels cache. #621
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,29 @@ Kubernetes: `^1.19.0-0`
| ingester.​terminationGracePeriodSeconds | int | `240` | |
| ingester.​tolerations | list | `[]` | |
| ingester.​topologySpreadConstraints | list | `[]` | |
| ingester.​zoneAwareness.​enabled | bool | `false` | |
| ingester.​zoneAwareness.​migration.​enabled | bool | `false` | |
| ingester.​zoneAwareness.​zoneA.​annotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneA.​extraAffinity | object | `{}` | |
| ingester.​zoneAwareness.​zoneA.​nodeSelector | object | `{}` | |
| ingester.​zoneAwareness.​zoneA.​podAnnotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneA.​podLabels | object | `{}` | |
| ingester.​zoneAwareness.​zoneA.​replicas | int | `1` | |
| ingester.​zoneAwareness.​zoneA.​tolerations | list | `[]` | |
| ingester.​zoneAwareness.​zoneB.​annotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneB.​extraAffinity | object | `{}` | |
| ingester.​zoneAwareness.​zoneB.​nodeSelector | object | `{}` | |
| ingester.​zoneAwareness.​zoneB.​podAnnotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneB.​podLabels | object | `{}` | |
| ingester.​zoneAwareness.​zoneB.​replicas | int | `1` | |
| ingester.​zoneAwareness.​zoneB.​tolerations | list | `[]` | |
| ingester.​zoneAwareness.​zoneC.​annotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneC.​extraAffinity | object | `{}` | |
| ingester.​zoneAwareness.​zoneC.​nodeSelector | object | `{}` | |
| ingester.​zoneAwareness.​zoneC.​podAnnotations | object | `{}` | |
| ingester.​zoneAwareness.​zoneC.​podLabels | object | `{}` | |
| ingester.​zoneAwareness.​zoneC.​replicas | int | `1` | |
| ingester.​zoneAwareness.​zoneC.​tolerations | list | `[]` | |
| ingress.​annotations | object | `{}` | |
| ingress.​enabled | bool | `false` | |
| ingress.​hosts[0].​host | string | `"chart-example.local"` | |
Expand Down
3 changes: 3 additions & 0 deletions templates/distributor/distributor-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ spec:
args:
- "-target=distributor"
- "-config.file=/etc/cortex/cortex.yaml"
{{- if .Values.ingester.zoneAwareness.enabled }}
- -distributor.zone-awareness-enabled={{ not .Values.ingester.zoneAwareness.migration.enabled }}
{{- end }}
{{- range $key, $value := .Values.distributor.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
Expand Down
154 changes: 154 additions & 0 deletions templates/ingester/ingester-dep-zone-a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{{- if and (not .Values.ingester.statefulSet.enabled) .Values.ingester.enabled .Values.ingester.zoneAwareness.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cortex.ingesterFullname" . }}-zone-a
namespace: {{ .Release.Namespace }}
labels:
{{- include "cortex.ingesterLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
zone: a
annotations:
{{- toYaml .Values.ingester.zoneAwareness.zoneA.annotations | default (toYaml .Values.ingester.annotations) | nindent 4 }}
spec:
{{- if not .Values.ingester.autoscaling.enabled }}
replicas: {{ .Values.ingester.zoneAwareness.zoneA.replicas | default .Values.ingester.replicas }}
{{- end }}
selector:
matchLabels:
{{- include "cortex.ingesterSelectorLabels" . | nindent 6 }}
zone: a
strategy:
{{- toYaml .Values.ingester.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "cortex.ingesterLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
zone: a
{{- with .Values.ingester.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.zoneAwareness.zoneA.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include "cortex.configChecksum" . }}
{{- with .Values.ingester.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.zoneAwareness.zoneA.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.ingester.serviceAccount.name | default (include "cortex.serviceAccountName" .) }}
{{- if .Values.ingester.priorityClassName }}
priorityClassName: {{ .Values.ingester.priorityClassName }}
{{- end }}
{{- if .Values.ingester.securityContext.enabled }}
securityContext: {{- omit .Values.ingester.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.ingester.initContainers | nindent 8 }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: ingester
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=ingester"
- "-config.file=/etc/cortex/cortex.yaml"
- "-ingester.availability-zone=zone-a"
{{- include "cortex.memcached" . | nindent 12 }}
{{- range $key, $value := .Values.ingester.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.ingester.extraVolumeMounts }}
{{- toYaml .Values.ingester.extraVolumeMounts | nindent 12 }}
{{- end }}
- name: config
mountPath: /etc/cortex
- name: runtime-config
mountPath: /etc/cortex-runtime-config
- name: storage
mountPath: "/data"
{{- with .Values.ingester.persistentVolume.subPath }}
subPath: {{ . }}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ .Values.config.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.config.server.grpc_listen_port }}
protocol: TCP
- name: gossip
containerPort: {{ .Values.config.memberlist.bind_port }}
protocol: TCP
{{- if .Values.ingester.startupProbe }}
startupProbe:
{{- toYaml .Values.ingester.startupProbe | nindent 12 }}
{{- end }}
{{- if .Values.ingester.livenessProbe }}
livenessProbe:
{{- toYaml .Values.ingester.livenessProbe | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.ingester.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.ingester.resources | nindent 12 }}
{{- if .Values.ingester.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.ingester.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.ingester.env }}
env:
{{- toYaml .Values.ingester.env | nindent 12 }}
{{- end }}
{{- with .Values.ingester.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
{{- if .Values.ingester.zoneAwareness.zoneA.nodeSelector }}
{{- toYaml .Values.ingester.zoneAwareness.zoneA.nodeSelector | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.ingester.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if .Values.ingester.zoneAwareness.zoneA.extraAffinity }}
{{- toYaml .Values.ingester.zoneAwareness.zoneA.extraAffinity | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.affinity | nindent 8 }}
{{- end }}
tolerations:
{{- if .Values.ingester.zoneAwareness.zoneA.tolerations }}
{{- toYaml .Values.ingester.zoneAwareness.zoneA.tolerations | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.tolerations | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
volumes:
{{- include "cortex.configVolume" . | nindent 8 }}
- name: runtime-config
configMap:
name: {{ template "cortex.fullname" . }}-runtime-config
- name: storage
emptyDir: {}
{{- if .Values.ingester.extraVolumes }}
{{- toYaml .Values.ingester.extraVolumes | nindent 8 }}
{{- end }}
{{- end -}}

154 changes: 154 additions & 0 deletions templates/ingester/ingester-dep-zone-b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{{- if and (not .Values.ingester.statefulSet.enabled) .Values.ingester.enabled .Values.ingester.zoneAwareness.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cortex.ingesterFullname" . }}-zone-b
namespace: {{ .Release.Namespace }}
labels:
{{- include "cortex.ingesterLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
zone: b
annotations:
{{- toYaml .Values.ingester.zoneAwareness.zoneB.annotations | default (toYaml .Values.ingester.annotations) | nindent 4 }}
spec:
{{- if not .Values.ingester.autoscaling.enabled }}
replicas: {{ .Values.ingester.zoneAwareness.zoneB.replicas | default .Values.ingester.replicas }}
{{- end }}
selector:
matchLabels:
{{- include "cortex.ingesterSelectorLabels" . | nindent 6 }}
zone: b
strategy:
{{- toYaml .Values.ingester.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "cortex.ingesterLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
zone: b
{{- with .Values.ingester.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.zoneAwareness.zoneB.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include "cortex.configChecksum" . }}
{{- with .Values.ingester.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.zoneAwareness.zoneB.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.ingester.serviceAccount.name | default (include "cortex.serviceAccountName" .) }}
{{- if .Values.ingester.priorityClassName }}
priorityClassName: {{ .Values.ingester.priorityClassName }}
{{- end }}
{{- if .Values.ingester.securityContext.enabled }}
securityContext: {{- omit .Values.ingester.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.ingester.initContainers | nindent 8 }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: ingester
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=ingester"
- "-config.file=/etc/cortex/cortex.yaml"
- "-ingester.availability-zone=zone-b"
{{- include "cortex.memcached" . | nindent 12 }}
{{- range $key, $value := .Values.ingester.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.ingester.extraVolumeMounts }}
{{- toYaml .Values.ingester.extraVolumeMounts | nindent 12 }}
{{- end }}
- name: config
mountPath: /etc/cortex
- name: runtime-config
mountPath: /etc/cortex-runtime-config
- name: storage
mountPath: "/data"
{{- with .Values.ingester.persistentVolume.subPath }}
subPath: {{ . }}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ .Values.config.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.config.server.grpc_listen_port }}
protocol: TCP
- name: gossip
containerPort: {{ .Values.config.memberlist.bind_port }}
protocol: TCP
{{- if .Values.ingester.startupProbe }}
startupProbe:
{{- toYaml .Values.ingester.startupProbe | nindent 12 }}
{{- end }}
{{- if .Values.ingester.livenessProbe }}
livenessProbe:
{{- toYaml .Values.ingester.livenessProbe | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.ingester.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.ingester.resources | nindent 12 }}
{{- if .Values.ingester.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.ingester.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.ingester.env }}
env:
{{- toYaml .Values.ingester.env | nindent 12 }}
{{- end }}
{{- with .Values.ingester.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
{{- if .Values.ingester.zoneAwareness.zoneB.nodeSelector }}
{{- toYaml .Values.ingester.zoneAwareness.zoneB.nodeSelector | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.ingester.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if .Values.ingester.zoneAwareness.zoneB.extraAffinity }}
{{- toYaml .Values.ingester.zoneAwareness.zoneB.extraAffinity | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.affinity | nindent 8 }}
{{- end }}
tolerations:
{{- if .Values.ingester.zoneAwareness.zoneB.tolerations }}
{{- toYaml .Values.ingester.zoneAwareness.zoneB.tolerations | nindent 8 }}
{{- else }}
{{- toYaml .Values.ingester.tolerations | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
volumes:
{{- include "cortex.configVolume" . | nindent 8 }}
- name: runtime-config
configMap:
name: {{ template "cortex.fullname" . }}-runtime-config
- name: storage
emptyDir: {}
{{- if .Values.ingester.extraVolumes }}
{{- toYaml .Values.ingester.extraVolumes | nindent 8 }}
{{- end }}
{{- end -}}

Loading
Loading