How to configure the CoreDNS Autoscaler in a Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x provisioned Kubernetes cluster
This document (000020133) is provided subject to the disclaimer at the end of this document.
Situation
Task
During the life of a cluster, you may need to adjust the scaling parameters for the CoreDNS autoscaler. The autoscaler runs as an independent Deployment in the cluster, using the cluster-proportional-autoscaler container to scale up and down the related CoreDNS Deployment, using a linear or ladder pattern.
Pre-requisites
- A Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x provisioned Kubernetes cluster
- The cluster is configured with the coredns addon (enabled by default)
Note When running rke up
commands, ensure the .rkestate
file for the cluster is present in the working directory as per the documentation here.
Steps
Note: When making the changes, the coredns-autoscaler
pod will be restarted with updated command arguments, this will not cause any disruption to DNS resolution. Check the logs of the coredns-autoscaler
pod after making changes to confirm they have taken effect.
Rancher provisioned cluster managed by Rancher
- Navigate to Cluster Management in the Rancher UI and click 'Edit Config' for the cluster.
- Click 'Edit as YAML'.
- Locate or add the
dns
field, using the below as an example to add the desired parameters below: -
```yaml rancher_kubernetes_engine_config: [...] dns: linear_autoscaler_params: cores_per_replica: 128 max: 5 min: 1 nodes_per_replica: 4 prevent_single_point_failure: true
5. Click 'Save' to update the cluster with the new configuration. #### RKE provisioned cluster managed by RKE 1. Edit the cluster configuration YAML file to configure the `dns` field, using the below as an example to add the desired parameters below: ```yaml dns: linear_autoscaler_params: cores_per_replica: 128 max: 5 min: 1 nodes_per_replica: 4 prevent_single_point_failure: true
-
Invoke
rke up --config <cluster configuration YAML file>
to update the cluster.
Additional Information
RKE documentation: https://rke.docs.rancher.com/upgrades/configuring-strategy#replicas-for-dns-and-monitoring-addons
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.