Skip to content

Commit fa7a5bc

Browse files
authored
Merge pull request #8651 from itstrueitstrueitsrealitsreal/update-charts-3
feat(chart): add PodDisruptionBudget chart for admission controller
2 parents 6e2f76d + 13b8fc7 commit fa7a5bc

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
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.2.0
18+
version: 0.3.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: 5 additions & 2 deletions
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.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square)
7+
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.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

@@ -30,8 +30,11 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
3030
| admissionController.image.tag | string | `nil` | |
3131
| admissionController.nodeSelector | object | `{}` | |
3232
| admissionController.podAnnotations | object | `{}` | |
33+
| admissionController.podDisruptionBudget.enabled | bool | `true` | |
34+
| admissionController.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. |
35+
| admissionController.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. |
3336
| admissionController.podLabels | object | `{}` | |
34-
| admissionController.replicas | int | `1` | |
37+
| admissionController.replicas | int | `2` | |
3538
| admissionController.resources.limits.cpu | string | `"200m"` | |
3639
| admissionController.resources.limits.memory | string | `"500Mi"` | |
3740
| admissionController.resources.requests.cpu | string | `"50m"` | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.admissionController.enabled .Values.admissionController.podDisruptionBudget.enabled -}}
2+
{{- if and .Values.admissionController.podDisruptionBudget.minAvailable .Values.admissionController.podDisruptionBudget.maxUnavailable }}
3+
{{- fail "Only one of admissionController.podDisruptionBudget.minAvailable or admissionController.podDisruptionBudget.maxUnavailable should be set." }}
4+
{{- end }}
5+
apiVersion: policy/v1
6+
kind: PodDisruptionBudget
7+
metadata:
8+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
9+
namespace: {{ .Release.Namespace }}
10+
labels:
11+
{{- include "vertical-pod-autoscaler.admissionController.labels" . | nindent 4 }}
12+
spec:
13+
selector:
14+
matchLabels:
15+
{{- include "vertical-pod-autoscaler.admissionController.selectorLabels" . | nindent 6 }}
16+
{{- if and .Values.admissionController.podDisruptionBudget.minAvailable (not .Values.admissionController.podDisruptionBudget.maxUnavailable) }}
17+
minAvailable: {{ .Values.admissionController.podDisruptionBudget.minAvailable }}
18+
{{- end }}
19+
{{- if and .Values.admissionController.podDisruptionBudget.maxUnavailable (not .Values.admissionController.podDisruptionBudget.minAvailable) }}
20+
maxUnavailable: {{ .Values.admissionController.podDisruptionBudget.maxUnavailable }}
21+
{{- end }}
22+
{{- end -}}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ admissionController:
4242
targetPort: 8000
4343

4444
# Number of Admission Controller replicas to create.
45-
replicas: 1
45+
replicas: 2
4646

4747
# Labels to add to the Admission Controller pod.
4848
podLabels: {}
@@ -85,3 +85,13 @@ admissionController:
8585
- name: tls-certs
8686
mountPath: /etc/tls-certs
8787
readOnly: true
88+
89+
podDisruptionBudget:
90+
enabled: true
91+
# -- (int or string) Minimum number/percentage of pods that must be available after the eviction.
92+
# IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both.
93+
minAvailable: 1
94+
# -- (int or string) Maximum number/percentage of pods that can be unavailable after the eviction.
95+
# IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both.
96+
maxUnavailable:
97+
# maxUnavailable: 1

0 commit comments

Comments
 (0)