You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Workload FAQs
How do I update the CoreDNS replica count and resource quotas?
Copy page
Download PDF
How do I update the CoreDNS replica count and resource quotas?
Issue description​
In a VKE cluster, CoreDNS is installed by default as the domain resolution service of the cluster. When the cluster has a large number of nodes or experiences high DNS query pressure, you need to adjust the CoreDNS replica count, CPU/memory limits, or CPU/memory requests. This topic describes how to perform these operations.​
Cause analysis​
​
Scenario​
Reason for adjustment​
Adjust the number of replicas​
The cluster has a large number of nodes. A single CoreDNS instance cannot handle the DNS query load, resulting in a performance bottleneck.​
Adjust resource limits​
The default resource configuration cannot meet the current cluster DNS query load, resulting in an OOM or CPU resource shortage error.​
​
Solution​
In VKE, CoreDNS is deployed as a system component in the kube-system namespace as a ‌Deployment‌. You can directly modify its configuration to adjust the ‌replica count‌ and ‌resource limits‌.​
Method 1: Using the console (recommended)​
  1. Log in to the VKE console and select the target cluster.​
  1. In the left navigation pane, click Workload > Deployment.​
  1. Select the kube-system namespace and search for coredns. In the Actions column on the right, click ...> Update.​
  1. On the Update Deployment page, modify the following parameters. For more information, see Workload configuration.​
  • Basic information​
  • Number of instances: Adjust the number of instances to the desired value.​
  • Container configuration​
  • ResourceQuota: Modify the CPU and memory requests and limits as needed.​
  1. After you confirm the configuration, click Confirm to save the changes.​
  • After the changes are saved, the system will automatically perform a rolling update of the corresponding CoreDNS Pod. You can view the Pod status on the Instances tab on the Deployment details page. The Running state indicates that the configuration changes have taken effect.​
Method 2: Using kubectl​
If you prefer using the command line, follow these steps:​
  1. Connect to the cluster via kubectl. For details, see Connecting to a cluster.​
  1. View the current CoreDNS configuration in the cluster.​
  • ​
    # Check the current CoreDNS replica count​
    kubectl get deployment -n kube-system coredns​
    ​
    # Check the current resource configuration​
    kubectl get deployment -n kube-system coredns -o yaml | grep -A 10 resources​
    ​
  1. Modify the CoreDNS configuration.​
  • Modify the CoreDNS replica count:​
  • ​
    # Change the replica count to 2 (adjust it as needed in your actual scenarios)​
    kubectl scale deployment coredns -n kube-system --replicas=2​
    ​
  • Modify CoreDNS requests or limits:​
  • ​
    Use the edit command (recommended)
    Use the patch command
    ​
    1. Run the following command to edit the CoreDNS configuration.​
    • ​
      kubectl edit deployment coredns -n kube-system​
      ​
    1. In the editor, find the spec.template.spec.containers[0].resources section and change the value of limits.​
    • ​
      resources:​
      requests:​
      cpu: 100m​
      memory: 128Mi​
      limits:​
      cpu: 250m # Change to the desired value.​
      memory: 256Mi # Change to the desired value.​
      ​
    ​
  1. Verify the changes.​
  • ​
    # Check whether the replica count has been updated.​
    kubectl get pods -n kube-system -l k8s-app=kube-dns​
    ​
    # Check whether the resource configuration has been updated.​
    kubectl get pod -n kube-system -l k8s-app=kube-dns -o jsonpath='{.items[0].spec.containers[0].resources}' && echo​
    ​
Recommended configuration​
The recommended CoreDNS configuration varies with cluster node count, as described below.​
warning​
The following recommended settings are for reference only. You need to adjust your configuration based on the actual number of DNS queries. If the cluster has the node-local-dns component enabled, the pressure on CoreDNS will be greatly reduced, and the number of replicas can be appropriately decreased. For more details, see How do I check whether the node-local-dns component is being used and Using NodeLocal DNSCache as a DNS caching agent.​
​
Cluster node count​
Recommended replica count​
Recommended limits​
1 to 10 nodes​
2 replicas​
  • CPU: 250 millicores​
  • Memory: 256 MiB​
10 to 50 nodes​
4 replicas​
  • CPU: 500 millicores​
  • Memory: 512 MiB​
50 to 100 nodes​
6 to 8 replicas​
  • CPU: 1 core​
  • Memory: 1 GiB​
100 nodes or more​
8 replicas or more​
  • CPU: 2 cores or more​
  • Memory: 2 GiB or more​
​
​
Last updated: 2026.07.23 14:31:47