Skip to main content
This walkthrough provides concise solutions for the Admission Controllers lab. Each question is answered in sequence with the exact commands and explanations you can use to validate results on a running Kubernetes control plane. Summary of correct answers

Question 1 — Which of these is NOT a function of admission controllers?

Admission controllers run after authentication and authorization and act on the incoming API request to mutate or validate objects. They do not perform user authentication. Correct answer: authenticate users Explanation: Authentication is performed earlier in the request pipeline (by authentication modules). Admission controllers only see requests that have already been authenticated and authorized, and they can mutate or validate API objects.

Question 2 — Which admission controller is NOT enabled by default?

To inspect the apiserver’s help text and see the default-enabled admission plugins, check the --enable-admission-plugins flag from the running kube-apiserver binary inside the control plane pod:
Example (truncated) output lists default-enabled plugins:
From that list, NamespaceAutoProvision is not present. Correct answer: NamespaceAutoProvision

Question 3 — Which admission controller is enabled in this cluster that is normally disabled?

To see the cluster-specific enabled admission plugins, inspect the static kube-apiserver manifest on the control plane host:
Example output:
Here, NodeRestriction is enabled in the cluster configuration. While NodeRestriction is commonly enabled for security hardening, it might not be present in every distribution by default. Correct answer: NodeRestriction

Question 4 — Create an nginx Pod in the blue namespace (without creating the namespace beforehand)

If you try to run a Pod against a non-existent namespace, the apiserver will reject the request when the admission controller responsible for namespace lifecycle checks is active. Attempt to create the Pod:
You will see:
Explanation: The admission controller rejected the create request because the blue namespace does not exist. To allow automatic on-the-fly creation of namespaces for such requests, the NamespaceAutoProvision admission plugin would need to be enabled.

Question 5 — Enable NamespaceAutoProvision so a namespace is created automatically

Enable NamespaceAutoProvision by editing the kube-apiserver static pod manifest and adding it to the --enable-admission-plugins comma-separated list. Edit the manifest on the control plane host:
Find the - --enable-admission-plugins=... line and add NamespaceAutoProvision to the list. Example snippet:
Save the file. The kube-apiserver static pod will restart automatically when the manifest changes — wait a short time for the process to come back up. After the apiserver restarts, re-run the Pod creation without creating the namespace manually:
Expected output:
The blue namespace was auto-created by the NamespaceAutoProvision admission controller.
NamespaceAutoProvision has been deprecated or removed in newer Kubernetes releases. Modern clusters often do not include this admission plugin; instead, create namespaces explicitly or use supported automation mechanisms such as controllers, operators, or CI/CD tooling.

Question 6 — Disable the DefaultStorageClass admission controller

To disable DefaultStorageClass, add the --disable-admission-plugins flag to the kube-apiserver manifest and include DefaultStorageClass in the comma-separated list. Edit the manifest:
Add or update the disable flag like this (example):
Save the manifest and wait for the kube-apiserver static pod to restart. Once restarted, DefaultStorageClass will be disabled for the running apiserver process.

Question 7 — Verify which admission plugins are enabled and disabled on the running kube-apiserver

You can verify the effective enabled and disabled admission plugins by checking either the manifest file or the running kube-apiserver process command line.
  1. Inspect the manifest (static configuration):
  1. Check the running process arguments on the control plane host:
Look for --enable-admission-plugins and --disable-admission-plugins in the process command line. Example (truncated):
This confirms both the enabled and disabled admission plugins that the running apiserver was started with.

Quick verification checklist

  • Inspect apiserver help to see default plugin options:
    • kubectl exec -n kube-system kube-apiserver-control-plane -- kube-apiserver -h | grep 'enable-admission-plugins'
  • View cluster-apiserver manifest to see cluster-specific settings:
    • grep -E "enable-admission-plugins|disable-admission-plugins" /etc/kubernetes/manifests/kube-apiserver.yaml
  • Confirm the running process arguments:
    • ps -ef | grep kube-apiserver | grep -v grep

That completes the Admission Controllers lab solution walkthrough.

Watch Video