A node autoscaler for AKS (Azure Container Service)
Use this auto scaler implementation as a Pod inside your k8s cluster to scale your cluster in and out. The auto scaler uses the native aks scale command that should (nothing is certain in life and code) drain your nodes before scaling.
Min / Max nodes and namespace exclusion functionalities are supported.
Either create your own image using the Dockerfile or use the ready Docker image in /kubernetes/autoscaler.yaml.
Fill the following environment variables inside the YAML:
- APP_ID - A Service Principal ID of an AAD app that has contributor permissions for the AKS cluster
- PASSWORD - The password of the AD app
- TENANT_ID - Your Azure subscription's TenantID
- AKS_NAME - The name of the Container Service
- RESOURCE_GROUP - The name of the Resource Group of the AKS cluster (NOT the MC_ Resource Group)
- MAX_NODES (Optional) - The maximum number of nodes to scale up to
- MIN_NODES (Optional) - The minimum number of nodes to scale down to
- EXCLUDED_NAMESPACES (Optional) - A comma seperated string of namespaces to skip for unschedulable pods.
Example:
$ kubectl create -f ./kubernetes/autoscaler.yaml