Question 422 of 720
CKS Minimize Microservice Vulnerabilities Practice Question
Which kubectl command creates a valid webhook configuration that validates pods against a policy?
⚠ Common exam trap
Candidates often confuse ValidatingWebhookConfiguration with MutatingWebhookConfiguration, or assume a generic 'webhookconfiguration.yaml' is valid, but the CKS exam specifically tests the distinction between validation and mutation in admission webhooks.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
kubectl apply -f validatingwebhookconfiguration.yaml
A ValidatingWebhookConfiguration is the Kubernetes resource that intercepts API server requests to validate resources (e.g., pods) against an external policy before they are persisted. The command `kubectl apply -f validatingwebhookconfiguration.yaml` creates this configuration, which triggers a webhook call to an admission webhook server that returns an admission review with an 'allowed' or 'denied' decision.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl apply -f webhookconfiguration.yaml
Why it's wrong here
There is no generic 'webhookconfiguration' resource.
- ✗
kubectl apply -f podpreset.yaml
Why it's wrong here
PodPreset is deprecated and not an admission webhook resource.
- ✗
kubectl apply -f mutatingwebhookconfiguration.yaml
Why it's wrong here
MutatingWebhookConfiguration is for mutating webhooks, not validation.
- ✓
kubectl apply -f validatingwebhookconfiguration.yaml
Why this is correct
ValidatingWebhookConfiguration is the correct resource for validation webhooks.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on CKS
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which kubectl command creates a validating webhook configuration that calls an external HTTPS endpoint for pod validation?
easy- A.kubectl create admission webhook --validate
- B.kubectl run webhook --image=...
- ✓ C.kubectl apply -f webhook.yaml
- D.kubectl create validatingwebhookconfiguration --url=https://...
Why C: `kubectl apply -f webhook.yaml` is the standard way to create any Kubernetes resource, including a ValidatingWebhookConfiguration, from a YAML manifest. The manifest defines the webhook's client configuration, including the external HTTPS endpoint, CA bundle, and rules for pod validation. There is no dedicated `kubectl create` subcommand for webhooks; the resource must be defined declaratively in a YAML file.
Last reviewed: Jul 4, 2026
This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.