---
title: "Cluster Proportional Autoscaler in Kubernetes | Hostman Docs"
description: "Learn how to manage Cluster Proportional Autoscaler on Hostman’s platform. Follow our guides for scalable cloud resource management"
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

Cluster Proportional Autoscaler (CPA) is a controller that automatically scales a specified deployment based on the number of nodes in the cluster. It is especially useful when a service needs to be available on every node or should scale proportionally to the overall cluster resources.

Unlike traditional autoscalers, CPA does not rely on load metrics. Instead, it uses proportional formulas that are manually defined.

## Modes of Operation

CPA supports two modes for calculating the number of replicas:

### Linear Mode

In linear mode, the number of replicas is calculated using the following formula:

```shell
replicas = max(min, min(max, cores / coresPerReplica, nodes / nodesPerReplica))
```

You can use both parameters (coresPerReplica and nodesPerReplica) or just one. The min and max values set the lower and upper limits for the number of replicas.

Example configuration:

```shell
config:
  linear:
    coresPerReplica: 2
    nodesPerReplica: 1
    min: 2
    max: 20
    preventSinglePointFailure: true
    includeUnschedulableNodes: true
```

In this example:

-   One pod is created per node
-   An additional pod is created for every 2 CPU cores
-   Always at least 2 pods, maximum 20
-   If there's only one node, 2 pods will be created to prevent a single point of failure
-   Unschedulable nodes are also taken into account

### Ladder Mode

In ladder mode, the number of replicas is explicitly defined using a lookup table. This is useful when you need an exact number of pods for specific cluster sizes.

Example configuration:

```shell
config:
  ladder:
    coresToReplicas:
      - [ 1, 1 ]
      - [ 64, 3 ]
      - [ 512, 5 ]
      - [ 1024, 7 ]
      - [ 2048, 10 ]
    nodesToReplicas:
      - [ 1, 1 ]
      - [ 2, 2 ]
      - [ 5, 3 ]
```

In this example:

-   With 1 node → 1 pod
-   With 2 nodes → 2 pods
-   With 5 or more nodes → 3 pods
-   CPU cores are also considered in parallel:
    -   64 cores → 3 pods
    -   2048 cores → 10 pods

## Installation via Dashboard

To install Cluster Proportional Autoscaler:

1.  Go to the **Kubernetes** section and click on the cluster.
2.  In the **Addons** tab, click on **Cluster Proportional Autoscaler**.
3.  In the installation wizard, you can adjust the configuration by editing the manifest in the **Configuration** section.

By default, the autoscaler is configured to scale the `metrics-server` in the `kube-system` namespace using linear mode, creating one pod per node:

```shell
config:
  linear:
    coresPerReplica: 1
    nodesPerReplica: 1
    min: 1
    max: 100
    preventSinglePointFailure: true
    includeUnschedulableNodes: true

options:
  logToStdErr: true
  logLevel: 7
  namespace: kube-system
  target: deployment/metrics-server
```

If you want to scale a different service—for example, `nginx` in the `default` namespace—change the `target` and `namespace` parameters before installing.

To switch scaling modes or parameters, edit the `config` section. For instance, you can uncomment the `ladder` parameters and use that mode instead of `linear`.

> [!NOTE]
> When installing via the web UI, only one target resource can be specified using the `target` parameter.
>
> If you want to scale multiple resources—such as both `metrics-server` and `coredns`—you need to use manual installation with multiple autoscaler instances.

## Manual Installation

If you need more flexibility or want to deploy multiple autoscalers for different services, use [Helm](https://hostman.com/docs/kubernetes/helm/) for installation.

**Step 1:** Add the Helm chart repository:

```shell
helm repo add cluster-proportional-autoscaler https://kubernetes-sigs.github.io/cluster-proportional-autoscaler
```

This adds an external source from which the autoscaler can be installed.

**Step 2:** Update chart list:

```shell
helm repo update
```

**Step 3:** Create a `values.yaml` file with the following content:

```shell
config:
  linear:
    coresPerReplica: 1
    nodesPerReplica: 1
    min: 1
    max: 100
    preventSinglePointFailure: true
    includeUnschedulableNodes: true

options:
  logToStdErr: true
  logLevel: 7
  namespace: kube-system
  target: deployment/metrics-server

serviceAccount:
  create: true
```

This configuration:

-   Uses linear mode, creating one pod per node (`nodesPerReplica: 1`)
-   Limits replicas between 1 and 100
-   Enables `preventSinglePointFailure` (adds an extra pod if only one node exists)
-   Includes unschedulable nodes in calculations
-   Specifies the target deployment and namespace
-   Automatically creates a service account with the required permissions

**Step 4:** Install the autoscaler with Helm:

```shell
helm upgrade --install metrics-autoscaler cluster-proportional-autoscaler/cluster-proportional-autoscaler --values values.yaml
```

**Step 5:** Verify the pod is running:

```shell
kubectl get pods -n kube-system
```

## Scaling Multiple Services

With manual installation, you can run multiple independent autoscaler instances for different services.

To do so:

1.  Create a separate `values-nginx.yaml` file
2.  Update the `target` and `namespace` parameters for the deployment (e.g., `nginx` in the `default` namespace)
3.  Install using a different release name:

```shell
helm upgrade --install nginx-autoscaler cluster-proportional-autoscaler/cluster-proportional-autoscaler --values values-nginx.yaml
```

This method allows you to scale any number of services with individual settings.
