-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
assignees: | ||
- timstclair | ||
- deads2k | ||
- liggitt | ||
- ericchiang | ||
title: Using Node Authorization | ||
--- | ||
|
||
* TOC | ||
{:toc} | ||
|
||
Node authorization is a special-purpose authorization mode that specifically authorizes API requests made by kubelets. | ||
|
||
## Overview | ||
|
||
Kubelets must be able to read the API resources that describe the pods they are supposed to run, | ||
read secrets, configmaps, persistent volume claims and persistent volumes related to those pods, | ||
and write API objects that report the status of their pods, and of the node the kubelet is running on. | ||
|
||
The Node authorizer tracks which pods are associated with which nodes, and authorizes | ||
kubelets to read just the resources related to their pods. | ||
|
||
In order to be authorized, kubelets must use a credential that identifies them as | ||
being in the `system:nodes` group, with a username of `system:node:<nodeName>`. | ||
This group and user name format match the identity created for each kubelet as part of | ||
[kubelet TLS bootstrapping](/docs/admin/kubelet-tls-bootstrapping/). | ||
|
||
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](/docs/admin/admission-controllers#NodeRestriction) admission plugin by starting the apiserver with `--admission-control=...,NodeRestriction,...` | ||
|
||
## Migration considerations | ||
|
||
### Kubelets outside the `system:nodes` group | ||
|
||
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. | ||
|
||
### Kubelets with undifferentiated usernames | ||
|
||
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 (have a username that does not match 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. | ||
|
||
The `NodeRestriction` admission plugin would ignore requests from these kubelets, | ||
since the default node identifier implementation would not consider that a node identity. | ||
|
||
### Upgrades from previous versions using RBAC | ||
|
||
Upgraded pre-1.7 clusters using [RBAC](/docs/admin/authorization/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: | ||
1. Enable the `Node` authorization mode (`--authorization-mode=Node,RBAC`) and the `NodeRestriction` admission plugin | ||
2. Ensure all kubelets' credentials conform to the group/username requirements | ||
3. Audit apiserver logs to ensure the `Node` authorizer is not rejecting requests from kubelets (no persistent `NODE DENY` messages logged) | ||
4. Delete the `system:node` cluster role binding | ||
|
||
### RBAC Node Permissions | ||
|
||
In 1.6, the `system:node` cluster role was automatically bound to the `system:nodes` group when using the [RBAC Authorization mode](/docs/admin/authorization/rbac/). | ||
|
||
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 `system:node` role is not created in 1.7. | ||
|
||
In 1.8, the binding will not be created at all. | ||
|
||
The `system:node` cluster role will continue to be created when using RBAC, | ||
for compatibility with deployment methods that bind other users or groups to that role. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters