Skip to content

Commit f067dff

Browse files
authored
Merge pull request #52082 from my-git9/npa-13018
[zh-cn]sync assign-pod-level-resources allocate-devices-dra change-runtime-containerd
2 parents c73d305 + 698106a commit f067dff

File tree

3 files changed

+75
-36
lines changed

3 files changed

+75
-36
lines changed

content/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -166,39 +166,22 @@ Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtim
166166
`--container-runtime-endpoint=unix:///run/containerd/containerd.sock`
167167

168168
<!--
169-
Users using kubeadm should be aware that the `kubeadm` tool stores the CRI socket for each host as
170-
an annotation in the Node object for that host. To change it you can execute the following command
171-
on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
172-
-->
173-
使用 `kubeadm` 的用户应该知道,`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的
174-
Node 对象的注解中。
175-
要更改这一注解信息,你可以在一台包含 kubeadm `/etc/kubernetes/admin.conf` 文件的机器上执行以下命令:
169+
Users using kubeadm should be aware that the kubeadm tool stores the host's CRI socket in the
170+
`/var/lib/kubelet/instance-config.yaml` file on each node. You can create this `/var/lib/kubelet/instance-config.yaml` file on the node.
176171
177-
```shell
178-
kubectl edit no <node-name>
179-
```
172+
The `/var/lib/kubelet/instance-config.yaml` file allows setting the `containerRuntimeEndpoint` parameter.
180173
181-
<!--
182-
This will start a text editor where you can edit the Node object.
183-
To choose a text editor you can set the `KUBE_EDITOR` environment variable.
184-
185-
- Change the value of `kubeadm.alpha.kubernetes.io/cri-socket` from `/var/run/dockershim.sock`
186-
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
187-
188-
Note that new CRI socket paths must be prefixed with `unix://` ideally.
189-
190-
- Save the changes in the text editor, which will update the Node object.
174+
You can set this parameter's value to the path of your chosen CRI socket (for example `unix:///run/containerd/containerd.sock`).
191175
-->
192-
这一命令会打开一个文本编辑器,供你在其中编辑 Node 对象。
193-
要选择不同的文本编辑器,你可以设置 `KUBE_EDITOR` 环境变量。
194-
195-
- 更改 `kubeadm.alpha.kubernetes.io/cri-socket` 值,将其从
196-
`/var/run/dockershim.sock` 改为你所选择的 CRI 套接字路径
197-
(例如:`unix:///run/containerd/containerd.sock`)。
176+
使用 kubeadm 的用户应注意,kubeadm 工具在每个节点的
177+
`/var/lib/kubelet/instance-config.yaml` 文件中存储主机的
178+
CRI 套接字。你可以在节点上创建这个 `/var/lib/kubelet/instance-config.yaml` 文件。
198179

199-
注意新的 CRI 套接字路径必须带有 `unix://` 前缀。
180+
`/var/lib/kubelet/instance-config.yaml` 文件允许设置
181+
`containerRuntimeEndpoint` 参数。
200182

201-
- 保存文本编辑器中所作的修改,这会更新 Node 对象。
183+
你可以将此参数的值设置为你所选择的 CRI
184+
套接字的路径(例如 `unix:///run/containerd/containerd.sock`)。
202185

203186
<!--
204187
## Restart the kubelet

content/zh-cn/docs/tasks/configure-pod-container/assign-pod-level-resources.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: 分配 Pod 级别 CPU 和内存资源
33
content_type: task
44
weight: 30
5-
min-kubernetes-server-version: 1.32
5+
min-kubernetes-server-version: 1.34
66
---
77
<!--
88
title: Assign Pod-level CPU and memory resources
99
content_type: task
1010
weight: 30
11-
min-kubernetes-server-version: 1.32
11+
min-kubernetes-server-version: 1.34
1212
-->
1313

1414
<!-- overview -->
@@ -73,6 +73,37 @@ for your control plane and for all nodes in your cluster.
7373
你必须为集群中的控制平面和所有节点启用 `PodLevelResources`
7474
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
7575

76+
<!--
77+
## Limitations
78+
79+
For Kubernetes {{< skew currentVersion >}}, resizing pod-level resources has the
80+
following limitations:
81+
-->
82+
## 限制 {#limitations}
83+
84+
对于 Kubernetes {{< skew currentVersion >}},调整 Pod 级别资源的大小有以下限制:
85+
86+
<!--
87+
* **Resource Types:** Only CPU, memory and hugepages resources can be specified at pod-level.
88+
* **Operating System:** Pod-level resources are not supported for Windows
89+
pods.
90+
* **Resource Managers:** The Topology Manager, Memory Manager and CPU Manager do not
91+
align pods and containers based on pod-level resources as these resource managers
92+
don't currently support pod-level resources.
93+
* **[In-Place
94+
Resize](https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/):**
95+
In-place resize of pod-level resources is not supported. Modifying the pod-level resource
96+
limits or requests on a pod result in a field.Forbidden error. The error message
97+
explicitly states, "pods with pod-level resources cannot be resized."
98+
-->
99+
* **资源类型:** 仅支持在 Pod 级别指定 CPU、内存和大页内存资源。
100+
* **操作系统:** Windows Pod 不支持 Pod 级别资源。
101+
* **资源管理器:** 拓扑管理器、内存管理器和 CPU 管理器不根据 Pod
102+
级别资源对齐 Pod 和容器,因为这些资源管理器目前不支持 Pod 级别资源。
103+
* **[原地调整大小](/zh-cn/docs/tasks/configure-pod-container/resize-container-resources/)**
104+
不支持 Pod 级别资源的原地调整大小。修改 Pod 级别的资源限制或请求会导致
105+
`field.Forbidden` 错误。错误信息明确指出:"pods with pod-level resources cannot be resized"。
106+
76107
<!-- steps -->
77108

78109
<!--

content/zh-cn/docs/tasks/configure-pod-container/assign-resources/allocate-devices-dra.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: 使用 DRA 为工作负载分配设备
33
content_type: task
4-
min-kubernetes-server-version: v1.32
4+
min-kubernetes-server-version: v1.34
55
weight: 20
66
---
77
<!--
88
title: Allocate Devices to Workloads with DRA
99
content_type: task
10-
min-kubernetes-server-version: v1.32
10+
min-kubernetes-server-version: v1.34
1111
weight: 20
1212
-->
1313

@@ -25,10 +25,10 @@ with DRA terminology like
2525
For more information, see
2626
[Dynamic Resource Allocation (DRA)](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/).
2727
-->
28-
本文介绍如何使用**动态资源分配(DRA)**为 Pod 分配设备。
28+
本文介绍如何使用**动态资源分配(DRA)** 为 Pod 分配设备。
2929
这些指示说明面向工作负载运维人员。在阅读本文之前,请先了解 DRA 的工作原理以及相关术语,例如
30-
{{< glossary_tooltip text="ResourceClaims" term_id="resourceclaim" >}} 和
31-
{{< glossary_tooltip text="ResourceClaimTemplates" term_id="resourceclaimtemplate" >}}。
30+
{{< glossary_tooltip text="ResourceClaim" term_id="resourceclaim" >}} 和
31+
{{< glossary_tooltip text="ResourceClaimTemplate" term_id="resourceclaimtemplate" >}}。
3232
更多信息参阅[动态资源分配(DRA)](/zh-cn/docs/concepts/scheduling-eviction/dynamic-resource-allocation/)
3333

3434
<!-- body -->
@@ -113,7 +113,7 @@ create a ResourceClaim, do one of the following:
113113
## 申领资源 {#claim-resources}
114114

115115
你可以通过
116-
{{< glossary_tooltip text="ResourceClaims" term_id="resourceclaim" >}}
116+
{{< glossary_tooltip text="ResourceClaim" term_id="resourceclaim" >}}
117117
请求某个 DeviceClass 的资源。要创建 ResourceClaim,可以采用以下方式之一:
118118

119119
<!--
@@ -270,6 +270,31 @@ claims in different containers.
270270
kubectl apply -f https://k8s.io/examples/dra/dra-example-job.yaml
271271
```
272272

273+
<!--
274+
Try the following troubleshooting steps:
275+
276+
1. When the workload does not start as expected, drill down from Job
277+
to Pods to ResourceClaims and check the objects
278+
at each level with `kubectl describe` to see whether there are any
279+
status fields or events which might explain why the workload is
280+
not starting.
281+
1. When creating a Pod fails with `must specify one of: resourceClaimName,
282+
resourceClaimTemplateName`, check that all entries in `pod.spec.resourceClaims`
283+
have exactly one of those fields set. If they do, then it is possible
284+
that the cluster has a mutating Pod webhook installed which was built
285+
against APIs from Kubernetes < 1.32. Work with your cluster administrator
286+
to check this.
287+
-->
288+
尝试以下故障排查步骤:
289+
290+
1. 当工作负载未如预期启动时,从 Job 到 Pod 再到 ResourceClaim 逐步深入检查,
291+
并使用 `kubectl describe` 检查每个层级的对象,
292+
查看是否有状态字段或事件可以解释工作负载为何没有启动。
293+
2. 当创建 Pod 失败并显示 `must specify one of:resourceClaimName, resourceClaimTemplateName` 时,
294+
检查 `pod.spec.resourceClaims` 中的所有条目是否正好设置了这些字段之一。如果是这样,
295+
那么可能是集群安装了一个针对 Kubernetes < 1.32 的 API 构建的 Pod 变更 Webhook。
296+
请与你的集群管理员合作检查这个问题。
297+
273298
<!--
274299
## Clean up {#clean-up}
275300

0 commit comments

Comments
 (0)