Q1 — Which of these is NOT a function of admission controllers?
Answer: Authenticate users. Explanation- Admission controllers run after authentication and authorization have already taken place.
- Their role is to validate or mutate API requests (for example, enforce quotas, set defaults, restrict node changes, or call webhooks).
- Authentication (establishing identity of the caller) is handled earlier in the request pipeline; admission controllers do not perform authentication.
Q2 — Which admission controller is NOT enabled by default?
How to check- Inspect the kube-apiserver help text for the
--enable-admission-pluginsflag to see which admission plugins are enabled in addition to defaults. - On a static-pod control plane, you can run the kube-apiserver binary from inside the API server pod to print the help output.
- From the list above,
MutatingAdmissionWebhookandValidatingAdmissionWebhookare present, butNamespaceAutoProvisionis not. - Therefore,
NamespaceAutoProvisionis not enabled by default in this cluster.
Q3 — Which admission controller is enabled in this cluster that is normally disabled?
How to check- Inspect the kube-apiserver static pod manifest on the control-plane host, usually at
/etc/kubernetes/manifests/kube-apiserver.yaml, or grep the running manifest forenable-admission-plugins.
- This shows that
NodeRestrictionhas been explicitly enabled in the manifest. NodeRestrictioncan be off by default in some upstream defaults and was added on this cluster — that is the admission controller that is explicitly enabled here.
Q4 — Create an nginx Pod in the blue namespace (namespace not pre-created)
Scenario
- The lab required creating a Pod in the
bluenamespace, but thebluenamespace does not exist and the lab forbade pre-creating the namespace manually.
- Requests targeting a non-existent namespace are rejected by the API server.
- Historically, admission plugins such as
NamespaceAutoProvisioncould automatically create a namespace when a request referenced it. - Most modern clusters do not enable
NamespaceAutoProvisionby default (and the plugin is deprecated in newer Kubernetes versions).
- The lab expects you to enable the legacy behavior: add
NamespaceAutoProvisionto the enabled plugins list of kube-apiserver. - Edit the kube-apiserver static pod manifest and add
NamespaceAutoProvisionto--enable-admission-plugins.
- Edit
/etc/kubernetes/manifests/kube-apiserver.yamland modify the--enable-admission-pluginsvalue as shown. - Save the file; kubelet will detect the manifest change and recreate the static pod.
- Wait until kube-apiserver is ready again, then retry creating the Pod:
NamespaceAutoProvisionis deprecated in recent Kubernetes releases. Newer Kubernetes versions rely onNamespaceLifecycleand other supported mechanisms. Prefer supported patterns for production clusters.
The
NamespaceAutoProvision admission controller is deprecated and replaced by NamespaceLifecycle in recent Kubernetes releases. Prefer the newer controller and supported workflows for namespace management.Q5 — Disable the DefaultStorageClass admission controller
Goal- Disable the
DefaultStorageClassadmission controller so it no longer runs during admission.
- Add the plugin name to the
--disable-admission-pluginsflag in the kube-apiserver static pod manifest.
- Ensure the
--disable-admission-pluginsflag includesDefaultStorageClass. - After saving the manifest, kubelet recreates the kube-apiserver static pod using the updated arguments. Wait for the API server to restart and become ready before validating behavior changes.
- After kube-apiserver restarts, try creating PVCs or observe default storage class behavior to confirm the controller is no longer mutating requests.
Q6 — Verify enabled and disabled admission plugins on the running kube-apiserver
Methods to verify- Inspect the running kube-apiserver process on the control-plane node
- The resulting process command line includes
--enable-admission-pluginsand--disable-admission-pluginsarguments and their values. - This shows the effective flags the process is running with.
- Inspect the static pod manifest used by kubelet
- The manifest is the authoritative configuration that kubelet uses to create the kube-apiserver static pod.
- If you modified the manifest to enable/disable plugins, this is the file to check.
- Alternative: use the kube-apiserver help text from within the static pod
<kube-apiserver-pod-name> with the actual pod name (e.g., output from kubectl get pods -n kube-system).
References and further reading
- Kubernetes Admission Controllers
- kube-apiserver command-line reference
- Namespace lifecycle in Kubernetes