How to update autoscale configuration in Kubernetes?
What is autoscale in Kubernetes?
Let’s understand autoscaling with an example. If you have a web application and during specific time you got lot’s of viewer and the rest of the day viewers are less. In order to serve the traffic load better you need more resources. Autoscaling providing you a feature to adjust load dynamically. You can define the number of minimum and maximum pods in Kubernetes cluster to serve the load.
Prerequisites: deployment configuration
How to update autoscale configuration in Kubernetes?
1. List all autoscale configuration
kubectl get hpa
2. Delete autoscale configuration. In my case I would like update the autoscale configuration for nginx-deployment
kubectl delete hpa nginx-deployment
3. Create autoscale configuration
kubectl autoscale -f nginx-deployment.yaml –min=1 –max=5
Reference:
https://kubernetes.io/blog/2016/07/autoscaling-in-kubernetes/