Skip to content

Commit 8f8eedb

Browse files
committed
Add helm template for PodDisruptionBudget of controller Deployment
1 parent c834ae8 commit 8f8eedb

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{/*
2+
# Copyright (c) HashiCorp, Inc.
3+
# SPDX-License-Identifier: BUSL-1.1
4+
*/}}
5+
6+
{{- if and (gt (int .Values.controller.replicas) 1) .Values.controller.podDisruptionBudget.enabled }}
7+
apiVersion: policy/v1
8+
kind: PodDisruptionBudget
9+
metadata:
10+
name: {{ include "vso.chart.fullname" . }}
11+
labels:
12+
app.kubernetes.io/component: controller-manager
13+
control-plane: controller-manager
14+
{{- include "vso.chart.labels" . | nindent 4 }}
15+
namespace: {{ .Release.Namespace }}
16+
spec:
17+
{{- if (gt (int .Values.controller.podDisruptionBudget.maxUnavailable) 0) }}
18+
maxUnavailable: {{ .Values.controller.podDisruptionBudget.maxUnavailable }}
19+
{{- end }}
20+
{{- if (gt (int .Values.controller.podDisruptionBudget.minAvailable) 0) }}
21+
minAvailable: {{ .Values.controller.podDisruptionBudget.minAvailable }}
22+
{{- end }}
23+
selector:
24+
matchLabels:
25+
{{- include "vso.chart.selectorLabels" . | nindent 6 }}
26+
{{- end }}

chart/values.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ controller:
6666
# - antarctica-west1
6767
affinity: {}
6868

69+
# Configure the PodDisruptionBudget for the controller deployment.
70+
podDisruptionBudget:
71+
72+
# toggles the deployment of the PodDisruptionBudget for the controller.
73+
# @type: boolean
74+
enabled: false
75+
76+
# Sets the maximum number of pods that can be unavailable during the eviction.
77+
# This field cannot be set if minAvailable is set.
78+
# @type: integer
79+
maxUnavailable: 0
80+
81+
# Sets the numer of pods that must be available during the eviction.
82+
# This field cannot be set if maxUnavailable is set.
83+
# @type: integer
84+
minAvailable: 1
85+
6986
rbac:
7087
# clusterRoleAggregation defines the roles included in the aggregated ClusterRole.
7188
clusterRoleAggregation:

0 commit comments

Comments
 (0)