Skip to content

Commit e97bbba

Browse files
authored
Merge pull request #8679 from phuhung273/updater-deployment
feat(chart): VPA Updater deployment
2 parents e3dc09c + 5475274 commit e97bbba

File tree

5 files changed

+107
-2
lines changed

5 files changed

+107
-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.4.0
18+
version: 0.5.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: 8 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.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square)
7+
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.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

@@ -93,3 +93,10 @@ The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resou
9393
| recommender.serviceAccount.create | bool | `true` | |
9494
| recommender.serviceAccount.labels | object | `{}` | |
9595
| recommender.tolerations | list | `[]` | |
96+
| updater.enabled | bool | `true` | |
97+
| updater.image.pullPolicy | string | `"IfNotPresent"` | |
98+
| updater.image.repository | string | `"registry.k8s.io/autoscaling/vpa-updater"` | |
99+
| updater.image.tag | string | `nil` | |
100+
| updater.podAnnotations | object | `{}` | |
101+
| updater.podLabels | object | `{}` | |
102+
| updater.replicas | int | `1` | |

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/templates/_helpers.tpl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,29 @@ Create the name of the tls secret to use
7474
{{- end -}}
7575

7676

77+
{{/*
78+
updater
79+
*/}}
80+
{{- define "vertical-pod-autoscaler.updater.fullname" -}}
81+
{{ include "vertical-pod-autoscaler.fullname" . }}-updater
82+
{{- end }}
83+
84+
{{- define "vertical-pod-autoscaler.updater.labels" -}}
85+
{{ include "vertical-pod-autoscaler.labels" . }}
86+
app.kubernetes.io/component: updater
87+
app.kubernetes.io/component-instance: {{ .Release.Name }}-updater
88+
{{- end }}
89+
90+
{{- define "vertical-pod-autoscaler.updater.selectorLabels" -}}
91+
{{ include "vertical-pod-autoscaler.selectorLabels" . }}
92+
app.kubernetes.io/component: updater
93+
{{- end }}
94+
95+
{{- define "vertical-pod-autoscaler.updater.image" -}}
96+
{{- printf "%s:%s" .Values.updater.image.repository (default .Chart.AppVersion .Values.updater.image.tag) }}
97+
{{- end }}
98+
99+
77100
{{/*
78101
Create the name of the namespace to use
79102
*/}}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{- if .Values.updater.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "vertical-pod-autoscaler.updater.fullname" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "vertical-pod-autoscaler.updater.labels" . | nindent 4 }}
9+
spec:
10+
replicas: {{ .Values.updater.replicas }}
11+
selector:
12+
matchLabels:
13+
{{- include "vertical-pod-autoscaler.updater.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "vertical-pod-autoscaler.updater.selectorLabels" . | nindent 8 }}
18+
{{- with .Values.updater.podLabels }}
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
{{- with .Values.updater.podAnnotations }}
22+
annotations:
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
spec:
26+
securityContext:
27+
runAsNonRoot: true
28+
runAsUser: 65534
29+
containers:
30+
- name: updater
31+
image: {{ include "vertical-pod-autoscaler.updater.image" . }}
32+
imagePullPolicy: {{ .Values.updater.image.pullPolicy }}
33+
env:
34+
- name: NAMESPACE
35+
valueFrom:
36+
fieldRef:
37+
fieldPath: metadata.namespace
38+
ports:
39+
- name: prometheus
40+
containerPort: 8943
41+
livenessProbe:
42+
httpGet:
43+
path: /health-check
44+
port: prometheus
45+
scheme: HTTP
46+
initialDelaySeconds: 5
47+
periodSeconds: 10
48+
failureThreshold: 3
49+
readinessProbe:
50+
httpGet:
51+
path: /health-check
52+
port: prometheus
53+
scheme: HTTP
54+
periodSeconds: 10
55+
failureThreshold: 3
56+
{{- end -}}

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,22 @@ recommender:
179179
# IMPORTANT: You can specify either 'minAvailable' or 'maxUnavailable', but not both.
180180
maxUnavailable:
181181
# maxUnavailable: 1
182+
183+
updater:
184+
enabled: true
185+
image:
186+
# Image repository for the Updater default container.
187+
repository: registry.k8s.io/autoscaling/vpa-updater
188+
# Image tag for the Updater default container; this will default to `.Chart.AppVersion` if not set
189+
tag:
190+
# Image pull policy for the Updater default container.
191+
pullPolicy: IfNotPresent
192+
193+
# Number of Updater replicas to create.
194+
replicas: 1
195+
196+
# Labels to add to the Updater pod.
197+
podLabels: {}
198+
199+
# Annotations to add to the Updater pod.
200+
podAnnotations: {}

0 commit comments

Comments
 (0)