Files
oam/knowledge base/kubernetes/cluster autoscaler.md
2024-07-24 18:06:11 +02:00

1.7 KiB

Cluster autoscaler

Automatically adjusts the number of nodes in Kubernetes clusters.

  1. TL;DR
  2. Further readings
    1. Sources

TL;DR

Acts when one of the following conditions is true:

  • Pods failed to run in the cluster due to insufficient resources.
  • Nodes in the cluster have been underutilized for an extended period of time, and their pods can be placed on other existing nodes.
Setup
helm repo add 'autoscaler' 'https://kubernetes.github.io/autoscaler'
helm show values 'autoscaler/cluster-autoscaler'

helm install 'cluster-autoscaler' 'autoscaler/cluster-autoscaler' --set 'autoDiscovery.clusterName'=clusterName
helm --namespace 'kube-system' upgrade --install 'cluster-autoscaler' 'autoscaler/cluster-autoscaler' \
  --set 'autoDiscovery.clusterName'=clusterName

helm uninstall 'cluster-autoscaler'
helm --namespace 'kube-system' uninstall 'cluster-autoscaler'
Real world use cases
helm --namespace 'kube-system' upgrade --install 'cluster-autoscaler' 'autoscaler/cluster-autoscaler' \
  --set 'cloudProvider'='aws' --set 'awsRegion'='eu-west-1' \
  --set 'autoDiscovery.clusterName'='defaultCluster' --set 'rbac.serviceAccount.name'='cluster-autoscaler-aws'

Further readings

Sources