Bird
0
0

What will happen if you run kubectl scale deployment myapp --replicas=5 in a Kubernetes cluster?

medium📝 Command Output Q5 of 15
Docker - Production Patterns
What will happen if you run kubectl scale deployment myapp --replicas=5 in a Kubernetes cluster?
AThe deployment 'myapp' will have 5 pods running
BThe deployment 'myapp' will be deleted
CThe cluster will create 5 new deployments
DThe command will fail due to syntax error
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'kubectl scale' command

    This command changes the number of replicas (pods) for a deployment.
  2. Step 2: Apply to given command

    Setting replicas=5 means the deployment 'myapp' will run 5 pods.
  3. Final Answer:

    The deployment 'myapp' will have 5 pods running -> Option A
  4. Quick Check:

    'kubectl scale' adjusts pod count [OK]
Quick Trick: 'kubectl scale' changes pod replicas count [OK]
Common Mistakes:
  • Thinking it deletes deployment
  • Expecting multiple deployments created
  • Assuming syntax error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes