You need to create a Linode token to access the API:
linode-cli profile token-create
export LINODE_TOKEN=<insert the token here># Create the cluster
terraform -chdir=01-clusters init
terraform -chdir=01-clusters apply -auto-approve
# Cleanup
terraform -chdir=01-clusters destroy -auto-approveMake sure that your kubectl is configured with the current kubeconfig file:
export KUBECONFIG="${PWD}/kubeconfig"Deploy podinfo:
kubectl apply -f 03-demo/01-stress.yamlDeploy the descheduler with:
kubectl apply -f 03-demo/02-descheduler.yamlkubectl proxy --www=./dashboard &
open "http://localhost:8001/static/"kubectl apply -f 03-demo/03-restart.yamlFirst cordon one of the nodes:
kubectl get nodes
kubectl cordon <node name>Then evict the pods
kubectl drain <node name>Scale the deployment to 3 replicas:
kubectl scale --replicas=3 deployment/appConfirm that the three replicas are running only in two nodes:
kubectl get pods -o wideApply the duplicate policy:
kubectl apply -f 03-demo/04-duplicates.yamlFinally, uncordon the node and observe the descheduler deleting the pod:
kubectl uncordon <node name>Apply the low utilization policy:
kubectl apply -f 03-demo/05-usage.yamlCordon one of the nodes:
kubectl get nodes
kubectl cordon <node name>Then evict the pods
kubectl drain <node name>Scale the deployment to 12 replicas:
kubectl scale --replicas=12 deployment/appConfirm that the three replicas are running only in two nodes:
kubectl get pods -o wideFinally, uncordon the node and observe the descheduler rebalancing the pods:
kubectl uncordon <node name>