Skip to content

Autoscaling

NKS supports automatic worker node scaling powered by Karpenter. When autoscaling is enabled, the cluster provisions new nodes when pods are pending due to insufficient resources and removes nodes when they become underutilized — optimizing both performance and cost without manual intervention.

Karpenter is an open-source, Kubernetes-native node autoscaler originally developed by AWS and now a CNCF project. Unlike the traditional Kubernetes Cluster Autoscaler, which scales predefined node groups, Karpenter observes pending pods directly and provisions right-sized nodes to fit their actual resource requirements.

Karpenter integrates with cloud providers through a provider plugin. For NKS, we maintain the karpenter-provider-nirvana provider, which lets Karpenter provision and deprovision Nirvana Cloud VMs as Kubernetes worker nodes.

  • Turnkey — Karpenter, the Nirvana provider, and the default NodePool and NodeClass resources are installed and managed by Nirvana. There’s nothing to configure — flip it on and it works.
  • Workload-aware provisioning — Karpenter inspects pending pods and launches nodes that match their CPU, memory, and other resource requirements, instead of scaling fixed-size pools.
  • Faster scale-up — Nodes are provisioned directly in response to pending pods, reducing the time workloads spend waiting for capacity.
  • Efficient bin packing — Karpenter consolidates workloads onto fewer, better-utilized nodes and removes underutilized ones, lowering compute cost.
  • Less operational overhead — No need to predict capacity or hand-tune node pool sizes for changing workloads.

Autoscaling is configured at the cluster level. To enable it, set the autoscaling field to true when creating or updating an NKS cluster.

{
"name": "production-cluster",
"region": "us-sva-2",
"autoscaling": true
}
resource "nirvana_nks_cluster" "production" {
name = "production-cluster"
region = "us-sva-2"
autoscaling = true
}

When using the terraform-nirvana-nks module, pass autoscaling = true as a module input.

That’s it. Nirvana installs and manages Karpenter, the Nirvana provider, and the underlying NodePool and NodeClass resources for you. As soon as autoscaling is enabled, the cluster starts reconciling pending pods and adjusting capacity automatically — no CRDs to author, no Helm charts to install.

  1. A workload is scheduled, but no existing node has capacity for its pods.
  2. Karpenter evaluates the pending pods’ requirements (CPU, memory, taints, tolerations, node selectors).
  3. The Nirvana provider provisions a new Nirvana Cloud VM that fits those requirements and joins it to the cluster.
  4. When nodes become idle or underutilized, Karpenter drains and removes them to reclaim cost.