Skip to content

Commit 620038b

Browse files
authored
Merge pull request #8542 from omerap12/vpa-chart
Add helm chart for VPA
2 parents 0db699a + 34b3b23 commit 620038b

14 files changed

+515
-0
lines changed

OWNERS_ALIASES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ aliases:
2020
- omerap12
2121
# emeritus:
2222
# - jbartosik 2025-08-09
23+
sig-autoscaling-vpa-helm-chart-approvers:
24+
- adrianmoisey
25+
- omerap12
26+
sig-autoscaling-vpa-helm-chart-reviewers:
27+
- adrianmoisey
28+
- omerap12
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: v2
2+
name: vertical-pod-autoscaler
3+
description: Automatically adjust resources for your workloads
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.5.0"
25+
26+
icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png
27+
28+
maintainers:
29+
30+
name: adrianmoisey
31+
32+
name: omerap12
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
approvers:
2+
- sig-autoscaling-vpa-helm-chart-approvers
3+
reviewers:
4+
- sig-autoscaling-vpa-helm-chart-reviewers
5+
labels:
6+
- area/helm-charts-vertical-pod-autoscaler
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# vertical-pod-autoscaler
2+
3+
WARNING: This chart is currently under development and is not ready for production use.
4+
5+
Automatically adjust resources for your workloads
6+
7+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square)
8+
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
9+
![AppVersion: 1.5.0](https://img.shields.io/badge/AppVersion-1.5.0-informational?style=flat-square)
10+
11+
## Introduction
12+
The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resource requests of pods to match their actual resource utilization.
13+
14+
## Maintainers
15+
16+
| Name | Email | Url |
17+
| ---- | ------ | --- |
18+
| adrianmoisey | [email protected] | |
19+
| omerap12 | [email protected] | |
20+
21+
## Values
22+
23+
| Key | Type | Default | Description |
24+
|-----|------|---------|-------------|
25+
| admissionController.enabled | bool | `true` | |
26+
| admissionController.extraArgs | list | `[]` | |
27+
| admissionController.extraEnv | list | `[]` | |
28+
| admissionController.image.pullPolicy | string | `"IfNotPresent"` | |
29+
| admissionController.image.repository | string | `"registry.k8s.io/autoscaling/vpa-admission-controller"` | |
30+
| admissionController.image.tag | string | `nil` | |
31+
| admissionController.nodeSelector | object | `{}` | |
32+
| admissionController.podAnnotations | object | `{}` | |
33+
| admissionController.podLabels | object | `{}` | |
34+
| admissionController.replicas | int | `1` | |
35+
| admissionController.resources.limits.cpu | string | `"200m"` | |
36+
| admissionController.resources.limits.memory | string | `"500Mi"` | |
37+
| admissionController.resources.requests.cpu | string | `"50m"` | |
38+
| admissionController.resources.requests.memory | string | `"200Mi"` | |
39+
| admissionController.service.annotations | object | `{}` | |
40+
| admissionController.service.name | string | `"vpa-webhook"` | |
41+
| admissionController.service.ports[0].port | int | `443` | |
42+
| admissionController.service.ports[0].protocol | string | `"TCP"` | |
43+
| admissionController.service.ports[0].targetPort | int | `8000` | |
44+
| admissionController.serviceAccount.annotations | object | `{}` | |
45+
| admissionController.serviceAccount.create | bool | `true` | |
46+
| admissionController.serviceAccount.labels | object | `{}` | |
47+
| admissionController.tls.caCert | string | `""` | |
48+
| admissionController.tls.cert | string | `""` | |
49+
| admissionController.tls.existingSecret | string | `""` | |
50+
| admissionController.tls.key | string | `""` | |
51+
| admissionController.tls.secretName | string | `"vpa-tls-certs"` | |
52+
| admissionController.volumeMounts[0].mountPath | string | `"/etc/tls-certs"` | |
53+
| admissionController.volumeMounts[0].name | string | `"tls-certs"` | |
54+
| admissionController.volumeMounts[0].readOnly | bool | `true` | |
55+
| admissionController.volumes[0].name | string | `"tls-certs"` | |
56+
| admissionController.volumes[0].secret.defaultMode | int | `420` | |
57+
| admissionController.volumes[0].secret.secretName | string | `"vpa-tls-certs"` | |
58+
| commonLabels | object | `{}` | |
59+
| fullnameOverride | string | `nil` | |
60+
| imagePullSecrets | list | `[]` | |
61+
| nameOverride | string | `nil` | |
62+
| rbac.create | bool | `true` | |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{ template "chart.header" . }}
2+
3+
WARNING: This chart is currently under development and is not ready for production use.
4+
5+
{{ template "chart.description" . }}
6+
7+
{{ template "chart.versionBadge" . }}
8+
{{ template "chart.typeBadge" . }}
9+
{{ template "chart.appVersionBadge" . }}
10+
11+
## Introduction
12+
The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory resource requests of pods to match their actual resource utilization.
13+
14+
{{ template "chart.maintainersSection" . }}
15+
16+
{{ template "chart.requirementsSection" . }}
17+
18+
{{ template "chart.valuesSection" . }}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{{/*
2+
Chart
3+
*/}}
4+
{{- define "vertical-pod-autoscaler.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{- define "vertical-pod-autoscaler.fullname" -}}
9+
{{- if .Values.fullnameOverride }}
10+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
11+
{{- else }}
12+
{{- $name := default .Chart.Name .Values.nameOverride }}
13+
{{- if contains $name .Release.Name }}
14+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
15+
{{- else }}
16+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
17+
{{- end }}
18+
{{- end }}
19+
{{- end }}
20+
21+
{{- define "vertical-pod-autoscaler.chart" -}}
22+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
23+
{{- end }}
24+
25+
{{- define "vertical-pod-autoscaler.labels" -}}
26+
helm.sh/chart: {{ include "vertical-pod-autoscaler.chart" . }}
27+
{{ include "vertical-pod-autoscaler.selectorLabels" . }}
28+
{{- if .Chart.AppVersion }}
29+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
30+
{{- end }}
31+
app.kubernetes.io/managed-by: {{ .Release.Service }}
32+
{{- with .Values.commonLabels }}
33+
{{ toYaml . }}
34+
{{- end }}
35+
{{- end }}
36+
37+
{{- define "vertical-pod-autoscaler.selectorLabels" -}}
38+
app.kubernetes.io/name: {{ include "vertical-pod-autoscaler.name" . }}
39+
app.kubernetes.io/instance: {{ .Release.Name }}
40+
{{- end }}
41+
42+
43+
{{/*
44+
admissionController
45+
*/}}
46+
{{- define "vertical-pod-autoscaler.admissionController.fullname" -}}
47+
{{ include "vertical-pod-autoscaler.fullname" . }}-admission-controller
48+
{{- end }}
49+
50+
{{- define "vertical-pod-autoscaler.admissionController.labels" -}}
51+
{{ include "vertical-pod-autoscaler.labels" . }}
52+
app.kubernetes.io/component: admission-controller
53+
app.kubernetes.io/component-instance: {{ .Release.Name }}-admission-controller
54+
{{- end }}
55+
56+
{{- define "vertical-pod-autoscaler.admissionController.selectorLabels" -}}
57+
{{ include "vertical-pod-autoscaler.selectorLabels" . }}
58+
app.kubernetes.io/component: admission-controller
59+
{{- end }}
60+
61+
{{- define "vertical-pod-autoscaler.admissionController.image" -}}
62+
{{- printf "%s:%s" .Values.admissionController.image.repository (default .Chart.AppVersion .Values.admissionController.image.tag) }}
63+
{{- end }}
64+
65+
{{/*
66+
Create the name of the tls secret to use
67+
*/}}
68+
{{- define "vertical-pod-autoscaler.admissionController.tls.secretName" -}}
69+
{{- if .Values.admissionController.tls.existingSecret -}}
70+
{{ .Values.admissionController.tls.existingSecret }}
71+
{{- else -}}
72+
{{- printf "%s-%s" (include "vertical-pod-autoscaler.admissionController.fullname" .) "tls" | trunc 63 | trimSuffix "-" -}}
73+
{{- end -}}
74+
{{- end -}}
75+
76+
77+
{{/*
78+
Create the name of the namespace to use
79+
*/}}
80+
{{- define "common.names.namespace" -}}
81+
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
82+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if and (.Values.admissionController.enabled) .Values.admissionController.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "vertical-pod-autoscaler.admissionController.labels" . | nindent 4 }}
9+
{{- with .Values.admissionController.serviceAccount.labels }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- with .Values.admissionController.serviceAccount.annotations }}
13+
annotations:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
16+
{{- end -}}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{- if and (.Values.admissionController.enabled) .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
6+
labels:
7+
{{- include "vertical-pod-autoscaler.admissionController.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups:
10+
- ""
11+
resources:
12+
- pods
13+
- configmaps
14+
- nodes
15+
- limitranges
16+
verbs:
17+
- get
18+
- list
19+
- watch
20+
- apiGroups:
21+
- admissionregistration.k8s.io
22+
resources:
23+
- mutatingwebhookconfigurations
24+
verbs:
25+
- list
26+
- get
27+
- apiGroups:
28+
- autoscaling.k8s.io
29+
resources:
30+
- verticalpodautoscalers
31+
verbs:
32+
- get
33+
- list
34+
- watch
35+
- apiGroups:
36+
- coordination.k8s.io
37+
resources:
38+
- leases
39+
verbs:
40+
- create
41+
- update
42+
- get
43+
- list
44+
- watch
45+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if and (.Values.admissionController.enabled) .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
6+
labels:
7+
{{- include "vertical-pod-autoscaler.admissionController.labels" . | nindent 4 }}
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: ClusterRole
11+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ include "vertical-pod-autoscaler.admissionController.fullname" . }}
15+
namespace: {{ .Release.Namespace }}
16+
{{- end -}}

0 commit comments

Comments
 (0)