Using Node Authorization
The Node authorizer allows a kubelet to perform API operations. This includes:
Read operations:
- endpoints
- nodes
- pods
- secrets, configmaps, persistent volume claims and persistent volumes related to pods bound to the kubelet’s node
Write operations:
- nodes and node status (enable the
NodeRestriction
admission plugin to limit a kubelet to modify its own node) - pods and pod status (enable the
NodeRestriction
admission plugin to limit a kubelet to modify pods bound to itself)
Auth-related operations:
- read/write access to the certificationsigningrequests API for TLS bootstrapping
- the ability to create tokenreviews and subjectaccessreviews for delegated authentication/authorization checks
In future releases, the node authorizer may add or remove permissions to ensure kubelets have the minimal set of permissions required to operate correctly.
The value of <nodeName>
must match precisely the name of the node as registered by the kubelet. By default, this is the host name as provided by hostname
, or overridden via the kubelet option --hostname-override
. However, when using the --cloud-provider
kubelet option, the specific hostname may be determined by the cloud provider, ignoring the local hostname
and the --hostname-override
option. For specifics about how the kubelet determines the hostname, see the .
To enable the Node authorizer, start the apiserver with --authorization-mode=Node
.
To limit the API objects kubelets are able to write, enable the NodeRestriction admission plugin by starting the apiserver with
Migration considerations
Kubelets outside the system:nodes
group would not be authorized by the Node
authorization mode, and would need to continue to be authorized via whatever mechanism currently authorizes them. The node admission plugin would not restrict requests from these kubelets.
In some deployments, kubelets have credentials that place them in the system:nodes
group, but do not identify the particular node they are associated with, because they do not have a username in the system:node:...
format. These kubelets would not be authorized by the Node
authorization mode, and would need to continue to be authorized via whatever mechanism currently authorizes them.
Upgraded pre-1.7 clusters using RBAC will continue functioning as-is because the system:nodes
group binding will already exist.
If a cluster admin wishes to start using the Node
authorizer and NodeRestriction
admission plugin to limit node access to the API, that can be done non-disruptively:
- Enable the
Node
authorization mode () and theNodeRestriction
admission plugin - Ensure all kubelets’ credentials conform to the group/username requirements
- Audit apiserver logs to ensure the
Node
authorizer is not rejecting requests from kubelets (no persistentNODE DENY
messages logged) - Delete the
system:node
cluster role binding
In 1.6, the system:node
cluster role was automatically bound to the system:nodes
group when using the .
In 1.7, the automatic binding of the system:nodes
group to the system:node
role is deprecated because the node authorizer accomplishes the same purpose with the benefit of additional restrictions on secret and configmap access. If the Node
and RBAC
authorization modes are both enabled, the automatic binding of the system:nodes
group to the role is not created in 1.7.
In 1.8, the binding will not be created at all.