Bird
0
0

Which of the following is the correct syntax to create a ReplicaSet with 3 replicas using kubectl?

easy📝 Syntax Q12 of 15
Kubernetes - ReplicaSets and Deployments
Which of the following is the correct syntax to create a ReplicaSet with 3 replicas using kubectl?
Akubectl apply replicaset myapp --replicas=3 --image=myimage
Bkubectl create rs myapp --replicas=3 --image=myimage
Ckubectl run replicaset myapp --replicas=3 --image=myimage
Dkubectl create replicaset myapp --replicas=3 --image=myimage
Step-by-Step Solution
Solution:
  1. Step 1: Recall kubectl command for ReplicaSet creation

    The correct command to create a ReplicaSet with replicas and image is 'kubectl run' with appropriate flags.
  2. Step 2: Validate each option's syntax

    kubectl run replicaset myapp --replicas=3 --image=myimage is the correct syntax; 'kubectl create rs' is not a valid command, and 'kubectl apply' requires a manifest file.
  3. Final Answer:

    kubectl run replicaset myapp --replicas=3 --image=myimage -> Option C
  4. Quick Check:

    ReplicaSet creation uses 'kubectl run' with --replicas flag [OK]
Quick Trick: Use 'kubectl run' with --replicas flag [OK]
Common Mistakes:
  • Using 'kubectl create rs' which is invalid
  • Using full name 'replicaset' which is invalid
  • Using 'kubectl apply' without a manifest file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes