What command scales a Deployment to 5 replicas?
- kubectl scale deployment my-app --replicas=5 ✓
- kubectl update deployment my-app --size=5
- kubectl set replicas my-app 5
- kubectl resize deployment my-app 5
Correct answer: kubectl scale deployment my-app --replicas=5
The correct kubectl command to scale a Deployment is 'kubectl scale deployment my-app --replicas=5', which is the canonical imperative command that directly sets the desired replica count on the named Deployment resource. Option B (kubectl update deployment) is not a valid kubectl subcommand; updates to Deployments are performed with 'kubectl apply', 'kubectl set', or 'kubectl edit', not 'update'. Option C (kubectl set replicas) is not a valid form; 'kubectl set' is used for subcommands like 'image' or 'env', and does not have a 'replicas' subcommand. Option D (kubectl resize) does not exist as a kubectl subcommand in any version of Kubernetes.
Topic: · kubectl, kubernetes, deployments, scaling