These restrictions are enforced by the Kubernetes NodeRestriction admission controller, which is enabled by default in Talos and cannot be disabled. NodeRestriction prevents a node (via its kubelet identity) from modifying anything outside a small, whitelisted set of fields. This ensures worker nodes cannot escalate privileges or assign sensitive labels or taints to themselves.
nodeLabels
Talos can propagate labels frommachine.nodeLabels to the Kubernetes Node object.These labels are written using the node’s kubelet identity and therefore must comply with NodeRestriction rules.
Allowed labels
Only a limited set of labels may be modified by the node itself, such as:topology.kubernetes.io/regiontopology.kubernetes.io/zonekubernetes.io/hostnamekubernetes.io/archkubernetes.io/os- some
node.kubernetes.io/*labels
node-role.kubernetes.io/<role>—are rejected by the API server when applied by the node.
This prevents worker nodes from assigning themselves privileged roles.
Apply nodeLabels
You can add labels to a node by specifying them under machine.nodeLabels in the machine configuration:
Role Labels
To assign Kubernetes role labels such as:node-role.kubernetes.io/workernode-role.kubernetes.io/ingressnode-role.kubernetes.io/control-plane
node-role.kubernetes.io/* form if required.
Node Taints
Kubernetes taints let you prevent workloads from being scheduled on a node unless they have matching tolerations. You can learn more in the official Taints and Tolerations documentation. Due to NodeRestriction, worker nodes cannot modify taints on their Node object after they have joined the cluster. This includes adding, removing, or updating taints. Attempting to do so results in errors such as:<node-name> is not allowed to modify taints.
This behaviour is expected and required for Kubernetes hardening.
Apply Taints
Talos supports setting initial taints only during first node registration, using the kubelet’sregisterWithTaints configuration.
These must be configured under:
Example: Add a NoSchedule taint to a worker node
To add a taint to a worker node, create a patch with this exampleNoSchedule taint: