git clone https://github.com/kubernetes-sigs/metrics-server
cd metrics-server
#Edit metrics-server-deployment.yaml
vi deploy/kubernetes/metrics-server-deployment.yaml
#And add below args
args:
- --kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP
- --kubelet-insecure-tls
metrics-server-deployment.yaml will look like below
2. After deployment we will get the cpu and ram usage of node as below
3.Now we can write Horizontal Pod Autoscaler as below that will auto scale nginx-app1 deplyment if cpu usage will get above 80% max 5 pods. – It’s checks every 30 seconds for scaling the deployment – It’s scale downs the deployment after 300 seconds if the load goes down
NOTE: – if number1 was already indexed as string then you have to delete the old index – if use add_field again with same name after grok it will show double value