Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for vpa#950

Merged
nightfury1204 merged 1 commit intostagingfrom
vpa
Feb 4, 2026
Merged

Add support for vpa#950
nightfury1204 merged 1 commit intostagingfrom
vpa

Conversation

@nightfury1204
Copy link
Collaborator

@nightfury1204 nightfury1204 commented Feb 4, 2026

What is the feature/update/fix?

Feature: Kubernetes Vertical Pod Autoscaler (VPA) Support

We have added native support for Kubernetes Vertical Pod Autoscaler (VPA) in Convox, enabling automatic right-sizing of CPU and memory resources for your services. VPA monitors your workloads over time, generates resource recommendations based on actual usage patterns, and can automatically apply optimized resource requests and limits to your pods.

This feature is configured through a new vpa block under your service's scale configuration in convox.yml, with granular controls for update behavior, resource boundaries, and recommendation targeting.


Why is this important?

Benefits of Vertical Pod Autoscaler Support:

  • Automatic Resource Right-Sizing - VPA continuously monitors actual resource consumption and adjusts CPU and memory requests to match real workload demands, eliminating manual guesswork
  • Cost Optimization - Prevent over-provisioning by letting VPA recommend and apply resource allocations that reflect actual usage, reducing unnecessary cloud spend
  • Improved Reliability - Avoid out-of-memory kills and CPU throttling by ensuring your services have the resources they actually need based on observed patterns
  • Granular Control - Set minimum and maximum bounds for CPU and memory to keep recommendations within safe operational limits
  • Flexible Targeting - Choose to optimize CPU only, memory only, or both, and control whether VPA adjusts requests only or both requests and limits
  • Safe Update Modes - Select from multiple update strategies to control how and when resource changes are applied to your running pods

This feature is especially valuable for:

  • Services with variable or unpredictable resource usage patterns
  • Teams looking to reduce infrastructure costs without risking performance
  • Workloads where manual resource tuning is time-consuming or impractical
  • Environments running a mix of services with different resource profiles

How to use it?

1. Enable VPA on Your Rack

First, enable the Vertical Pod Autoscaler on your rack by setting the vpa_enable parameter:

convox rack params set vpa_enable=true -r rackName

2. Configure VPA for Your Services

Add the vpa block under the scale configuration for any service in your convox.yml:

environment:
  - PORT=3000
services:
  web:
    build: .
    port: 3000
    scale:
      count: 1
      vpa:
        updateMode: Initial
        minCpu: "100"
        maxCpu: "1000"
        minMem: "128"
        maxMem: "2048"
        cpuOnly: false
        memOnly: false
        updateRequestOnly: false

Configuration Options

Parameter Type Default Description
updateMode string Off Controls how VPA applies recommendations. Options: Off, Initial, Recreate
minCpu string Minimum CPU in millicores (e.g. "100" for 100m)
maxCpu string Maximum CPU in millicores (e.g. "1000" for 1000m)
minMem string Minimum memory in Mi (e.g. "128" for 128Mi)
maxMem string Maximum memory in Mi (e.g. "2048" for 2048Mi)
cpuOnly bool false Only control CPU recommendations
memOnly bool false Only control memory recommendations
updateRequestOnly bool false Only update resource requests, not limits

Update Modes Explained

Mode Behavior
Off VPA generates recommendations but does not apply them automatically. Useful for observation before committing to changes.
Initial VPA applies recommendations only when pods are first created (on deployment or restart). Running pods are not disrupted.
Recreate VPA actively evicts and recreates pods to apply updated recommendations. Provides the most responsive resource optimization.

Important Considerations

  • Recommendation Lead Time - VPA requires time to observe your workload and generate accurate CPU and memory recommendations. Initial recommendations may take several minutes to stabilize.
  • Single Replica Behavior - If your service is running with only one replica, VPA will not evict it to apply updated recommendations. Changes will take effect on the next deployment, restart, or when the replica count is increased above one.
  • Resource Boundaries - Use minCpu, maxCpu, minMem, and maxMem to ensure recommendations stay within acceptable ranges for your application.

Does it have a breaking change?

No breaking changes are introduced with this update.

Existing services without VPA configuration will continue to operate with their current resource settings. VPA must be explicitly enabled at both the rack level and the service level to take effect.


Requirements

This feature requires version 3.23.3 or later for the rack.

Update the Rack: Run convox rack update 3.23.3 -r rackName to update to this version. Note that your rack must already be on at least version 3.22.0 before performing this update.

If you're unfamiliar with v3 rack versioning, we recommend reviewing the documentation on Updating a Rack before applying any updates.

@nightfury1204 nightfury1204 merged commit 557ecb0 into staging Feb 4, 2026
6 of 7 checks passed
@nightfury1204 nightfury1204 deleted the vpa branch February 4, 2026 19:09
@nightfury1204 nightfury1204 mentioned this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments