DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Autoscale
AKS autoscale setup and test

Setup the cluster

Enable AZ CLI preview.
1
az extension add --name aks-preview
Copied!
Set your subscription.
1
az account set --subscription "MY-SUBSCRIPTION"
Copied!
Create a Resource Group.
1
az group create \
2
--location brazilsouth \
3
--name my-test-autoscale \
4
--subscription "MY-SUBSCRIPTION"
Copied!
Create the cluster.
1
az aks create \
2
--name my-test-autoscale \
3
--resource-group my-test-autoscale \
4
--dns-name-prefix my-test-autoscale \
5
--dns-service-ip 10.0.0.10 \
6
--docker-bridge-address 172.17.0.1/16 \
7
--kubernetes-version 1.14.8 \
8
--location brazilsouth \
9
--network-plugin kubenet \
10
--node-count 3 \
11
--node-osdisk-size 128 \
12
--node-vm-size Standard_D4s_v3 \
13
--pod-cidr 10.244.0.0/16 \
14
--service-cidr 10.0.0.0/16 \
15
--subscription "MY-SUBSCRIPTION" \
16
--enable-cluster-autoscaler \
17
--max-count 5 \
18
--min-count 3
Copied!

Stress test

Create a few deployments.
1
for i in {1..3};
2
do
3
kubectl run \
4
resource-consumer-$i \
5
--image=gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4 \
6
--expose \
7
--service-overrides='{ "spec": { "type": "LoadBalancer" } }' --port 8080
8
done
Copied!
Scale the deployments.
1
for i in {1..3};
2
do
3
4
kubectl scale deployment --replicas=200 resource-consumer-$i
5
6
done
Copied!
Get the public IPs.
1
for i in {1..3};
2
do
3
4
kubectl get services resource-consumer-$i
5
6
done
Copied!
Trigger resource usage.
1
for i in {1..100};
2
do
3
4
curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-01:8080/ConsumeCPU;
5
curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-02:8080/ConsumeCPU;
6
curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-03:8080/ConsumeCPU;
7
8
done
Copied!

References

Debug and troubleshoot

Log Analytics

Create a Log Analytics Workspace .
Add Diagnostic Settings on your AKS Resource Group (not the MC_...)
Go to logs and query.
1
AzureDiagnostics
2
| where Category == "cluster-autoscaler"
Copied!

References

Configmap

Check out autoscaler configmap.
1
kubectl get configmap -n kube-system cluster-autoscaler-status -o yaml
Copied!

Troubleshoot