tencent cloud

$0 14-Day TrialExperience EdgeOne for acceleration and security protection!

Feedback

Tencent Kubernetes Engine

DNSAutoscaler

Last updated: 2024-02-01 10:17:07

Overview

Add-on Description

DNSAutoscaler is an add-on for DNS horizontal auto scaling. It obtains the number of nodes and cores of a cluster through a Deployment and then automatically scales the number of DNS replicas according to preset scaling policies. Two scaling modes are supported: Linear mode and Ladder mode.

Linear Mode

Sample ConfigMap configuration is as follows:
data:
linear: |-
{
"coresPerReplica": 2,
"nodesPerReplica": 1,
"min": 1,
"max": 100,
"preventSinglePointFailure": true
}
Formula for calculating the number of target replicas: replicas = max(ceil(cores × 1/coresPerReplica) , ceil(nodes × 1/nodesPerReplica))
replicas = min(replicas, max)
replicas = max(replicas, min)

Ladder Mode

Sample ConfigMap configuration is as follows:
data:
ladder: |-
{
"coresToReplicas":
[
[ 1, 1 ],
[ 64, 3 ],
[ 512, 5 ],
[ 1024, 7 ],
[ 2048, 10 ],
[ 4096, 15 ]
],
"nodesToReplicas":
[
[ 1, 1 ],
[ 2, 2 ]
]
}
Calculating the quantity of target replicas: Assume that the above configuration is applied in a cluster with 100 nodes and 400 cores, then: nodesToReplicas = 2 (100>2), coresToReplicas = 3 (64<400<512), the greater value of the two is 3, so replica = 3.

Kubernetes objects deployed in a cluster

Kubernetes Object Name
Requirement
Requested Resource
Namespace
tke-dns-autoscaler
Deployment
20 M CPU and 10 Mi memory per node
kube-system
dns-autoscaler
ConfigMap
-
kube-system
tke-dns-autoscale
ServiceAccount
-
kube-system
tke-dns-autoscaler
ClusterRole
-
kube-system
tke-dns-autoscaler
ClusterRoleBinding
-
kube-system

Limits

The add-on supports only clusters with Kubernetes version 1.8 and later.
The workload of the DNS server in the cluster should be Deployment or CoreDNS.

Notes

During CoreDNS horizontal scaling, some CoreDNS replicas may be unavailable for a period of time. We recommend that you optimize related configurations to maximize the DNS service availability. For more information, see Configuring Smooth Upgrade.

Component Permission Description

Permission Description

The permission of this component is the minimal dependency required for the current feature to operate.

Permission Scenarios

Feature
Involved Object
Involved Operation Permission
Monitoring changes in node resources within the cluster
node
list/watch

Modifying the number of coredns replicas deployed by the deployment
replicationcontrollers/scale, deployments/scale, and replicasets/scale
get/update

Retrieving parameter configurations from the configmap. In the absence of configured parameters, a configmap with default parameters will be created.
configmap
get/create

Permission Definition

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tke-dns-autoscaler
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- replicationcontrollers/scale
verbs:
- get
- update
- apiGroups:
- extensions
- apps
resources:
- deployments/scale
- replicasets/scale
verbs:
- get
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- create

How to Use

1. Log in to the TKE console and select Cluster in the left sidebar.
2. On the Cluster management page, click the ID of the target cluster to go to the cluster details page.
3. In the left sidebar, click Add-on management to go to the Add-on list page.
4. On the Add-on list page, click Create. On the Create add-on page, select DNSAutoscaler. The default scaling configuration of this add-on is as follows:
data:
ladder: |-
{
"coresToReplicas":
[
[ 1, 1 ],
[ 128, 3 ],
[ 512, 4 ]
],
"nodesToReplicas":
[
[ 1, 1 ],
[ 2, 2 ]
]
}
After the add-on is created successfully, you can modify its configuration by modifying configmap/tke-dns-autoscaler under the kube-system namespace. For more information about the configuration, see the official documentation.
5. Click Done.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon