Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kube-startup-cpu-boost

> 云原生
Open source

Kube Startup CPU Boost is a controller that increases CPU resource requests and limits during Kubernetes workload startup time

646 stars0 likes1 views
WebsiteGitHub

About

Kube Startup CPU Boost is a controller that increases CPU resource requests and limits during Kubernetes workload startup time

Kube Startup CPU Boost

Kube Startup CPU Boost is a controller that increases CPU resource requests and limits during a Kubernetes workload's startup time. Once the workload is up and running, the resources are set back to their original values.

Note: This is not an officially supported Google product.


Table of contents

  • Description
  • Installation
  • Usage
  • Features
    • [Boost behavior] container restarts
    • [Boost target] Pod label selector
    • [Boost resources] container matcher
    • [Boost resources] percentage increase
    • [Boost resources] fixed target
    • [Boost duration] fixed time
    • [Boost duration] Pod condition
  • Configuration
  • Metrics
  • Side Effects
  • License

Description

The primary use cases for Kube Startup CPU Boost are workloads that require extra CPU resources during the startup phase — typically JVM-based applications.

Kube Startup CPU Boost leverages the In-place Resource Resize for Kubernetes Pods feature introduced in Kubernetes 1.27. It allows reverting a workload's CPU resource requests and limits back to their original values without the need to recreate the Pods.

The increase in resources is achieved via a Mutating Admission Webhook. When configured, the webhook also removes CPU resource limits if present. The original resource values are restored by the operator after a given period of time or when a Pod condition is met.

[!WARNING] While kube-startup-cpu-boost significantly reduces container cold-start times, dynamically mutating pod resources at runtime can introduce unintended side effects in specific environments. Please read Side Effects for more details.

Installation

Prerequisites

  • Requires Kubernetes 1.33 or newer.
  • For older clusters (>= 1.27), enable the InPlacePodVerticalScaling feature gate.

Install with manifests file

bash
kubectl apply -f https://github.com/google/kube-startup-cpu-boost/releases/download/v0.21.1/manifests.yaml

The Kube Startup CPU Boost components run in the kube-startup-cpu-boost-system namespace.

Install with Kustomize

You can use Kustomize to install Kube Startup CPU Boost with your own kustomization file.

bash
cat  kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/google/kube-startup-cpu-boost?ref=v0.21.1
EOF
kubectl kustomize | kubectl apply -f -

Install with Helm

Helm installation uses the self-hosted Helm chart repo kube-startup-cpu-boost.

bash
helm repo add kube-startup-cpu-boost https://google.github.io/kube-startup-cpu-boost
helm repo update
helm install --create-namespace -n kube-startup-cpu-boost-system kube-startup-cpu-boost kube-startup-cpu-boost/kube-startup-cpu-boost

Installation on a GKE cluster

Ensure that GKE is running version 1.33 or newer by using the GKE Rapid release channel.

bash
gcloud container clusters create poc \
    --release-channel rapid \
    --region europe-central2

Running HA setup

Kube Startup CPU Boost supports multi-replica High Availability (HA) deployments. Running an HA setup requires leader election to be enabled (LEADER_ELECTION=true), which is enabled by default.

Helm

When installing via Helm, you can scale replicas and enable a PodDisruptionBudget to ensure at least one replica remains available during cluster maintenance:

bash
helm install \
  --create-namespace -n kube-startup-cpu-boost-system \
  kube-startup-cpu-boost kube-startup-cpu-boost/kube-startup-cpu-boost \
  --set controllerManager.replicas=2 \
  --set controllerManager.pdb.create=true \
  --set controllerManager.pdb.minAvailable=1

Kustomize

When installing via Kustomize from source (config/default), uncomment the HA component in config/default/kustomization.yaml. This will increase number of replicas and add PodDisruptionBudget.

Usage

  1. Create a StartupCPUBoost object in your workload's namespace

    yaml
    apiVersion: autoscaling.x-k8s.io/v1alpha1
    kind: StartupCPUBoost
    metadata:
      name: boost-001
      namespace: demo
    selector:
      matchExpressions:
      - key: app.kubernetes.io/name
        operator: In
        values: ["spring-demo-app"]
    spec:
      resourcePolicy:
        containerPolicies:
        - matchContainers:
            type: ExactName
            value: spring-rest-jpa
          percentageIncrease:
            value: 50
      durationPolicy:
        podCondition:
          type: Ready
          status: "True"

    The above example will boost the CPU requests and limits of the spring-demo-app container in Pods with the app.kubernetes.io/name=spring-demo-app label in the demo namespace. The resources will be increased by 50% until the Pod Condition Ready becomes True.

  2. Schedule your workloads and observe the results

Features

[Boost behavior] container restarts

Since v0.21.0, the operator can re-apply CPU boosts to existing Pods when their containers restart. This ensures that the boost is applied throughout the entire lifecycle of the workload.

The operator continues watching Pods even after CPU resources have been restored to their original values. Container restarts are detected by observing container status changes and reacting to the terminated state.

[!NOTE] This feature requires the BOOST_ON_RESTART environment variable to be set to true.

[Boost target] Pod label selector

Define the Pods that will be subject to a resource boost with a label selector.

yaml
spec:
  selector:
    matchExpressions:
    - key: app.kubernetes.io/name
       operator: In
       values: ["spring-rest-jpa"]

[Boost resources] container matcher

Define the container(s) that will be subject to a resource boost with a container matcher.

The matcher can be defined with an exact container name or a regex pattern matching a container name using Go syntax.

yaml
spec:
  resourcePolicy:
    containerPolicies:
     - containerName: spring-rest-jpa # legacy container name matcher
       percentageIncrease:
         value: 50
    - matchContainers:
        type: ExactName
        value: spring-rest-jpa
      percentageIncrease:
        value: 50
    - matchContainers:
        type: RegexName
        value: "spring-.+"
      percentageIncrease:
        value: 50

[Boost resources] percentage increase

Define the percentage increase for the target container(s). The CPU requests and limits of the selected container(s) will be increased by the given percentage value.

yaml
spec:
  resourcePolicy:
    containerPolicies:
    - matchContainers:
        type: ExactName
        value: spring-rest-jpa
      percentageIncrease:
        value: 50

[Boost resources] fixed target

Define the fixed resources for the target container(s). The CPU requests and limits of the selected container(s) will be set to the given values. Note that the specified requests and limits must be higher than the container's original values.

yaml
spec:
  resourcePolicy:
    containerPolicies:
     - matchContainers:
         type: ExactName
         value: spring-rest-jpa
       fixedResources:
         requests: "1"
         limits: "2"

[Boost duration] fixed time

Define a fixed duration for which the resource boost will last, measured from the Pod's schedule time.

yaml
spec:
 durationPolicy:
  fixedDuration:
    unit: Seconds
    value: 60

[Boost duration] Pod condition

Define a Pod condition; the resource boost effect will remain active until the condition is met.

yaml
spec:
 durationPolicy:
   podCondition:
     type: Ready
     status: "True" 

Note: You can define multiple duration policies in a single boost (i.e. both podCondition and fixedDuration). When combined, the boost is removed as soon as either condition is met.

Configuration

The Kube Startup CPU Boost operator can be configured with environment variables.

Variable Type Default Description
POD_NAMESPACE string kube-startup-cpu-boost-system Kube Startup CPU Boost operator namespace
MGR_CHECK_INTERVAL int 5 Duration in seconds between boost manager checks for time-based boost duration policies
LEADER_ELECTION bool false Enables leader election for controller manager
METRICS_PROBE_BIND_ADDR string :8080 Address the metrics endpoint binds to
HEALTH_PROBE_BIND_ADDR string :8081 Address the health probe endpoint binds to
SECURE_METRICS bool false Determines if the metrics endpoint is served securely
ZAP_LOG_LEVEL int 0 Log level for ZAP logger
ZAP_DEVELOPMENT bool false Enables development mode for ZAP logger
HTTP2 bool false Determines if the HTTP/2 protocol is used for webhook and metrics servers
REMOVE_LIMITS bool false Enables the operator to remove container CPU limits during the boost period
VALIDATE_FEATURE_ENABLED bool true Enables validation of the required feature gate on operator startup
BOOST_ON_RESTART bool false Enables the boost on container restart feature

Metrics

Kube Startup CPU Boost exposes Prometheus metrics to monitor the health of the system and the status of Startup CPU Boosts.

Metric name Type Description Labels
boost_configurations Gauge Number of registered Kube Startup CPU Boost configurations namespace: the namespace of the Kube Startup CPU Boost
boost_containers_total Counter Number of containers whose CPU resources were increased namespace: the namespace of the container's Pod, boost: the name of the Kube Startup CPU Boost that increased the container's resources
boost_containers_active Gauge Number of containers whose CPU resources have not yet been reverted to their original values namespace: the namespace of the container's Pod, boost: the name of the Kube Startup CPU Boost that increased the container's resources

Scraping: Google Cloud Managed Service for Prometheus

The following PodMonitoring example can be used to scrape Kube Startup CPU Boost metrics with Google Cloud Managed Service for Prometheus.

…

Side Effects

While kube-startup-cpu-boost significantly reduces container cold-start times, dynamically mutating pod resources at runtime can introduce unintended side effects in specific environments.

Runtime ergonomics

Many modern language runtimes, most notably the JVM, are container-aware and inspect Linux cgroups at startup to determine available CPU shares and quotas. JVM uses this data to calculate the ActiveProcessorCount, which governs the size of internal thread pools (e.g., Garbage Collection threads, JIT compiler queues, and application worker poo

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gocpu-boostkuberneteskubernetes-operator

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category云原生
PricingOpen source

> Related tools

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,