Skip to content

Commit 630c19b

Browse files
committed
feat(chart): VPA Updater resources, affinity,nodeSelector,tolerations
Signed-off-by: phuhung273 <[email protected]>
1 parent 6177945 commit 630c19b

File tree

4 files changed

+85
-8
lines changed

4 files changed

+85
-8
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: 20 additions & 4 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 | `[]` | |
@@ -65,7 +68,10 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
6568
| imagePullSecrets | list | `[]` | |
6669
| nameOverride | string | `nil` | |
6770
| rbac.create | bool | `true` | |
68-
| recommender.affinity | object | `{}` | |
71+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key | string | `"app.kubernetes.io/component"` | |
72+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator | string | `"In"` | |
73+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] | string | `"recommender"` | |
74+
| recommender.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey | string | `"kubernetes.io/hostname"` | |
6975
| recommender.enabled | bool | `true` | |
7076
| recommender.extraArgs | list | `[]` | |
7177
| recommender.extraEnv | list | `[]` | |
@@ -93,13 +99,23 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
9399
| recommender.serviceAccount.create | bool | `true` | |
94100
| recommender.serviceAccount.labels | object | `{}` | |
95101
| recommender.tolerations | list | `[]` | |
102+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key | string | `"app.kubernetes.io/component"` | |
103+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator | string | `"In"` | |
104+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] | string | `"updater"` | |
105+
| updater.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey | string | `"kubernetes.io/hostname"` | |
96106
| updater.enabled | bool | `true` | |
97107
| updater.image.pullPolicy | string | `"IfNotPresent"` | |
98108
| updater.image.repository | string | `"registry.k8s.io/autoscaling/vpa-updater"` | |
99109
| updater.image.tag | string | `nil` | |
110+
| updater.nodeSelector | object | `{}` | |
100111
| updater.podAnnotations | object | `{}` | |
101112
| updater.podLabels | object | `{}` | |
102-
| updater.replicas | int | `1` | |
113+
| updater.replicas | int | `2` | |
114+
| updater.resources.limits.cpu | string | `"200m"` | |
115+
| updater.resources.limits.memory | string | `"1000Mi"` | |
116+
| updater.resources.requests.cpu | string | `"50m"` | |
117+
| updater.resources.requests.memory | string | `"500Mi"` | |
103118
| updater.serviceAccount.annotations | object | `{}` | |
104119
| updater.serviceAccount.create | bool | `true` | |
105120
| updater.serviceAccount.labels | object | `{}` | |
121+
| 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
@@ -31,6 +31,18 @@ spec:
3131
securityContext:
3232
runAsNonRoot: true
3333
runAsUser: 65534
34+
{{- with .Values.updater.affinity }}
35+
affinity:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.updater.nodeSelector }}
39+
nodeSelector:
40+
{{- toYaml . | nindent 8 }}
41+
{{- end }}
42+
{{- with .Values.updater.tolerations }}
43+
tolerations:
44+
{{- toYaml . | nindent 8 }}
45+
{{- end }}
3446
containers:
3547
- name: updater
3648
image: {{ include "vertical-pod-autoscaler.updater.image" . }}
@@ -58,4 +70,8 @@ spec:
5870
scheme: HTTP
5971
periodSeconds: 10
6072
failureThreshold: 3
73+
{{- with .Values.updater.resources }}
74+
resources:
75+
{{- toYaml . | nindent 12 }}
76+
{{- end }}
6177
{{- end -}}

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

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ admissionController:
6969
nodeSelector: {}
7070

7171
# Affinity for pod assignment.
72-
affinity: {}
72+
affinity:
73+
podAntiAffinity:
74+
requiredDuringSchedulingIgnoredDuringExecution:
75+
- labelSelector:
76+
matchExpressions:
77+
- key: app.kubernetes.io/component
78+
operator: In
79+
values:
80+
- admission-controller
81+
topologyKey: kubernetes.io/hostname
7382

7483
# List of node taints to tolerate.
7584
tolerations: []
@@ -148,7 +157,16 @@ recommender:
148157
nodeSelector: {}
149158

150159
# Affinity rules for scheduling the Recommender.
151-
affinity: {}
160+
affinity:
161+
podAntiAffinity:
162+
requiredDuringSchedulingIgnoredDuringExecution:
163+
- labelSelector:
164+
matchExpressions:
165+
- key: app.kubernetes.io/component
166+
operator: In
167+
values:
168+
- recommender
169+
topologyKey: kubernetes.io/hostname
152170

153171
# Tolerations for scheduling the Recommender.
154172
tolerations: []
@@ -191,7 +209,7 @@ updater:
191209
pullPolicy: IfNotPresent
192210

193211
# Number of Updater replicas to create.
194-
replicas: 1
212+
replicas: 2
195213

196214
# Labels to add to the Updater pod.
197215
podLabels: {}
@@ -205,3 +223,30 @@ updater:
205223
labels: {}
206224
# Annotations to add to the Updater service account.
207225
annotations: {}
226+
227+
# Resources for the Updater default container.
228+
resources:
229+
limits:
230+
cpu: 200m
231+
memory: 1000Mi
232+
requests:
233+
cpu: 50m
234+
memory: 500Mi
235+
236+
# Affinity rules for scheduling the Updater.
237+
affinity:
238+
podAntiAffinity:
239+
requiredDuringSchedulingIgnoredDuringExecution:
240+
- labelSelector:
241+
matchExpressions:
242+
- key: app.kubernetes.io/component
243+
operator: In
244+
values:
245+
- updater
246+
topologyKey: kubernetes.io/hostname
247+
248+
# Node selector labels for scheduling the Updater.
249+
nodeSelector: {}
250+
251+
# Tolerations for scheduling the Updater.
252+
tolerations: []

0 commit comments

Comments
 (0)