feat: Add pod disruption budget to helm chart

Now it is possible to define the pod disruption budget.

Closes: #8222
This commit is contained in:
Mayer Maximilian 2022-10-24 09:51:49 +02:00
parent 918c011e33
commit 08e1566490
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,18 @@
{{- if and (.Values.pdb.enabled) (.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "emqx.fullname" . }}-pdb
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "emqx.name" . }}
helm.sh/chart: {{ include "emqx.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "emqx.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@ -211,3 +211,10 @@ ssl:
issuer:
name: letsencrypt-dns
kind: ClusterIssuer
## Setting PodDisruptionBudget.
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
##
pdb:
enabled: false
maxUnavailable: 1