Bird
0
0

Which command correctly updates a ConfigMap named app-config from a file config.yaml?

easy📝 Syntax Q12 of 15
Kubernetes - ConfigMaps
Which command correctly updates a ConfigMap named app-config from a file config.yaml?
Akubectl update configmap app-config --from-file=config.yaml
Bkubectl edit configmap app-config --from-file=config.yaml
Ckubectl replace configmap app-config --from-file=config.yaml
Dkubectl create configmap app-config --from-file=config.yaml --dry-run=client -o yaml | kubectl apply -f -
Step-by-Step Solution
Solution:
  1. Step 1: Understand updating ConfigMap from file

    Direct update requires creating new YAML and applying it.
  2. Step 2: Use dry-run and apply for update

    Command C creates new ConfigMap YAML from file and applies it, updating existing ConfigMap.
  3. Final Answer:

    kubectl create configmap app-config --from-file=config.yaml --dry-run=client -o yaml | kubectl apply -f - -> Option D
  4. Quick Check:

    Use create with dry-run + apply to update ConfigMap = C [OK]
Quick Trick: Use create with dry-run and apply to update ConfigMap [OK]
Common Mistakes:
  • Using 'kubectl update' which is not a valid command
  • Trying to edit ConfigMap with --from-file option
  • Using replace without proper YAML input

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes