Skip to content

Commit

Permalink
Merge pull request #9213 from may-cDev/master
Browse files Browse the repository at this point in the history
feat: Add pod disruption budget to helm chart
  • Loading branch information
id committed Feb 21, 2023
2 parents 94420b4 + 08e1566 commit 4461a07
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions deploy/charts/emqx/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 7 additions & 0 deletions deploy/charts/emqx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,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

0 comments on commit 4461a07

Please sign in to comment.