Bird
0
0

Which kubectl command updates an existing ConfigMap named app-config using the data from config.yaml file?

easy📝 Syntax Q3 of 15
Kubernetes - ConfigMaps
Which kubectl command updates an existing ConfigMap named app-config using the data from config.yaml file?
Akubectl create configmap app-config --from-file=config.yaml --dry-run=client -o yaml | kubectl apply -f -
Bkubectl replace configmap app-config -f config.yaml
Ckubectl edit configmap app-config --filename=config.yaml
Dkubectl update configmap app-config --from-file=config.yaml
Step-by-Step Solution
Solution:
  1. Step 1: Understand ConfigMap update methods

    Direct update requires recreating the ConfigMap manifest.
  2. Step 2: Use create with dry-run and apply

    Using kubectl create configmap with --dry-run=client and piping to kubectl apply updates the ConfigMap safely.
  3. Final Answer:

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

    Apply updates existing resources [OK]
Quick Trick: Use create with dry-run and apply to update ConfigMaps [OK]
Common Mistakes:
  • Using kubectl replace with a file that is not a full manifest
  • Assuming kubectl update command exists
  • Trying to edit with filename option

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes