Cluster autoscaler on Azure Kubernetes Service

You can enable the cluster autoscaler feature on Azure Kubernetes Service (AKS) to manage the cost of the cluster effectively.

You can use the cluster autoscaler with multiple node pools that are enabled. Depending on your AKS setup, when the nodes are not in use, the nodes of the AKS cluster are automatically shut down to minimize the runtime costs of the AKS cluster without risking the performance of Rational® Test Automation Server.

When you create an AKS cluster, that contains a single node pool as the default node pool. You can use the az aks node pool command to add a node pool to your existing AKS cluster. You can then use the az aks update command to enable and configure the cluster autoscaler on the node pool for the existing AKS cluster.

You can use the following commands to add a node pool and enable the cluster autoscaler on the node pool for the existing AKS cluster:
az aks nodepool add -g <resource_group> -n wrk0 \
  --cluster-name <aks_cluster_name> \
  --kubernetes-version <k8s_version> \
  --node-vm-size Standard_D2ds_v4 \
  --enable-cluster-autoscaler \
  --node-count 1 --min-count 1 --max-count 2 \
  --labels execution=allow \
  --node-taints reserved=reserved:NoSchedule

az aks update \
  -g <resource_group> -n <aks_cluster_name> \
  --cluster-autoscaler-profile scale-down-unneeded-time=1m scale-down-delay-after-add=1m
Note: You must replace <resource_group>, <k8s_version>, and <aks_cluster_name> with the name of the resource group, the version number of Kubernetes, and the name of the AKS cluster in the command.
After you run the commands, you have completed the following actions:
  • Added a user node pool called wrk0

  • Enabled the cluster autoscaler feature

  • Updated the default values of scale-down-unneeded-time and scale-down-delay-after-add in the cluster-wide autoscaler profile to 1m

You can add the following command in Installing the server software on Azure Kubernetes Service when you install the server software to run test assets on the created node pool:
-f rtas-prod/values-dedicated-nodes.yaml

After you install the server software by enabling the cluster autoscaler feature on your AKS cluster, a new container is used only to run test assets. You can run the kubectl get pods command to view the status of the pod, which is displayed as Pending.

When the test asset run is complete, the pod shuts down automatically. Thus, you can reduce the cost of the cluster when the node is not in use. You can then run the kubectl get nodes command to verify the number of nodes that are currently in the Ready state.