DevOps Buzz
  • Initial page
  • About me
  • Ansible
    • Cheat Sheet
    • Dynamic inventory
  • AKS
    • Cheat Sheet
    • Autoscale
    • Backup
    • Dashboard
    • Ingress
    • Node management
    • News
    • Persistent Volumes
  • Arch Linux
    • Docker
    • Install
    • Network
    • VirtualBox guest
  • Azure
    • API
    • CLI/Powershell
    • DevOps
      • Cheat Sheet
    • Application Gateway
    • Tools
    • Sops
  • AWS
    • Cheat Sheet
    • Tools
    • Cognito with Amplify and React
  • Bash / Shell
    • Cheat Sheet
    • Tools
  • Bitbucket
    • Cheat Sheet
  • CSS
    • Cheat Sheet
  • Distros
    • Manjaro
  • Docker
    • Cheat Sheet
    • ELK
    • Ubuntu NoVNC
    • Tools
    • Known errors and solutions
  • Elasticsearch
    • Cheat Sheet
    • Tools
  • ELK
    • Cheat Sheet
  • emacs
    • Cheat sheet
  • Gatekeeper (OPA)
    • Cheat Sheet
    • Developer Quick Start
  • GCP
    • Cheat Sheet
  • General
    • Tools
    • News
  • Git
    • Cheat Sheet
    • Tools
  • Golang
    • Cheat Sheet
  • Guidelines / Standards
    • Cheat Sheet
  • i3wm
    • Cheat Sheet
  • Ipsec
    • Cheat sheet
  • Istio
    • Cheat Sheet
  • Kind
    • Cheat Sheet
  • Kops
    • Cheat Sheet
  • Kubeadm
    • Cheat Sheet
    • Change serviceSubnet CIDR
    • Setup cluster
      • Azure
      • Bare-metal
      • Vagrant + VirtualBox
    • Multi master
    • Known errors and solutions
  • Kubernetes
    • Kubectl Cheat Sheet
    • etcd Cheat Sheet
    • Tools
    • News
    • Deployments
      • Deployment examples
      • Blue/Green Deployment
      • Canary Deployment
    • Dashboard
    • ELK
    • Helm
    • Ingress
    • logz.io
    • Minikube
    • Monitoring
    • Node Management
    • Operators
    • Security
    • Volumes
    • Networking
    • kube-controller-manager
      • Node crash recovery
    • Known errors and solutions
  • Lumen
    • Cheat Sheet
  • MACOS
    • Cheat Sheet
    • Qemu
    • Zsh
  • microk8s
    • Cheat Sheet
  • MongoDB
    • Cheat Sheet
    • Tools
  • MySQL
    • Cheat Sheet
  • Network
    • Tools
    • WDS - Wireless Distribution System
    • Expose server under NAT
  • nvim
    • Cheat Sheet
  • Openvpn
    • OpenVPN server on Ubuntu 18.06
    • Stunnel
  • PHP
    • Composer
  • Prometheus
    • Tools
  • Python
    • Cheat Sheet
    • Pydantic
    • Tools / Modules
    • Virtualenv
  • RabbitMQ
    • Cheat Sheet
  • ReactJS
    • Fixes
    • For beginners
  • Ruby
    • Cheat Sheet
    • Rails
    • rvm
  • Rundeck
    • Cheat Sheet
  • Rust
    • Cheat Sheet
  • Squid
    • Setup server
    • Expose NAT server
  • SRE
    • Cheat Sheet
  • SSH
    • Passwordless auth with RSA key
    • Reverse tunnel
    • Cheat Sheet
  • SSL
    • Cheat Sheet
    • certbot
  • STACK SETUP
    • Using EKS and Gitlab CI to deploy applications
  • Terraform
    • Cheat Sheet
    • Tools
  • Tmux
    • Cheat Sheet
  • Tor
    • Cheat Sheet
  • Ubuntu
    • Cheat Sheet
  • Vagrant
    • Cheat Sheet
  • VirtualBox
    • Cheat Sheet
  • Windows
    • Windows Docker
    • Fingerprint
    • SSH Client
    • Tools
    • VirtualBox
    • WSL
Powered by GitBook
On this page
  • Setup the cluster
  • Stress test
  • References
  • Debug and troubleshoot
  • Log Analytics
  • Configmap
  • Troubleshoot
  1. AKS

Autoscale

AKS autoscale setup and test

Setup the cluster

Enable AZ CLI preview.

az extension add --name aks-preview

Set your subscription.

az account set --subscription "MY-SUBSCRIPTION"

Create a Resource Group.

az group create \
  --location brazilsouth \
  --name my-test-autoscale \
  --subscription "MY-SUBSCRIPTION"

Create the cluster.

az aks create \
  --name my-test-autoscale \
  --resource-group my-test-autoscale \
  --dns-name-prefix my-test-autoscale \
  --dns-service-ip 10.0.0.10 \
  --docker-bridge-address 172.17.0.1/16 \
  --kubernetes-version 1.14.8 \
  --location brazilsouth \
  --network-plugin kubenet \
  --node-count 3 \
  --node-osdisk-size 128 \
  --node-vm-size Standard_D4s_v3 \
  --pod-cidr 10.244.0.0/16 \
  --service-cidr 10.0.0.0/16 \
  --subscription "MY-SUBSCRIPTION" \
  --enable-cluster-autoscaler \
  --max-count 5 \
  --min-count 3

Stress test

Create a few deployments.

for i in {1..3};
do
kubectl run \
  resource-consumer-$i \
  --image=gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4 \
  --expose \
  --service-overrides='{ "spec": { "type": "LoadBalancer" } }' --port 8080
done

Scale the deployments.

for i in {1..3};
do

kubectl scale deployment --replicas=200 resource-consumer-$i

done

Get the public IPs.

for i in {1..3};
do

kubectl get services resource-consumer-$i

done

Trigger resource usage.

for i in {1..100};
do

curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-01:8080/ConsumeCPU;
curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-02:8080/ConsumeCPU;
curl --data "millicores=4000&durationSec=3600" http://IP.OF.SERVICE-03:8080/ConsumeCPU;

done

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.

AzureDiagnostics
| where Category == "cluster-autoscaler"

References

Configmap

Check out autoscaler configmap.

kubectl get configmap -n kube-system cluster-autoscaler-status -o yaml

Troubleshoot

PreviousCheat SheetNextBackup

Last updated 4 years ago

https://github.com/kubernetes/kubernetes/tree/master/test/images/resource-consumer
https://docs.microsoft.com/en-us/azure/aks/view-master-logs#enable-diagnostics-logs
https://docs.microsoft.com/en-us/azure/aks/cluster-autoscaler#retrieve-cluster-autoscaler-logs-and-status
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#ca-doesnt-work-but-it-used-to-work-yesterday-why