Skip to content

Commit 4120345

Browse files
authored
[zh-cn]sync workload-resources/pod-v1.md task-4 (#40111)
Signed-off-by: xin.li <[email protected]>
1 parent ab362ea commit 4120345

File tree

1 file changed

+240
-11
lines changed
  • content/zh-cn/docs/reference/kubernetes-api/workload-resources

1 file changed

+240
-11
lines changed

content/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1.md

Lines changed: 240 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ PodSpec 是对 Pod 的描述。
498498
<!--
499499
- **topologySpreadConstraints.whenUnsatisfiable** (string), required
500500
501-
WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,
501+
WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint.
502+
- DoNotSchedule (default) tells the scheduler not to schedule it.
503+
- ScheduleAnyway tells the scheduler to schedule the pod in any location,
502504
but giving higher precedence to topologies that would help reduce the
503505
skew.
504506
A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assignment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.
@@ -592,7 +594,7 @@ PodSpec 是对 Pod 的描述。
592594
593595
NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
594596
595-
If this value is nil, the behavior is equivalent to the Honor policy. This is a alpha-level feature enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
597+
If this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
596598
-->
597599
598600
- **topologySpreadConstraints.nodeAffinityPolicy** (string)
@@ -603,14 +605,14 @@ PodSpec 是对 Pod 的描述。
603605
- Ignore:nodeAffinity/nodeSelector 被忽略。所有节点均包括到计算中。
604606
605607
如果此值为 nil,此行为等同于 Honor 策略。
606-
这是通过 NodeInclusionPolicyInPodTopologySpread 特性标志启用的 Alpha 级别特性。
608+
这是通过 NodeInclusionPolicyInPodTopologySpread 特性标志默认启用的 Beta 级别特性。
607609
608610
<!--
609611
- **topologySpreadConstraints.nodeTaintsPolicy** (string)
610612
611613
NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.
612614
613-
If this value is nil, the behavior is equivalent to the Ignore policy. This is a alpha-level feature enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
615+
If this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
614616
-->
615617
- **topologySpreadConstraints.nodeTaintsPolicy** (string)
616618
@@ -619,7 +621,7 @@ PodSpec 是对 Pod 的描述。
619621
- Ignore:节点污点被忽略。包括所有节点。
620622
621623
如果此值为 nil,此行为等同于 Ignore 策略。
622-
这是通过 NodeInclusionPolicyInPodTopologySpread 特性标志启用的 Alpha 级别特性。
624+
这是通过 NodeInclusionPolicyInPodTopologySpread 特性标志默认启用的 Beta 级别特性。
623625
624626
<!--
625627
- **overhead** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
@@ -990,14 +992,19 @@ PodSpec 是对 Pod 的描述。
990992
<!--
991993
- **securityContext.supplementalGroups** ([]int64)
992994
993-
A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.
995+
A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.
994996
-->
995997
996998
- **securityContext.supplementalGroups** ([]int64)
999+
1000+
此字段包含将应用到每个容器中运行的第一个进程的组列表。
1001+
容器进程的组成员身份取决于容器的主 GID、fsGroup(如果指定了的话)
1002+
和在容器镜像中为容器进程的 uid 定义的组成员身份,以及这里所给的列表。
9971003
998-
在容器的主 GID 之外,应用于每个容器中运行的第一个进程的组列表。
999-
如果未设置此字段,则不会向任何容器添加额外的组。
1000-
注意,`spec.os.name` 为 "windows" 时不能设置此字段。
1004+
如果未指定,则不会向任何容器添加其他组。
1005+
注意,在容器镜像中为容器进程的 uid 定义的组成员身份仍然有效,
1006+
即使它们未包含在此列表中也是如此。
1007+
注意,当 `spec.os.name` 为 `windows` 时,不能设置此字段。
10011008
10021009
<!--
10031010
- **securityContext.fsGroup** (int64)
@@ -1252,6 +1259,149 @@ PodSpec 是对 Pod 的描述。
12521259
设置为 false 对于缓解容器逃逸漏洞非常有用,可防止允许实际在主机上没有 root 特权的用户以 root 运行他们的容器。
12531260
此字段是 Alpha 级别的字段,只有启用 UserNamespacesSupport 特性的服务器才能使用此字段。
12541261
1262+
<!--
1263+
- **resourceClaims** ([]PodResourceClaim)
1264+
1265+
*Patch strategies: retainKeys, merge on key `name`*
1266+
1267+
*Map: unique values on key name will be kept during a merge*
1268+
-->
1269+
- **resourceClaims** ([]PodResourceClaim)
1270+
1271+
**补丁策略:retainKeys,基于键 `name` 合并**
1272+
1273+
**映射:键 `name` 的唯一值将在合并过程中保留**
1274+
1275+
<!--
1276+
ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.
1277+
1278+
This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
1279+
1280+
This field is immutable.
1281+
-->
1282+
resourceClaims 定义了在允许 Pod 启动之前必须分配和保留哪些 ResourceClaims。
1283+
这些资源将可供那些按名称使用它们的容器使用。
1284+
1285+
这是一个 Alpha 特性的字段,需要启用 DynamicResourceAllocation 特性门控来开启此功能。
1286+
1287+
此字段不可变更。
1288+
1289+
<a name="PodResourceClaim"></a>
1290+
<!--
1291+
*PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.*
1292+
-->
1293+
**PodResourceClaim 通过 ClaimSource 引用一个 ResourceClaim。
1294+
它为 ClaimSource 添加一个名称,作为 Pod 内 ResourceClaim 的唯一标识。
1295+
需要访问 ResourceClaim 的容器可使用此名称引用它。**
1296+
1297+
<!--
1298+
- **resourceClaims.name** (string), required
1299+
1300+
Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.
1301+
1302+
- **resourceClaims.source** (ClaimSource)
1303+
1304+
Source describes where to find the ResourceClaim.
1305+
-->
1306+
- **resourceClaims.name** (string), 必需
1307+
1308+
在 Pod 中,`name` 是此资源声明的唯一标识。此字段值必须是 DNS_LABEL。
1309+
1310+
- **resourceClaims.source** (ClaimSource)
1311+
1312+
`source` 描述了在哪里可以找到 `resourceClaim`。
1313+
1314+
<a name="ClaimSource"></a>
1315+
<!--
1316+
*ClaimSource describes a reference to a ResourceClaim.
1317+
1318+
Exactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.*
1319+
-->
1320+
1321+
**ClaimSource 描述对 ResourceClaim 的引用。**
1322+
1323+
**应该设置且仅设置如下字段之一。此类型的消费者必须将空对象视为具有未知值。**
1324+
1325+
<!--
1326+
- **resourceClaims.source.resourceClaimName** (string)
1327+
1328+
ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.
1329+
1330+
- **resourceClaims.source.resourceClaimTemplateName** (string)
1331+
1332+
ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.
1333+
-->
1334+
1335+
- **resourceClaims.source.resourceClaimName** (string)
1336+
1337+
resourceClaimName 是与此 Pod 位于同一命名空间中的 ResourceClaim 对象的名称。
1338+
1339+
- **resourceClaims.source.resourceClaimTemplateName** (string)
1340+
1341+
resourceClaimTemplateName 是与此 Pod 位于同一命名空间中的 `ResourceClaimTemplate` 对象的名称。
1342+
1343+
<!--
1344+
The template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be \<pod name>-\<resource name>, where \<resource name> is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long).
1345+
-->
1346+
1347+
该模板将用于创建一个新的 ResourceClaim,新的 ResourceClaim 将被绑定到此 Pod。
1348+
删除此 Pod 时,ResourceClaim 也将被删除。ResourceClaim
1349+
的名称将为 \<Pod 名称>-\<资源名称>,其中 \<资源名称>
1350+
是 PodResourceClaim.name。如果串接起来的名称对于 ResourceClaim
1351+
无效(例如太长),Pod 的验证机制将拒绝该 Pod。
1352+
1353+
<!--
1354+
An existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed.
1355+
-->
1356+
1357+
不属于此 Pod 但与此名称重名的现有 ResourceClaim 不会被用于此 Pod,
1358+
以避免错误地使用不相关的资源。Pod 的调度和启动动作会因此而被阻塞,
1359+
直到不相关的 ResourceClaim 被删除。
1360+
1361+
<!--
1362+
This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.
1363+
-->
1364+
1365+
此字段是不可变更的,创建 ResourceClaim 后控制平面不会对相应的 ResourceClaim 进行任何更改。
1366+
<!--
1367+
- **schedulingGates** ([]PodSchedulingGate)
1368+
1369+
*Patch strategy: merge on key `name`*
1370+
1371+
*Map: unique values on key name will be kept during a merge*
1372+
-->
1373+
- **schedulingGates** ([]PodSchedulingGate)
1374+
1375+
**补丁策略:基于 `name` 键合并**
1376+
1377+
**映射:键 `name` 的唯一值将在合并过程中保留**
1378+
1379+
<!--
1380+
SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.
1381+
1382+
This is an alpha-level feature enabled by PodSchedulingReadiness feature gate.
1383+
-->
1384+
1385+
schedulingGates 是一个不透明的值列表,如果指定,将阻止调度 Pod。
1386+
更多信息,请参阅:https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness。
1387+
1388+
此特性为 Alpha 级别,需要通过 PodSchedulingReadiness 特性门控启用。
1389+
1390+
<a name="PodSchedulingGate"></a>
1391+
<!--
1392+
*PodSchedulingGate is associated to a Pod to guard its scheduling.*
1393+
1394+
- **schedulingGates.name** (string), required
1395+
1396+
Name of the scheduling gate. Each scheduling gate must have a unique name field.
1397+
-->
1398+
PodSchedulingGate 与 Pod 相关联以保护其调度。
1399+
1400+
- **schedulingGates.name** (string),必需
1401+
1402+
调度门控的名称,每个调度门控的 `name` 字段取值必须唯一。
1403+
1404+
12551405
<!--
12561406
### Deprecated
12571407
@@ -1846,6 +1996,46 @@ A single application container that you want to run within a pod.
18461996
18471997
ResourceRequirements 描述计算资源需求。
18481998
1999+
<!--
2000+
- **resources.claims** ([]ResourceClaim)
2001+
2002+
*Set: unique values will be kept during a merge*
2003+
2004+
Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
2005+
-->
2006+
2007+
- **resources.claims** ([]ResourceClaim)
2008+
2009+
**set:合并期间将保留唯一值**
2010+
2011+
claims 列出此容器使用的资源名称,资源名称在 `spec.resourceClaims` 中定义。
2012+
2013+
<!--
2014+
This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
2015+
2016+
This field is immutable.
2017+
-->
2018+
2019+
这是一个 Alpha 特性字段,需要启用 DynamicResourceAllocation 功能门控开启此特性。
2020+
2021+
此字段不可变更。
2022+
2023+
<a name="ResourceClaim"></a>
2024+
<!--
2025+
*ResourceClaim references one entry in PodSpec.ResourceClaims.*
2026+
2027+
- **resources.claims.name** (string), required
2028+
2029+
Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
2030+
-->
2031+
2032+
**ResourceClaim 引用 `PodSpec.resourceClaims` 中的一项。**
2033+
2034+
- **resources.claims.name** (string),必需
2035+
2036+
`name` 必须与使用该字段 Pod 的 `pod.spec.resourceClaims`
2037+
中的一个条目的名称相匹配。它使该资源在容器内可用。
2038+
18492039
<!--
18502040
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
18512041
@@ -3256,6 +3446,45 @@ EphemeralContainer 是一个临时容器,你可以将其添加到现有 Pod
32563446
32573447
**ResourceRequirements 描述计算资源的需求。**
32583448
3449+
<!--
3450+
- **resources.claims** ([]ResourceClaim)
3451+
3452+
*Set: unique values will be kept during a merge*
3453+
3454+
Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
3455+
-->
3456+
3457+
- **resources.claims** ([]ResourceClaim)
3458+
3459+
**set:合并期间将保留唯一值**
3460+
3461+
claims 列出了此容器使用的资源名称,资源名称在 `spec.resourceClaims` 中定义。
3462+
3463+
<!--
3464+
This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
3465+
3466+
This field is immutable.
3467+
-->
3468+
3469+
这是一个 Alpha 特性字段,需要启用 DynamicResourceAllocation 功能门控开启此特性。
3470+
3471+
此字段不可变更。
3472+
3473+
<a name="ResourceClaim"></a>
3474+
<!--
3475+
*ResourceClaim references one entry in PodSpec.ResourceClaims.*
3476+
3477+
- **resources.claims.name** (string), required
3478+
3479+
Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
3480+
-->
3481+
**ResourceClaim 引用 `PodSpec.ResourceClaims` 中的一项。**
3482+
3483+
- **resources.claims.name** (string),必需
3484+
3485+
`name` 必须与使用该字段 Pod 的 `pod.spec.resourceClaims`
3486+
中的一个条目的名称相匹配。它使该资源在容器内可用。
3487+
32593488
<!--
32603489
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
32613490
@@ -5414,7 +5643,7 @@ PodStatus 表示有关 Pod 状态的信息。状态内容可能会滞后于系
54145643
54155644
<a name="ContainerState"></a>
54165645
*ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.*
5417-
-->
5646+
-->
54185647
- **ephemeralContainerStatuses.state** (ContainerState)
54195648
54205649
有关容器当前状况的详细信息。
@@ -5584,7 +5813,7 @@ PodStatus 表示有关 Pod 状态的信息。状态内容可能会滞后于系
55845813
55855814
<a name="ContainerState"></a>
55865815
*ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.*
5587-
-->
5816+
-->
55885817
- **ephemeralContainerStatuses.lastState** (ContainerState)
55895818
55905819
有关容器的上次终止状况的详细信息。

0 commit comments

Comments
 (0)