hardkubectl

Create a Horizontal Pod Autoscaler to automatically scale a deployment based on CPU usage

command

kubectl autoscale deployment DEPLOYMENT_NAME --min MIN --max MAX --cpu-percent CPU_PERCENT

also accepted

kubectl autoscale deploymentkubectl autoscale deployment DEPLOYMENT_NAMEkubectl autoscale deploykubectl autoscale deploy DEPLOYMENT_NAME

Command breakdown

Part of the Kubernetes CLI (kubectl) — Deployments category.

kubectlautoscaledeploymentDEPLOYMENT_NAME--minMIN--maxMAX--cpu-percentCPU_PERCENT
FlagPurpose
--minBoolean flag
--maxBoolean flag
--cpu-percentBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →