Bird
0
0

Which of the following is the correct Kubernetes command to deploy a microservice from a YAML file named service.yaml?

easy📝 Command Output Q12 of 15
Microservices - Orchestration with Kubernetes
Which of the following is the correct Kubernetes command to deploy a microservice from a YAML file named service.yaml?
Akubectl apply -f service.yaml
Bkubectl run service.yaml
Ckubectl start service.yaml
Dkubectl create service.yaml
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command to apply configuration files

    The kubectl apply -f command applies changes from a YAML file to the cluster.
  2. Step 2: Check other options for correctness

    kubectl run is for running pods directly, kubectl start and kubectl create do not accept YAML files directly.
  3. Final Answer:

    kubectl apply -f service.yaml -> Option A
  4. Quick Check:

    Apply YAML file = kubectl apply -f [OK]
Quick Trick: Use 'kubectl apply -f' to deploy YAML files [OK]
Common Mistakes:
MISTAKES
  • Using 'kubectl run' to deploy YAML files
  • Trying 'kubectl start' which is invalid
  • Confusing 'kubectl create' with applying configs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes