Skip to content

Commit 9c9cdce

Browse files
authored
Merge pull request #8718 from phuhung273/updater-pdb
feat(chart): VPA Updater PodDisruptionBudget
2 parents 4177783 + 696ecce commit 9c9cdce

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.5.0
18+
version: 0.6.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WARNING: This chart is currently under development and is not ready for producti
44

55
Automatically adjust resources for your workloads
66

7-
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square)
7+
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square)
88
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
99
![AppVersion: 1.5.1](https://img.shields.io/badge/AppVersion-1.5.1-informational?style=flat-square)
1010

@@ -107,6 +107,9 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
107107
| updater.leaderElection.resourceNamespace | string | `""` | |
108108
| updater.leaderElection.retryPeriod | string | `"2s"` | |
109109
| updater.podAnnotations | object | `{}` | |
110+
| updater.podDisruptionBudget.enabled | bool | `true` | |
111+
| updater.podDisruptionBudget.maxUnavailable | int or string | `nil` | Maximum number/percentage of pods that can be unavailable after the eviction. IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both. |
112+
| updater.podDisruptionBudget.minAvailable | int or string | `1` | Minimum number/percentage of pods that must be available after the eviction. IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both. |
110113
| updater.podLabels | object | `{}` | |
111114
| updater.replicas | int | `2` | |
112115
| updater.serviceAccount.annotations | object | `{}` | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.updater.enabled .Values.updater.podDisruptionBudget.enabled -}}
2+
{{- if and .Values.updater.podDisruptionBudget.minAvailable .Values.updater.podDisruptionBudget.maxUnavailable }}
3+
{{- fail "Only one of updater.podDisruptionBudget.minAvailable or updater.podDisruptionBudget.maxUnavailable should be set." }}
4+
{{- end }}
5+
apiVersion: policy/v1
6+
kind: PodDisruptionBudget
7+
metadata:
8+
name: {{ include "vertical-pod-autoscaler.updater.fullname" . }}
9+
namespace: {{ .Release.Namespace }}
10+
labels:
11+
{{- include "vertical-pod-autoscaler.updater.labels" . | nindent 4 }}
12+
spec:
13+
selector:
14+
matchLabels:
15+
{{- include "vertical-pod-autoscaler.updater.selectorLabels" . | nindent 6 }}
16+
{{- if .Values.updater.podDisruptionBudget.minAvailable }}
17+
minAvailable: {{ .Values.updater.podDisruptionBudget.minAvailable }}
18+
{{- end }}
19+
{{- if .Values.updater.podDisruptionBudget.maxUnavailable }}
20+
maxUnavailable: {{ .Values.updater.podDisruptionBudget.maxUnavailable }}
21+
{{- end }}
22+
{{- end -}}

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,13 @@ updater:
227227
renewDeadline: 10s
228228
# Duration the clients should wait between attempting acquisition and renewal of a leadership.
229229
retryPeriod: 2s
230+
231+
# PodDisruptionBudget for the Updater.
232+
podDisruptionBudget:
233+
enabled: true
234+
# -- (int or string) Minimum number/percentage of pods that must be available after the eviction.
235+
# IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both.
236+
minAvailable: 1
237+
# -- (int or string) Maximum number/percentage of pods that can be unavailable after the eviction.
238+
# IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both.
239+
maxUnavailable:

0 commit comments

Comments
 (0)