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 kube-dns or CoreDNS autoscaler. The autoscaler runs as an independant Deployment in the cluster, using the cluster-proportional-autoscaler container to scale up and down the related kube-dns or 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 either the kube-dns or coredns provider (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

Four approaches are provided, depending on the Rancher or RKE version in use.

Note: When making the changes, the coredns-autoscaler or kube-dns-autoscaler` pod will be restarted with updated command arguments, this will not cause any disruption to DNS resolution.

Note: Check the logs of the kube-dns-autoscaler, or coredns-autoscaler pod after making changes to confirm they have taken effect.

A Rancher provisioned cluster managed by Rancher versions after v2.4.x
  1. Navigate to the Cluster within the Rancher UI and click 'Edit Cluster'.
  2. Click 'Edit as YAML'.
  3. Locate or add the dns field, using the below as an example to add the desired parameters below:

    rancher_kubernetes_engine_config:
      [...]
      dns:
        linear_autoscaler_params:
          cores_per_replica: 128
          max: 0
          min: 1
          nodes_per_replica: 4
          prevent_single_point_failure: true
  4. Click 'Save' to update the cluster with the new configuration.

A Rancher provisioned cluster managed by Rancher versions before v2.4.x
  1. Navigate to the Cluster within the Rancher UI and click 'Edit Cluster'.
  2. Click 'Edit as YAML'.
  3. Locate or add the addons field, using the below as an example to add the desired parameters:

    rancher_kubernetes_engine_config:
      [...]
      addons: |-
        apiVersion: v1
        data:
          linear: '{"coresPerReplica":128,"min":1,"nodesPerReplica":4,"preventSinglePointFailure":true}'
        kind: ConfigMap
        metadata:
          name: coredns-autoscaler
          namespace: kube-system
  4. Click 'Save' to update the cluster with the new configuration.

An RKE provisioned cluster managed by RKE versions after v1.1.0
  1. Edit the cluster configuration YAML file to configure the dns field, using the below as an example to add the desired parameters below:

    dns:
      linear_autoscaler_params:
        cores_per_replica: 128
        max: 0
        min: 1
        nodes_per_replica: 4
        prevent_single_point_failure: true
  2. Invoke rke up --config <cluster configuration YAML file> to update the cluster.

An RKE provisioned cluster managed by RKE versions before v1.1.0
  1. Edit the cluster configuration YAML file to configure the ConfigMap addon, using the below as an example to add the desired parameters below:

    addons: |-
      apiVersion: v1
      data:
        linear: '{"coresPerReplica":128,"min":1,"nodesPerReplica":4,"preventSinglePointFailure":true}'
      kind: ConfigMap
      metadata:
        name: coredns-autoscaler
        namespace: kube-system
  2. Invoke rke up --config <cluster configuration YAML file> to update the cluster.

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.

  • Document ID:000020133
  • Creation Date: 06-May-2021
  • Modified Date:06-May-2021
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center