From 31a7f23ed77a2f61c5e3f5920ad5e560accbbfff Mon Sep 17 00:00:00 2001 From: AlexDHoffer Date: Mon, 9 May 2022 15:48:39 -0700 Subject: [PATCH] [tempo-distributed] Add pdb if resource has > 1 replicas This adds pdbs in the same manner that the loki-distributed chart does. Signed-off-by: AlexDHoffer --- charts/tempo-distributed/Chart.yaml | 2 +- .../compactor/poddisruptionbudget-compactor.yaml | 13 +++++++++++++ .../poddisruptionbudget-distributor.yaml | 13 +++++++++++++ .../gateway/poddisruptionbudget-gateway.yaml | 13 +++++++++++++ .../ingester/poddisruptionbudget-ingester.yaml | 13 +++++++++++++ .../templates/memcached/_helpers-memcached.tpl | 7 +++++++ .../memcached/poddisruptionbudget-memcached.yaml | 13 +++++++++++++ .../templates/memcached/service-memcached.yaml | 2 +- .../memcached/servicemonitor-memcached.yaml | 2 +- .../templates/memcached/statefulset-memcached.yaml | 2 +- .../querier/poddisruptionbudget-querier.yaml | 13 +++++++++++++ .../poddisruptionbudget-query-frontend.yaml | 13 +++++++++++++ 12 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 charts/tempo-distributed/templates/compactor/poddisruptionbudget-compactor.yaml create mode 100644 charts/tempo-distributed/templates/distributor/poddisruptionbudget-distributor.yaml create mode 100644 charts/tempo-distributed/templates/gateway/poddisruptionbudget-gateway.yaml create mode 100644 charts/tempo-distributed/templates/ingester/poddisruptionbudget-ingester.yaml create mode 100644 charts/tempo-distributed/templates/memcached/poddisruptionbudget-memcached.yaml create mode 100644 charts/tempo-distributed/templates/querier/poddisruptionbudget-querier.yaml create mode 100644 charts/tempo-distributed/templates/query-frontend/poddisruptionbudget-query-frontend.yaml diff --git a/charts/tempo-distributed/Chart.yaml b/charts/tempo-distributed/Chart.yaml index 35e2dfc5c1..bfec06b268 100644 --- a/charts/tempo-distributed/Chart.yaml +++ b/charts/tempo-distributed/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: tempo-distributed description: Grafana Tempo in MicroService mode type: application -version: 0.17.2 +version: 0.17.3 appVersion: 1.4.0 engine: gotpl home: https://grafana.com/docs/tempo/latest/ diff --git a/charts/tempo-distributed/templates/compactor/poddisruptionbudget-compactor.yaml b/charts/tempo-distributed/templates/compactor/poddisruptionbudget-compactor.yaml new file mode 100644 index 0000000000..07f94529bf --- /dev/null +++ b/charts/tempo-distributed/templates/compactor/poddisruptionbudget-compactor.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.compactor.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.compactorFullname" . }} + labels: + {{- include "tempo.compactorLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.compactorSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/distributor/poddisruptionbudget-distributor.yaml b/charts/tempo-distributed/templates/distributor/poddisruptionbudget-distributor.yaml new file mode 100644 index 0000000000..34b2a36c67 --- /dev/null +++ b/charts/tempo-distributed/templates/distributor/poddisruptionbudget-distributor.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.distributor.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.distributorFullname" . }} + labels: + {{- include "tempo.distributorLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.distributorSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/gateway/poddisruptionbudget-gateway.yaml b/charts/tempo-distributed/templates/gateway/poddisruptionbudget-gateway.yaml new file mode 100644 index 0000000000..f1052959e6 --- /dev/null +++ b/charts/tempo-distributed/templates/gateway/poddisruptionbudget-gateway.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.gateway.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.gatewayFullname" . }} + labels: + {{- include "tempo.gatewayLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.gatewaySelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/ingester/poddisruptionbudget-ingester.yaml b/charts/tempo-distributed/templates/ingester/poddisruptionbudget-ingester.yaml new file mode 100644 index 0000000000..6d527abe15 --- /dev/null +++ b/charts/tempo-distributed/templates/ingester/poddisruptionbudget-ingester.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.ingester.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.ingesterFullname" . }} + labels: + {{- include "tempo.ingesterLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.ingesterSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/memcached/_helpers-memcached.tpl b/charts/tempo-distributed/templates/memcached/_helpers-memcached.tpl index 6a2c21e49e..b2f63f3b80 100644 --- a/charts/tempo-distributed/templates/memcached/_helpers-memcached.tpl +++ b/charts/tempo-distributed/templates/memcached/_helpers-memcached.tpl @@ -1,3 +1,10 @@ +{{/* +memcached fullname +*/}} +{{- define "tempo.memcachedFullname" -}} +{{ include "tempo.fullname" . }}-memcached +{{- end }} + {{/* memcached common labels */}} diff --git a/charts/tempo-distributed/templates/memcached/poddisruptionbudget-memcached.yaml b/charts/tempo-distributed/templates/memcached/poddisruptionbudget-memcached.yaml new file mode 100644 index 0000000000..9e54fb06b7 --- /dev/null +++ b/charts/tempo-distributed/templates/memcached/poddisruptionbudget-memcached.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.memcached.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.memcachedFullname" . }} + labels: + {{- include "tempo.memcachedLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.memcachedSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/memcached/service-memcached.yaml b/charts/tempo-distributed/templates/memcached/service-memcached.yaml index 09379cf25f..41b7780885 100644 --- a/charts/tempo-distributed/templates/memcached/service-memcached.yaml +++ b/charts/tempo-distributed/templates/memcached/service-memcached.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "tempo.fullname" . }}-memcached + name: {{ include "tempo.memcachedFullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "tempo.memcachedLabels" . | nindent 4 }} diff --git a/charts/tempo-distributed/templates/memcached/servicemonitor-memcached.yaml b/charts/tempo-distributed/templates/memcached/servicemonitor-memcached.yaml index 3501a67d59..cc0273a2da 100644 --- a/charts/tempo-distributed/templates/memcached/servicemonitor-memcached.yaml +++ b/charts/tempo-distributed/templates/memcached/servicemonitor-memcached.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ template "tempo.fullname" $ }}-memcached + name: {{ template "tempo.memcachedFullname" $ }} {{- with .namespace }} namespace: {{ . }} {{- end }} diff --git a/charts/tempo-distributed/templates/memcached/statefulset-memcached.yaml b/charts/tempo-distributed/templates/memcached/statefulset-memcached.yaml index 527bd33d3e..92064f87e7 100644 --- a/charts/tempo-distributed/templates/memcached/statefulset-memcached.yaml +++ b/charts/tempo-distributed/templates/memcached/statefulset-memcached.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "tempo.fullname" . }}-memcached + name: {{ include "tempo.memcachedFullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "tempo.memcachedLabels" . | nindent 4 }} diff --git a/charts/tempo-distributed/templates/querier/poddisruptionbudget-querier.yaml b/charts/tempo-distributed/templates/querier/poddisruptionbudget-querier.yaml new file mode 100644 index 0000000000..2970a4893e --- /dev/null +++ b/charts/tempo-distributed/templates/querier/poddisruptionbudget-querier.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.querier.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.querierFullname" . }} + labels: + {{- include "tempo.querierLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.querierSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }} diff --git a/charts/tempo-distributed/templates/query-frontend/poddisruptionbudget-query-frontend.yaml b/charts/tempo-distributed/templates/query-frontend/poddisruptionbudget-query-frontend.yaml new file mode 100644 index 0000000000..6c2ad0d4ce --- /dev/null +++ b/charts/tempo-distributed/templates/query-frontend/poddisruptionbudget-query-frontend.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.queryFrontend.replicas) 1 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tempo.queryFrontendFullname" . }} + labels: + {{- include "tempo.queryFrontendLabels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tempo.queryFrontendSelectorLabels" . | nindent 6 }} + maxUnavailable: 1 +{{- end }}