Merge pull request #9213 from may-cDev/master

feat: Add pod disruption budget to helm chart
This commit is contained in:
Ivan Dyachkov 2023-02-21 10:17:33 +00:00 committed by GitHub
commit 4461a07af2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

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