Description
NodeRestriction limits which Node and Pod objects a kubelet can modify. It permits limited changes to its own Node and the Pods bound to it, and protects certain node labels.
Potential impact
Disabling the plugin removes these checks from kubelet requests that pass authorization.
Remediation
Verify that each kubelet authenticates as system:node:<nodeName> in the system:nodes group. Configure the Node authorizer and RBAC, and include NodeRestriction in --enable-admission-plugins. Check that normal node updates succeed and that out-of-scope object and label changes are rejected.
Examples
The Kubernetes 1.34.0 excerpts move the plugin from the disabled list to the enabled list. It needs no separate plugin configuration file. Node authentication and authorization settings are omitted.
Before
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: registry.k8s.io/kube-apiserver:v1.34.0
command: ["kube-apiserver"]
args: ["--disable-admission-plugins=NodeRestriction"]
After
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: registry.k8s.io/kube-apiserver:v1.34.0
command: ["kube-apiserver"]
args: ["--enable-admission-plugins=NodeRestriction"]