Skip to content

Commit

Permalink
[tempo-distributed] Add pdb if resource has > 1 replicas
Browse files Browse the repository at this point in the history
This adds pdbs in the same manner that the loki-distributed chart does.

Signed-off-by: AlexDHoffer <alexdchoffer@gmail.com>
  • Loading branch information
AlexDCraig committed May 10, 2022
1 parent f942ba6 commit 31a7f23
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/tempo-distributed/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{{/*
memcached fullname
*/}}
{{- define "tempo.memcachedFullname" -}}
{{ include "tempo.fullname" . }}-memcached
{{- end }}

{{/*
memcached common labels
*/}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 31a7f23

Please sign in to comment.