Bird
0
0

Which command is best to update an existing Kubernetes resource without deleting it first?

easy📝 Conceptual Q2 of 15
Kubernetes - kubectl Essential Commands
Which command is best to update an existing Kubernetes resource without deleting it first?
Akubectl apply -f resource.yaml
Bkubectl get -f resource.yaml
Ckubectl delete -f resource.yaml
Dkubectl create -f resource.yaml
Step-by-Step Solution
Solution:
  1. Step 1: Identify update command

    kubectl apply updates existing resources by applying changes from the file.
  2. Step 2: Compare with other commands

    kubectl create fails if resource exists; delete removes resource; get only shows info.
  3. Final Answer:

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

    Apply updates without delete = D [OK]
Quick Trick: Use apply to update without deleting resource first [OK]
Common Mistakes:
  • Using create to update existing resource
  • Deleting resource unintentionally
  • Confusing get with update

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes