Sign Up Free or Log In to participate!
How to link HPA to Deploy as seen in theory video?
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.
Psst…this one if you’ve been moved to ACG!
Don't have an account?