@@ -16,11 +16,11 @@ weight: 90
16
16
<!-- overview -->
17
17
18
18
<!--
19
- Node authorization is a special-purpose authorization mode that specifically authorizes API requests made by kubelets.
19
+ Node authorization is a special-purpose authorization mode that specifically
20
+ authorizes API requests made by kubelets.
20
21
-->
21
22
节点鉴权是一种特殊用途的鉴权模式,专门对 kubelet 发出的 API 请求进行授权。
22
23
23
-
24
24
<!-- body -->
25
25
26
26
<!--
@@ -43,7 +43,8 @@ Read operations:
43
43
* endpoints
44
44
* nodes
45
45
* pods
46
- * secrets, configmaps, persistent volume claims and persistent volumes related to pods bound to the kubelet's node
46
+ * secrets, configmaps, persistent volume claims and persistent volumes related
47
+ to pods bound to the kubelet's node
47
48
-->
48
49
* services
49
50
* endpoints
@@ -57,8 +58,10 @@ Write operations:
57
58
写入操作:
58
59
59
60
<!--
60
- * nodes and node status (enable the `NodeRestriction` admission plugin to limit a kubelet to modify its own node)
61
- * pods and pod status (enable the `NodeRestriction` admission plugin to limit a kubelet to modify pods bound to itself)
61
+ * nodes and node status (enable the `NodeRestriction` admission plugin to limit
62
+ a kubelet to modify its own node)
63
+ * pods and pod status (enable the `NodeRestriction` admission plugin to limit a
64
+ kubelet to modify pods bound to itself)
62
65
* events
63
66
-->
64
67
* 节点和节点状态(启用 ` NodeRestriction ` 准入插件以限制 kubelet 只能修改自己的节点)
@@ -71,34 +74,45 @@ Auth-related operations:
71
74
身份认证与鉴权相关的操作:
72
75
73
76
<!--
74
- * read/write access to the [CertificateSigningRequests API](/docs/reference/access-authn-authz/certificate-signing-requests/) for TLS bootstrapping
75
- * the ability to create TokenReviews and SubjectAccessReviews for delegated authentication/authorization checks
77
+ * read/write access to the
78
+ [CertificateSigningRequests API](/docs/reference/access-authn-authz/certificate-signing-requests/)
79
+ for TLS bootstrapping
80
+ * the ability to create TokenReviews and SubjectAccessReviews for delegated
81
+ authentication/authorization checks
76
82
-->
77
83
* 对于基于 TLS 的启动引导过程时使用的
78
84
[ certificationsigningrequests API] ( /zh-cn/docs/reference/access-authn-authz/certificate-signing-requests/ )
79
85
的读/写权限
80
86
* 为委派的身份验证/鉴权检查创建 TokenReview 和 SubjectAccessReview 的能力
81
87
82
88
<!--
83
- In future releases, the node authorizer may add or remove permissions to ensure kubelets
84
- have the minimal set of permissions required to operate correctly.
89
+ In future releases, the node authorizer may add or remove permissions to ensure
90
+ kubelets have the minimal set of permissions required to operate correctly.
85
91
-->
86
92
在将来的版本中,节点鉴权器可能会添加或删除权限,以确保 kubelet 具有正确操作所需的最小权限集。
87
93
88
94
<!--
89
- In order to be authorized by the Node authorizer, kubelets must use a credential that identifies them as
90
- being in the `system:nodes` group, with a username of `system:node:<nodeName>`.
91
- This group and user name format match the identity created for each kubelet as part of
95
+ In order to be authorized by the Node authorizer, kubelets must use a credential
96
+ that identifies them as being in the `system:nodes` group, with a username of
97
+ `system:node:<nodeName>`.
98
+ This group and user name format match the identity created for each kubelet as part of
92
99
[kubelet TLS bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/).
93
100
-->
94
- 为了获得节点鉴权器的授权,kubelet 必须使用一个凭证以表示它在 ` system:nodes `
101
+ 为了获得节点鉴权器的授权,kubelet 必须使用一个凭据以表示它在 ` system:nodes `
95
102
组中,用户名为 ` system:node:<nodeName> ` 。上述的组名和用户名格式要与
96
103
[ kubelet TLS 启动引导] ( /zh-cn/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/ )
97
104
过程中为每个 kubelet 创建的标识相匹配。
98
105
99
106
<!--
100
- 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](/docs/reference/command-line-tools-reference/kubelet/) `--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.
101
- For specifics about how the kubelet determines the hostname, see the [kubelet options reference](/docs/reference/command-line-tools-reference/kubelet/).
107
+ The value of `<nodeName>` **must** match precisely the name of the node as
108
+ registered by the kubelet. By default, this is the host name as provided by
109
+ `hostname`, or overridden via the
110
+ [kubelet option](/docs/reference/command-line-tools-reference/kubelet/)
111
+ `--hostname-override`. However, when using the `--cloud-provider` kubelet
112
+ option, the specific hostname may be determined by the cloud provider, ignoring
113
+ the local `hostname` and the `--hostname-override` option.
114
+ For specifics about how the kubelet determines the hostname, see the
115
+ [kubelet options reference](/docs/reference/command-line-tools-reference/kubelet/).
102
116
-->
103
117
` <nodeName> ` 的值** 必须** 与 kubelet 注册的节点名称精确匹配。默认情况下,节点名称是由
104
118
` hostname ` 提供的主机名,或者通过 kubelet ` --hostname-override `
@@ -114,7 +128,10 @@ To enable the Node authorizer, start the apiserver with `--authorization-mode=No
114
128
要启用节点鉴权器,请使用 ` --authorization-mode=Node ` 启动 API 服务器。
115
129
116
130
<!--
117
- To limit the API objects kubelets are able to write, enable the [NodeRestriction](/docs/reference/access-authn-authz/admission-controllers#NodeRestriction) admission plugin by starting the apiserver with `--enable-admission-plugins=...,NodeRestriction,...`
131
+ To limit the API objects kubelets are able to write, enable the
132
+ [NodeRestriction](/docs/reference/access-authn-authz/admission-controllers#noderestriction)
133
+ admission plugin by starting the apiserver with
134
+ `--enable-admission-plugins=...,NodeRestriction,...`
118
135
-->
119
136
要限制 kubelet 可以写入的 API 对象,请使用
120
137
` --enable-admission-plugins=...,NodeRestriction,... ` 启动 API 服务器,从而启用
@@ -132,8 +149,9 @@ To limit the API objects kubelets are able to write, enable the [NodeRestriction
132
149
### 在 ` system:nodes ` 组之外的 kubelet {#kubelets-outside-the-system-nodes-group}
133
150
134
151
<!--
135
- Kubelets outside the `system:nodes` group would not be authorized by the `Node` authorization mode,
136
- and would need to continue to be authorized via whatever mechanism currently authorizes them.
152
+ Kubelets outside the `system:nodes` group would not be authorized by the `Node`
153
+ authorization mode, and would need to continue to be authorized via whatever
154
+ mechanism currently authorizes them.
137
155
The node admission plugin would not restrict requests from these kubelets.
138
156
-->
139
157
` system:nodes ` 组之外的 kubelet 不会被 ` Node ` 鉴权模式授权,并且需要继续通过当前授权它们的机制来授权。
@@ -151,7 +169,7 @@ because they do not have a username in the `system:node:...` format.
151
169
These kubelets would not be authorized by the `Node` authorization mode,
152
170
and would need to continue to be authorized via whatever mechanism currently authorizes them.
153
171
-->
154
- 在一些部署中,kubelet 具有 ` system:nodes ` 组的凭证 ,
172
+ 在一些部署中,kubelet 具有 ` system:nodes ` 组的凭据 ,
155
173
但是无法给出它们所关联的节点的标识,因为它们没有 ` system:node:... ` 格式的用户名。
156
174
这些 kubelet 不会被 ` Node ` 鉴权模式授权,并且需要继续通过当前授权它们的任何机制来授权。
157
175
@@ -161,65 +179,3 @@ since the default node identifier implementation would not consider that a node
161
179
-->
162
180
因为默认的节点标识符实现不会把它当作节点身份标识,` NodeRestriction `
163
181
准入插件会忽略来自这些 kubelet 的请求。
164
-
165
- <!--
166
- ### Upgrades from previous versions using RBAC
167
- -->
168
- ### 相对于以前使用 RBAC 的版本的更新 {#upgrades-from-previous-versions-using-rbac}
169
-
170
- <!--
171
- Upgraded pre-1.7 clusters using [RBAC](/docs/reference/access-authn-authz/rbac/) will continue functioning as-is because the `system:nodes` group binding will already exist.
172
- -->
173
- 升级的 1.7 之前的使用 [ RBAC] ( /zh-cn/docs/reference/access-authn-authz/rbac/ )
174
- 的集群将继续按原样运行,因为 ` system:nodes ` 组绑定已经存在。
175
-
176
- <!--
177
- If a cluster admin wishes to start using the `Node` authorizer and `NodeRestriction` admission plugin
178
- to limit node access to the API, that can be done non-disruptively:
179
- -->
180
- 如果集群管理员希望开始使用 ` Node ` 鉴权器和 ` NodeRestriction ` 准入插件来限制节点对
181
- API 的访问,这一需求可以通过下列操作来完成且不会影响已部署的应用:
182
-
183
- <!--
184
- 1. Enable the `Node` authorization mode (`--authorization-mode=Node,RBAC`) and the `NodeRestriction` admission plugin
185
- 2. Ensure all kubelets' credentials conform to the group/username requirements
186
- 3. Audit apiserver logs to ensure the `Node` authorizer is not rejecting requests from kubelets (no persistent `NODE DENY` messages logged)
187
- 4. Delete the `system:node` cluster role binding
188
- -->
189
- 1 . 启用 ` Node ` 鉴权模式 (` --authorization-mode=Node,RBAC ` ) 和 ` NodeRestriction ` 准入插件
190
- 2 . 确保所有 kubelet 的凭据符合组/用户名要求
191
- 3 . 审核 API 服务器日志以确保 ` Node ` 鉴权器不会拒绝来自 kubelet 的请求(日志中没有持续的 ` NODE DENY ` 消息)
192
- 4 . 删除 ` system:node ` 集群角色绑定
193
-
194
- <!--
195
- ### RBAC Node Permissions
196
- -->
197
- ### RBAC 节点权限 {#rbac-node-permissions}
198
-
199
- <!--
200
- In 1.6, the `system:node` cluster role was automatically bound to the `system:nodes` group when using the [RBAC Authorization mode](/docs/reference/access-authn-authz/rbac/).
201
- -->
202
- 在 1.6 版本中,当使用 [ RBAC 鉴权模式] ( /zh-cn/docs/reference/access-authn-authz/rbac/ )
203
- 时,` system:nodes ` 集群角色会被自动绑定到 ` system:node ` 组。
204
-
205
- <!--
206
- In 1.7, the automatic binding of the `system:nodes` group to the `system:node` role is deprecated
207
- because the node authorizer accomplishes the same purpose with the benefit of additional restrictions
208
- on secret and configmap access. If the `Node` and `RBAC` authorization modes are both enabled,
209
- the automatic binding of the `system:nodes` group to the `system:node` role is not created in 1.7.
210
- -->
211
- 在 1.7 版本中,不再推荐将 ` system:nodes ` 组自动绑定到 ` system:node `
212
- 角色,因为节点鉴权器通过对 Secret 和 ConfigMap 访问的额外限制完成了相同的任务。
213
- 如果同时启用了 ` Node ` 和 ` RBAC ` 鉴权模式,1.7 版本则不会创建 ` system:nodes `
214
- 组到 ` system:node ` 角色的自动绑定。
215
-
216
- <!--
217
- In 1.8, the binding will not be created at all.
218
- -->
219
- 在 1.8 版本中,绑定将根本不会被创建。
220
-
221
- <!--
222
- When using RBAC, the `system:node` cluster role will continue to be created,
223
- for compatibility with deployment methods that bind other users or groups to that role.
224
- -->
225
- 使用 RBAC 时,将继续创建 ` system:node ` 集群角色,以便与将其他用户或组绑定到该角色的部署方法兼容。
0 commit comments