vertical-pod-autoscaler

by Snowplow

Helm chartv0.1.1App 1.4.1Verified publisher

A Helm Chart to deploy Vertical Pod Autoscaler components

About this chart

vertical-pod-autoscaler

A Helm Chart to deploy Vertical Pod Autoscaler components for automatic resource recommendations and scaling.

TL;DR

helm repo add snowplow-devops https://snowplow-devops.github.io/helm-charts
helm install vertical-pod-autoscaler snowplow-devops/vertical-pod-autoscaler

Introduction

This chart deploys the Kubernetes Vertical Pod Autoscaler (VPA) which automatically adjusts CPU and memory resource requests for containers based on actual usage patterns. VPA helps optimize resource allocation and can improve cluster utilization.

The chart includes three main components:

  • Recommender: Monitors resource usage and generates recommendations
  • Updater: Evicts pods to apply new resource recommendations
  • Admission Controller: Applies recommendations to new pods automatically

Key features:

  • Configurable deployment modes (recommender-only or full VPA)
  • cert-manager integration for secure webhook communication
  • Comprehensive RBAC configuration following Kubernetes VPA standards
  • Flexible resource and scheduling configuration per component

Note: VPA requires a metrics server to be running in your cluster and should not be used alongside Horizontal Pod Autoscaler (HPA) on the same resource dimensions.

Prerequisites

  • Kubernetes cluster with RBAC enabled
  • Metrics Server running in the cluster
  • Cluster admin permissions for RBAC creation
  • For admission controller webhook TLS:
    • Default: Auto-generated self-signed certificates (no additional setup required)
    • Production: cert-manager installed (set vpa.admissionController.certManager.enabled=true)

Installing the Chart

Install or upgrade the chart with default configuration:

helm upgrade --install vertical-pod-autoscaler snowplow-devops/vertical-pod-autoscaler \
  --namespace kube-system

Install in recommender-only mode (recommendations without automatic updates):

helm upgrade --install vertical-pod-autoscaler snowplow-devops/vertical-pod-autoscaler \
  --namespace kube-system \
  --set vpa.updater.enabled=false \
  --set vpa.admissionController.enabled=false

Install with cert-manager for automatic TLS certificate management:

helm upgrade --install vertical-pod-autoscaler snowplow-devops/vertical-pod-autoscaler \
  --namespace kube-system \
  --set vpa.admissionController.certManager.enabled=true \
  --set vpa.admissionController.certManager.issuerName=my-cluster-issuer \
  --set vpa.admissionController.certManager.issuerKind=ClusterIssuer

Uninstalling the Chart

To uninstall/delete the vertical-pod-autoscaler release:

helm delete vertical-pod-autoscaler

Note: ClusterRoles and ClusterRoleBindings will remain and need to be cleaned up manually if desired:

kubectl delete clusterroles,clusterrolebindings -l app.kubernetes.io/name=vertical-pod-autoscaler

Configuration

KeyTypeDefaultDescription
fullnameOverridestring""Overrides the full-name given to the deployment resources
global.labelsobject{}Global labels applied to all resources
imagePullSecretslist[]Image pull secrets for all VPA components
podSecurityContext.runAsGroupint65534Group ID to run containers
podSecurityContext.runAsNonRootbooltrueRun containers as non-root user
podSecurityContext.runAsUserint65534User ID to run containers
priorityClassNamestring""Priority class for VPA pods
rbac.createbooltrueCreate RBAC resources
securityContext.allowPrivilegeEscalationboolfalseAllow privilege escalation
securityContext.capabilities.droplist["ALL"]Capabilities to drop
securityContext.readOnlyRootFilesystembooltrueUse read-only root filesystem
serviceAccount.annotationsobject{}Annotations for ServiceAccount
serviceAccount.createbooltrueCreate ServiceAccount
serviceAccount.namestring""Name of ServiceAccount to use
vpa.admissionController.affinityobject{}Affinity rules for admission controller pods
vpa.admissionController.certManager.enabledboolfalseUse cert-manager to generate certificates (default: auto-generated self-signed certs)
vpa.admissionController.certManager.issuerKindstring"ClusterIssuer"Kind of issuer
vpa.admissionController.certManager.issuerNamestring"letsencrypt"What issuer to use for the Certificate
vpa.admissionController.enabledbooltrueEnable VPA Admission Controller component
vpa.admissionController.extraArgslist[]Additional arguments for admission controller
vpa.admissionController.image.pullPolicystring"IfNotPresent"Image pull policy for the Admission Controller
vpa.admissionController.image.repositorystring"registry.k8s.io/autoscaling/vpa-admission-controller"Image repository for the Admission Controller
vpa.admissionController.image.tagstring""Image tag for the Admission Controller; defaults to .Chart.AppVersion
vpa.admissionController.livenessProbeobject{"failureThreshold":6,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Liveness probe configuration for admission controller
vpa.admissionController.nodeSelectorobject{}Node selector for admission controller pods
vpa.admissionController.readinessProbeobject{"failureThreshold":120,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Readiness probe configuration for admission controller
vpa.admissionController.replicasint1Number of admission controller replicas
vpa.admissionController.resources.limitsobject{}Resource limits for admission controller
vpa.admissionController.resources.requests.cpustring"50m"CPU request for admission controller
vpa.admissionController.resources.requests.memorystring"200Mi"Memory request for admission controller
vpa.admissionController.tolerationslist[]Tolerations for admission controller pods
vpa.recommender.affinityobject{}Affinity rules for recommender pods
vpa.recommender.enabledbooltrueEnable VPA Recommender component
vpa.recommender.extraArgslist[]Additional arguments for recommender
vpa.recommender.image.pullPolicystring"IfNotPresent"Image pull policy for the Recommender
vpa.recommender.image.repositorystring"registry.k8s.io/autoscaling/vpa-recommender"Image repository for the Recommender
vpa.recommender.image.tagstring""Image tag for the Recommender; defaults to .Chart.AppVersion
vpa.recommender.livenessProbeobject{"failureThreshold":6,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Liveness probe configuration for recommender
vpa.recommender.nodeSelectorobject{}Node selector for recommender pods
vpa.recommender.readinessProbeobject{"failureThreshold":120,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Readiness probe configuration for recommender
vpa.recommender.replicasint1Number of recommender replicas
vpa.recommender.resources.limitsobject{}Resource limits for recommender
vpa.recommender.resources.requests.cpustring"50m"CPU request for recommender
vpa.recommender.resources.requests.memorystring"500Mi"Memory request for recommender
vpa.recommender.tolerationslist[]Tolerations for recommender pods
vpa.updater.affinityobject{}Affinity rules for updater pods
vpa.updater.enabledbooltrueEnable VPA Updater component
vpa.updater.extraArgslist[]Additional arguments for updater
vpa.updater.image.pullPolicystring"IfNotPresent"Image pull policy for the Updater
vpa.updater.image.repositorystring"registry.k8s.io/autoscaling/vpa-updater"Image repository for the Updater
vpa.updater.image.tagstring""Image tag for the Updater; defaults to .Chart.AppVersion
vpa.updater.livenessProbeobject{"failureThreshold":6,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Liveness probe configuration for updater
vpa.updater.nodeSelectorobject{}Node selector for updater pods
vpa.updater.readinessProbeobject{"failureThreshold":120,"httpGet":{"path":"/health-check","port":"metrics","scheme":"HTTP"},"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Readiness probe configuration for updater
vpa.updater.replicasint1Number of updater replicas
vpa.updater.resources.limitsobject{}Resource limits for updater
vpa.updater.resources.requests.cpustring"50m"CPU request for updater
vpa.updater.resources.requests.memorystring"500Mi"Memory request for updater
vpa.updater.tolerationslist[]Tolerations for updater pods

Usage

Basic VPA Resource

Create a VPA resource to automatically manage resource requests for a deployment:

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-app-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  updatePolicy:
    updateMode: "Auto"  # Options: Auto, Recreation, Initial, Off

Monitoring

Check VPA recommendations:

kubectl get vpa my-app-vpa -o yaml
kubectl describe vpa my-app-vpa

Check VPA component status:

kubectl get pods -n kube-system -l app.kubernetes.io/name=vertical-pod-autoscaler
kubectl logs -n kube-system -l app.kubernetes.io/component=recommender

Deploy vertical-pod-autoscaler with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has vertical-pod-autoscaler on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvertical-pod-autoscaler is pinned at v0.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply