Kubernetes Deep Dive

Sign Up Free or Log In to participate!

Horizontal Pod Autoscaler

How to link HPA to Deploy as seen in theory video?

John L

Hi Ramesh, You can add an HPA to a deployment two ways. You can spin up the HPA imperatively, after the deployment, and point it at that deployment, e.g. ‘kubectl autoscale deployment mydeployment –cpu-percent=75 –min=1 –max=5’ But doing it imperatively is a bad K8S practice so you’re better off defining the HPA in yaml pointing at the deployment. You link the HPA to the deployment with the metadata ‘name’ & ‘namespace’ values: kind: HorizontalPodAutoscaler metadata: name: mydeployment namespace: mynamespace In the demo video you see the HPA defined around 3:30.

0 Answers

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?