11---
22title : 为节点发布扩展资源
33content_type : task
4+ weight : 70
45---
56<!--
67title: Advertise Extended Resources for a Node
78content_type: task
9+ weight: 70
810-->
911
1012<!-- overview -->
@@ -26,14 +28,16 @@ resources that would otherwise be unknown to Kubernetes.
2628<!--
2729## Get the names of your Nodes
2830
29- Choose one of your Nodes to use for this exercise.
3031-->
3132## 获取你的节点名称
3233
3334``` shell
3435kubectl get nodes
3536```
3637
38+ <!--
39+ Choose one of your Nodes to use for this exercise.
40+ -->
3741选择一个节点用于此练习。
3842
3943<!--
@@ -50,7 +54,7 @@ for your Node.
5054例如:假设你的一个节点上带有四个 dongle 资源。
5155下面是一个 PATCH 请求的示例,该请求为你的节点发布四个 dongle 资源。
5256
53- ``` shell
57+ ```
5458PATCH /api/v1/nodes/<your-node-name>/status HTTP/1.1
5559Accept: application/json
5660Content-Type: application/json-patch+json
@@ -95,13 +99,13 @@ curl --header "Content-Type: application/json-patch+json" \
9599 http://localhost:8001/api/v1/nodes/< your-node-name> /status
96100```
97101
102+ {{< note >}}
98103<!--
99104In the preceding request, `~1` is the encoding for the character / in
100105the patch path. The operation path value in JSON-Patch is interpreted as a
101106JSON-Pointer. For more details, see
102107[IETF RFC 6901](https://tools.ietf.org/html/rfc6901), section 3.
103108-->
104- {{< note >}}
105109在前面的请求中,` ~1 ` 为 patch 路径中 “/” 符号的编码。
106110JSON-Patch 中的操作路径值被解析为 JSON 指针。
107111更多细节,请查看 [ IETF RFC 6901] ( https://tools.ietf.org/html/rfc6901 ) 的第 3 节。
@@ -119,21 +123,25 @@ The output shows that the Node has a capacity of 4 dongles:
119123 "example.com/dongle": "4",
120124```
121125
122- <!-- Describe your Node: -->
126+ <!--
127+ Describe your Node:
128+ -->
123129描述你的节点:
124130
125- ``` shell
131+ ```
126132kubectl describe node <your-node-name>
127133```
128134
129- <!-- Once again, the output shows the dongle resource: -->
135+ <!--
136+ Once again, the output shows the dongle resource:
137+ -->
130138输出再次展示了 dongle 资源:
131139
132140``` yaml
133141Capacity :
134- cpu : 2
135- memory : 2049008Ki
136- example.com/dongle : 4
142+ cpu : 2
143+ memory : 2049008Ki
144+ example.com/dongle : 4
137145` ` `
138146
139147<!--
@@ -260,9 +268,9 @@ Replace `<your-node-name>` with the name of your Node:
260268
261269``` shell
262270curl --header " Content-Type: application/json-patch+json" \
263- --request PATCH \
264- --data ' [{"op": "remove", "path": "/status/capacity/example.com~1dongle"}]' \
265- http://localhost:8001/api/v1/nodes/< your-node-name> /status
271+ --request PATCH \
272+ --data ' [{"op": "remove", "path": "/status/capacity/example.com~1dongle"}]' \
273+ http://localhost:8001/api/v1/nodes/< your-node-name> /status
266274```
267275
268276<!--
@@ -275,29 +283,27 @@ kubectl describe node <your-node-name> | grep dongle
275283```
276284
277285<!--
278- (you should not see any output)
286+ (you should not see any output)
279287-->
280288(你应该看不到任何输出)
281289
282-
283290## {{% heading "whatsnext" %}}
284291
285292<!--
286293### For application developers
287294
288- * [Assign Extended Resources to a Container](/docs/tasks/configure-pod-container/extended-resource/)
295+ - [Assign Extended Resources to a Container](/docs/tasks/configure-pod-container/extended-resource/)
289296
290297### For cluster administrators
291298
292- * [Configure Minimum and Maximum Memory Constraints for a Namespace](/docs/tasks/administer-cluster/memory-constraint-namespace/)
293- * [Configure Minimum and Maximum CPU Constraints for a Namespace](/docs/tasks/administer-cluster/cpu-constraint-namespace/)
299+ - [Configure Minimum and Maximum Memory Constraints for a Namespace](/docs/tasks/administer-cluster/manage-resources /memory-constraint-namespace/)
300+ - [Configure Minimum and Maximum CPU Constraints for a Namespace](/docs/tasks/administer-cluster/manage-resources /cpu-constraint-namespace/)
294301-->
295302### 针对应用开发人员
296303
297- * [ 将扩展资源分配给容器] ( /zh-cn/docs/tasks/configure-pod-container/extended-resource/ )
298-
299- ### 针对集群管理员
304+ - [ 将扩展资源分配给容器] ( /zh-cn/docs/tasks/configure-pod-container/extended-resource/ )
300305
301- * [ 为名字空间配置最小和最大内存约束] ( /zh-cn/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/ )
302- * [ 为名字空间配置最小和最大 CPU 约束] ( /zh-cn/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/ )
306+ ### 针对集群管理员
303307
308+ - [ 为名字空间配置最小和最大内存约束] ( /zh-cn/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/ )
309+ - [ 为名字空间配置最小和最大 CPU 约束] ( /zh-cn/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/ )
0 commit comments