Skip to main content

More Info:

Reject creating objects in a namespace that is undergoing termination.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the kube-apiserver manifest:
  2. On every control plane node, open the manifest for editing:
  3. In the command: section of the kube-apiserver container, locate the line starting with - --disable-admission-plugins=.
    • If it does not exist, go to step 4.
    • If it exists and contains NamespaceLifecycle, remove only NamespaceLifecycle from the comma-separated list, keeping any other plugins as-is.
      Example before:
    Example after:
  4. If there is no --disable-admission-plugins line, add nothing for this control; no additional flag is required as long as NamespaceLifecycle is not disabled. Save and exit the editor.
    Note: Editing this static pod manifest will cause the kubelet to automatically restart the kube-apiserver pod.
  5. Wait 1–2 minutes for the kube-apiserver pod to be recreated, then on every control plane node verify that NamespaceLifecycle is not listed under --disable-admission-plugins:
    Confirm that the printed value (if any) does not contain NamespaceLifecycle.
kubectl cannot modify kube-apiserver process flags or the static pod manifest at /etc/kubernetes/manifests/kube-apiserver.yaml on control plane nodes, so this finding cannot be fixed via the Kubernetes API. To remediate, make the changes directly on each control plane node as described in the Manual Steps section.

Additional Reading: