diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 6687e504..fe96e2a0 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -110,4 +110,7 @@ spec: {{ end -}} {{ if .Values.deployment.priorityClassName -}} priorityClassName: {{ .Values.deployment.priorityClassName }} - {{ end -}} \ No newline at end of file + {{ end -}} + {{ if .Values.deployment.topologySpreadConstraints -}} + topologySpreadConstraints: {{ .Values.deployment.topologySpreadConstraints | toYaml | nindent 8 }} + {{ end -}} diff --git a/helm/templates/pdb.yaml b/helm/templates/pdb.yaml new file mode 100644 index 00000000..f0a54f56 --- /dev/null +++ b/helm/templates/pdb.yaml @@ -0,0 +1,26 @@ +{{- if .Values.pdb.enabled -}} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "app.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ include "app.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + k8s-app: {{ include "app.name" . }} + helm.sh/chart: {{ include "chart.name-version" . }} + control-plane: controller +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ include "app.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + {{- with .Values.pdb.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with .Values.pdb.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} +{{- end -}} diff --git a/helm/values.yaml b/helm/values.yaml index 2fcc4414..13d76c1d 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -32,10 +32,11 @@ deployment: priorityClassName: "" # Number of replicas. replicas: 2 + topologySpreadConstraints: [] # If "installScope: cluster" then these labels will be applied to ClusterRole role: - labels: {} + labels: {} metrics: service: @@ -54,6 +55,11 @@ resources: memory: "128Mi" cpu: "100m" +pdb: + enabled: false + minAvailable: + maxUnavailable: + # log level for the controller log: level: info