Skip to content

Commit 2992afb

Browse files
committed
feat(chart): VPA Updater resources, affinity,nodeSelector,tolerations
Signed-off-by: phuhung273 <phuhung.tranpham@gmail.com>
1 parent d923d53 commit 2992afb

File tree

4 files changed

+83
-6
lines changed

4 files changed

+83
-6
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: 19 additions & 3 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.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

@@ -22,7 +22,10 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
2222

2323
| Key | Type | Default | Description |
2424
|-----|------|---------|-------------|
25-
| admissionController.affinity | object | `{}` | |
25+
| admissionController.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key | string | `"app.kubernetes.io/component"` | |
26+
| admissionController.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator | string | `"In"` | |
27+
| admissionController.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] | string | `"admission-controller"` | |
28+
| admissionController.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey | string | `"kubernetes.io/hostname"` | |
2629
| admissionController.enabled | bool | `true` | |
2730
| admissionController.extraArgs | list | `[]` | |
2831
| admissionController.extraEnv | list | `[]` | |
@@ -68,7 +71,10 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
6871
| podSecurityContext.runAsNonRoot | bool | `true` | |
6972
| podSecurityContext.runAsUser | int | `65534` | |
7073
| rbac.create | bool | `true` | |
71-
| recommender.affinity | object | `{}` | |
74+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key | string | `"app.kubernetes.io/component"` | |
75+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator | string | `"In"` | |
76+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] | string | `"recommender"` | |
77+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey | string | `"kubernetes.io/hostname"` | |
7278
| recommender.enabled | bool | `true` | |
7379
| recommender.extraArgs | list | `[]` | |
7480
| recommender.extraEnv | list | `[]` | |
@@ -96,6 +102,10 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
96102
| recommender.serviceAccount.create | bool | `true` | |
97103
| recommender.serviceAccount.labels | object | `{}` | |
98104
| recommender.tolerations | list | `[]` | |
105+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key | string | `"app.kubernetes.io/component"` | |
106+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator | string | `"In"` | |
107+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] | string | `"updater"` | |
108+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey | string | `"kubernetes.io/hostname"` | |
99109
| updater.enabled | bool | `true` | |
100110
| updater.image.pullPolicy | string | `"IfNotPresent"` | |
101111
| updater.image.repository | string | `"registry.k8s.io/autoscaling/vpa-updater"` | |
@@ -106,9 +116,15 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
106116
| updater.leaderElection.resourceName | string | `"vpa-updater-lease"` | |
107117
| updater.leaderElection.resourceNamespace | string | `""` | |
108118
| updater.leaderElection.retryPeriod | string | `"2s"` | |
119+
| updater.nodeSelector | object | `{}` | |
109120
| updater.podAnnotations | object | `{}` | |
110121
| updater.podLabels | object | `{}` | |
111122
| updater.replicas | int | `2` | |
123+
| updater.resources.limits.cpu | string | `"200m"` | |
124+
| updater.resources.limits.memory | string | `"1000Mi"` | |
125+
| updater.resources.requests.cpu | string | `"50m"` | |
126+
| updater.resources.requests.memory | string | `"500Mi"` | |
112127
| updater.serviceAccount.annotations | object | `{}` | |
113128
| updater.serviceAccount.create | bool | `true` | |
114129
| updater.serviceAccount.labels | object | `{}` | |
130+
| updater.tolerations | list | `[]` | |

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/templates/updater-deployment.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ spec:
3232
securityContext:
3333
{{ toYaml . | nindent 8 | trim }}
3434
{{- end }}
35+
{{- with .Values.updater.affinity }}
36+
affinity:
37+
{{- toYaml . | nindent 8 }}
38+
{{- end }}
39+
{{- with .Values.updater.nodeSelector }}
40+
nodeSelector:
41+
{{- toYaml . | nindent 8 }}
42+
{{- end }}
43+
{{- with .Values.updater.tolerations }}
44+
tolerations:
45+
{{- toYaml . | nindent 8 }}
46+
{{- end }}
3547
containers:
3648
- name: updater
3749
image: {{ include "vertical-pod-autoscaler.updater.image" . }}
@@ -74,4 +86,8 @@ spec:
7486
securityContext:
7587
{{ toYaml . | nindent 12 | trim }}
7688
{{- end }}
89+
{{- with .Values.updater.resources }}
90+
resources:
91+
{{- toYaml . | nindent 12 }}
92+
{{- end }}
7793
{{- end -}}

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

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ admissionController:
7575
nodeSelector: {}
7676

7777
# Affinity for pod assignment.
78-
affinity: {}
78+
affinity:
79+
podAntiAffinity:
80+
requiredDuringSchedulingIgnoredDuringExecution:
81+
- labelSelector:
82+
matchExpressions:
83+
- key: app.kubernetes.io/component
84+
operator: In
85+
values:
86+
- admission-controller
87+
topologyKey: kubernetes.io/hostname
7988

8089
# List of node taints to tolerate.
8190
tolerations: []
@@ -154,7 +163,16 @@ recommender:
154163
nodeSelector: {}
155164

156165
# Affinity rules for scheduling the Recommender.
157-
affinity: {}
166+
affinity:
167+
podAntiAffinity:
168+
requiredDuringSchedulingIgnoredDuringExecution:
169+
- labelSelector:
170+
matchExpressions:
171+
- key: app.kubernetes.io/component
172+
operator: In
173+
values:
174+
- recommender
175+
topologyKey: kubernetes.io/hostname
158176

159177
# Tolerations for scheduling the Recommender.
160178
tolerations: []
@@ -211,6 +229,33 @@ updater:
211229
labels: {}
212230
# Annotations to add to the Updater service account.
213231
annotations: {}
232+
233+
# Resources for the Updater default container.
234+
resources:
235+
limits:
236+
cpu: 200m
237+
memory: 1000Mi
238+
requests:
239+
cpu: 50m
240+
memory: 500Mi
241+
242+
# Affinity rules for scheduling the Updater.
243+
affinity:
244+
podAntiAffinity:
245+
requiredDuringSchedulingIgnoredDuringExecution:
246+
- labelSelector:
247+
matchExpressions:
248+
- key: app.kubernetes.io/component
249+
operator: In
250+
values:
251+
- updater
252+
topologyKey: kubernetes.io/hostname
253+
254+
# Node selector labels for scheduling the Updater.
255+
nodeSelector: {}
256+
257+
# Tolerations for scheduling the Updater.
258+
tolerations: []
214259

215260
# Leader election configuration for the Updater.
216261
# When running multiple replicas, leader election ensures only one instance is actively processing.

0 commit comments

Comments
 (0)