Skip to content

Commit fd01a96

Browse files
committed
feat(chart): VPA affinity config high availability
Signed-off-by: phuhung273 <[email protected]>
1 parent 9eb8013 commit fd01a96

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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,15 +99,18 @@ 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 | `[]` | |
96-
| updater.affinity | object | `{}` | |
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"` | |
97106
| updater.enabled | bool | `true` | |
98107
| updater.image.pullPolicy | string | `"IfNotPresent"` | |
99108
| updater.image.repository | string | `"registry.k8s.io/autoscaling/vpa-updater"` | |
100109
| updater.image.tag | string | `nil` | |
101110
| updater.nodeSelector | object | `{}` | |
102111
| updater.podAnnotations | object | `{}` | |
103112
| updater.podLabels | object | `{}` | |
104-
| updater.replicas | int | `1` | |
113+
| updater.replicas | int | `2` | |
105114
| updater.resources.limits.cpu | string | `"200m"` | |
106115
| updater.resources.limits.memory | string | `"1000Mi"` | |
107116
| updater.resources.requests.cpu | string | `"50m"` | |

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

Lines changed: 31 additions & 4 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: {}
@@ -209,7 +227,16 @@ updater:
209227
memory: 500Mi
210228

211229
# Affinity rules for scheduling the Updater.
212-
affinity: {}
230+
affinity:
231+
podAntiAffinity:
232+
requiredDuringSchedulingIgnoredDuringExecution:
233+
- labelSelector:
234+
matchExpressions:
235+
- key: app.kubernetes.io/component
236+
operator: In
237+
values:
238+
- updater
239+
topologyKey: kubernetes.io/hostname
213240

214241
# Node selector labels for scheduling the Updater.
215242
nodeSelector: {}

0 commit comments

Comments
 (0)