cluster-proportional-autoscaler ConfigMap directly on the cluster.
How to Configure CoreDNS Autoscaling for DigitalOcean Kubernetes
Validated on 6 Apr 2026 • Last edited on 9 Jun 2026
DigitalOcean Kubernetes (DOKS) is a Kubernetes service with a fully managed control plane, high availability, and autoscaling. DOKS integrates with standard Kubernetes toolchains and DigitalOcean’s load balancers, volumes, CPU and GPU Droplets, API, and CLI.
DigitalOcean Kubernetes (DOKS) includes a Cluster Proportional Autoscaler (CPA) plugin that automatically scales CoreDNS replicas in proportion to your cluster’s size. The plugin uses the number of nodes and CPU cores in your cluster to calculate how many CoreDNS replicas to run, which prevents DNS resolution failures as your workloads grow. CPA scales CoreDNS pods only. To scale the number of nodes in a cluster, see How to Enable Cluster Autoscaler.
By default, DOKS clusters without CPA run two CoreDNS replicas. Because all external DNS queries from the cluster funnel through these replicas, larger clusters can exceed DigitalOcean’s per-source-IP DNS rate limits and experience slow or dropped queries. CPA addresses this by adding more CoreDNS replicas as the cluster scales, distributing DNS traffic across more source IPs.
CPA is enabled by default on new clusters running Kubernetes 1.36 or later. You can view the current configuration, customize scaling parameters, or enable or disable the plugin.
How CPA Scales CoreDNS
CPA uses a linear scaling algorithm. It reads scaling parameters from a ConfigMap named cluster-proportional-autoscaler in the kube-system namespace and recalculates the desired CoreDNS replica count whenever the cluster’s node or core count changes.
The formula is:
replicas = max(ceil(cores / coresPerReplica), ceil(nodes / nodesPerReplica))The default scaling parameters are:
| Parameter | Default | Description |
|---|---|---|
coresPerReplica |
256 | Number of CPU cores per CoreDNS replica |
nodesPerReplica |
16 | Number of nodes per CoreDNS replica |
preventSinglePointFailure |
true | Enforces a minimum of two replicas when there is more than one node |
includeUnschedulableNodes |
true | Counts cordoned or draining nodes toward the total, which keeps replica counts stable during maintenance |
With these defaults, the replica count scales as follows:
| Cluster Size | By Cores (cores / 256) | By Nodes (nodes / 16) | CoreDNS Replicas |
|---|---|---|---|
| 3 nodes, 6 cores | 1 | 1 | 2 (min) |
| 16 nodes, 32 cores | 1 | 1 | 2 (min) |
| 32 nodes, 64 cores | 1 | 2 | 2 |
| 48 nodes, 96 cores | 1 | 3 | 3 |
| 64 nodes, 128 cores | 1 | 4 | 4 |
| 100 nodes, 400 cores | 2 | 7 | 7 |
| 200 nodes, 800 cores | 4 | 13 | 13 |
View the CPA Configuration
To view the current CPA scaling parameters, retrieve the cluster-proportional-autoscaler ConfigMap:
kubectl get configmap cluster-proportional-autoscaler -n kube-system -o yamlThe output looks similar to the following:
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-proportional-autoscaler
namespace: kube-system
data:
linear: |
{
"coresPerReplica": 256,
"nodesPerReplica": 16,
"preventSinglePointFailure": true,
"includeUnschedulableNodes": true
}Customize Scaling Parameters
You can adjust how quickly CPA adds CoreDNS replicas by editing the cluster-proportional-autoscaler ConfigMap. For example, lowering nodesPerReplica adds replicas more quickly as you add nodes.
To edit the ConfigMap, open it with kubectl:
kubectl edit configmap cluster-proportional-autoscaler -n kube-systemUpdate the values in the linear key. The following example adds a CoreDNS replica for every 8 nodes instead of every 16:
data:
linear: |
{
"coresPerReplica": 256,
"nodesPerReplica": 8,
"preventSinglePointFailure": true,
"includeUnschedulableNodes": true
}Save and close the file. CPA applies the new configuration automatically and adjusts the CoreDNS replica count on its next reconciliation cycle.
DOKS preserves your ConfigMap changes and does not overwrite them during reconciliation. New defaults only apply to new clusters or clusters that have not been modified.
Verify CoreDNS Scaling
To check the current number of CoreDNS replicas running in your cluster:
kubectl get deployment coredns -n kube-systemThe output looks similar to the following:
NAME READY UP-TO-DATE AVAILABLE AGE
coredns 3/3 3 3 5dThe READY column shows the number of running replicas out of the desired count.
Enable or Disable the CPA Plugin
You can enable or disable the CPA plugin using doctl, the DigitalOcean API, Godo, or Terraform. Disabling the plugin removes the CPA controller and its associated resources (ConfigMap, ServiceAccount, ClusterRole, and ClusterRoleBinding) from the cluster. CoreDNS retains its current replica count when you disable the plugin and does not scale back down to two replicas. Disabling the plugin deletes the cluster-proportional-autoscaler ConfigMap. If you re-enable the plugin later, DOKS recreates the ConfigMap with default values and any custom scaling parameters you previously set are lost. Re-enabling recalculates the desired replica count based on the current cluster size and adjusts CoreDNS accordingly.
In the API, the plugin is controlled through the coredns_autoscaler object on the Kubernetes cluster resource. Set enabled to true to turn CPA on, or false to turn it off. Omitting the coredns_autoscaler object from a request leaves the plugin’s current state unchanged.
To disable the CPA plugin on an existing cluster:
doctl kubernetes cluster update <your-cluster-id> --enable-coredns-autoscaler=falseTo re-enable the CPA plugin:
doctl kubernetes cluster update <your-cluster-id> --enable-coredns-autoscaler=trueTo disable the CPA plugin on an existing cluster, send a PUT request to https://api.digitalocean.com/v2/kubernetes/clusters/{cluster_id} with a request body similar to the following:
curl --location --request PUT 'https://api.digitalocean.com/v2/kubernetes/clusters/{cluster_id}' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
--data '{
"name": "example-cluster",
"coredns_autoscaler": {
"enabled": false
}
}'To re-enable the CPA plugin, send the same request with "enabled": true.
To disable CPA when creating a new cluster (for example, if you plan to manage CoreDNS replicas manually), send a POST request to https://api.digitalocean.com/v2/kubernetes/clusters with a request body similar to the following:
curl --location 'https://api.digitalocean.com/v2/kubernetes/clusters' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
--data '{
"name": "example-cluster",
"region": "nyc1",
"version": "1.36.1-do.0",
"node_pools": [
{
"size": "s-2vcpu-4gb",
"count": 3,
"name": "worker-pool"
}
],
"coredns_autoscaler": {
"enabled": false
}
}'Go developers can use Godo, the official DigitalOcean V2 API client for Go. To disable the CPA plugin on an existing cluster with Godo, use code similar to the following:
package main
import (
"context"
"fmt"
"os"
"github.com/digitalocean/godo"
)
func main() {
client := godo.NewFromToken("your-digitalocean-token")
cluster, _, err := client.Kubernetes.Update(context.Background(), "your-cluster-id", &godo.KubernetesClusterUpdateRequest{
Name: "example-cluster",
CorednsAutoscaler: &godo.KubernetesCorednsAutoscaler{
Enabled: godo.PtrTo(false),
},
})
if err != nil {
fmt.Printf("Error updating cluster: %s\n", err)
os.Exit(1)
}
isEnabled := *cluster.CorednsAutoscaler.Enabled
fmt.Printf("Cluster update successfully issued with CoreDNS autoscaler enabled=%v\n", isEnabled)
}To disable CPA when creating a new cluster, use code similar to the following:
package main
import (
"context"
"fmt"
"os"
"github.com/digitalocean/godo"
)
func main() {
client := godo.NewFromToken("your-digitalocean-token")
cluster, _, err := client.Kubernetes.Create(context.Background(), &godo.KubernetesClusterCreateRequest{
Name: "example-cluster",
RegionSlug: "nyc1",
VersionSlug: "1.36.1-do.0",
NodePools: []*godo.KubernetesNodePoolCreateRequest{
{
Name: "worker-pool",
Count: 3,
Size: "s-2vcpu-4gb",
},
},
CorednsAutoscaler: &godo.KubernetesCorednsAutoscaler{
Enabled: godo.PtrTo(false),
},
})
if err != nil {
fmt.Printf("Error creating cluster: %s\n", err)
os.Exit(1)
}
isEnabled := *cluster.CorednsAutoscaler.Enabled
fmt.Printf("Cluster creation successfully issued with CoreDNS autoscaler enabled=%v\n", isEnabled)
}To disable the CPA plugin on an existing cluster, add a coredns_autoscaler block to the digitalocean_kubernetes_cluster resource:
resource "digitalocean_kubernetes_cluster" "example" {
name = "example-cluster"
region = "nyc1"
version = "1.36.1-do.0"
node_pool {
name = "worker-pool"
size = "s-2vcpu-4gb"
node_count = 3
}
coredns_autoscaler {
enabled = false
}
}To re-enable the CPA plugin, set enabled = true in the same block.
If you experience CoreDNS issues in your cluster, see How to Troubleshoot CoreDNS Issues in DOKS Clusters. For CoreDNS configuration changes beyond scaling, see How to Customize CoreDNS for Kubernetes Clusters. For more details on the upstream Cluster Proportional Autoscaler, see the cluster-proportional-autoscaler repository and the Kubernetes guide to DNS Horizontal Autoscaling.