Merge pull request #49076 from my-git9/pp-12725

[zh-cn]sync labels-annotations-taints/_index.md
This commit is contained in:
Kubernetes Prow Robot 2024-12-16 03:36:51 +01:00 committed by GitHub
commit c48b27cb39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 71 additions and 37 deletions

View File

@ -298,7 +298,7 @@ of the group-kinds, in the fully-qualified name format, i.e. `<resource>.<group>
规范的部分功能用来实现[在 kubectl 中基于 ApplySet 的删除](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune)。
此注解应用于父对象,这些父对象用于跟踪 ApplySet 以优化 ApplySet 成员对象列表。
它在 AppySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
它在 ApplySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
然而,对于 Kubernetes {{< skew currentVersion >}} 版本,它是 kubectl 必需的。
当存在时,注解的值必须是一个以逗号分隔的 group-kinds 列表,采用完全限定的名称格式,例如 `<resource>.<group>`
@ -340,7 +340,7 @@ of the group-kinds, in the fully-qualified name format, i.e. `<resource>.<group>
规范的部分功能用来实现[在 kubectl 中基于 ApplySet 的删除](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune)。
此注解应用于父对象,这些父对象用于跟踪 ApplySet 以优化 ApplySet 成员对象列表。
它在 AppySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
它在 ApplySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
然而,对于 Kubernetes {{< skew currentVersion >}} 版本,它是 kubectl 必需的。
当存在时,注解的值必须是一个以逗号分隔的 group-kinds 列表,采用完全限定的名称格式,例如 `<resource>.<group>`
@ -380,7 +380,7 @@ CustomResourceDefinition 打了 `applyset.kubernetes.io/is-parent-type` 标签
规范的部分功能用来实现[在 kubectl 中基于 ApplySet 的删除](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune)。
此注解应用于父对象,这些父对象用于跟踪 ApplySet 以优化 ApplySet 成员对象列表。
它在 AppySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
它在 ApplySet 规范中是可选的,因为工具可以执行发现或使用不同的优化。
然而,对于 Kubernetes {{< skew currentVersion >}} 版本,它是 kubectl 必需的。
当存在时,注解的值必须是一个以逗号分隔的 group-kinds 列表,采用完全限定的名称格式,例如 `<resource>.<group>`
@ -430,9 +430,9 @@ There is no relation between the value of this label and object UID.
打了 `applyset.kubernetes.io/is-parent-type` 标签,那么你可以在 Secret、ConfigMap 或自定义资源上使用此注解。
规范的部分功能用来实现[在 kubectl 中基于 ApplySet 的删除](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune)。
此标签使对象成为 AppySet 父对象。
此标签使对象成为 ApplySet 父对象。
它的值是 ApplySet 的唯一 ID该 ID 派生自父对象本身的标识。
该 ID **必须** 是所在对象的 group-kind-name-namespace 的 hash 的 base64 编码(使用 RFC4648 的 URL 安全编码),
该 ID **必须**是所在对象的 group-kind-name-namespace 的 hash 的 base64 编码(使用 RFC4648 的 URL 安全编码),
格式为:`<base64(sha256(<name>.<namespace>.<kind>.<group>))>`。
此标签的值与对象 UID 之间没有关系。
@ -530,7 +530,7 @@ The value must be in the format `<toolname>/<semver>`.
打了 `applyset.kubernetes.io/is-parent-type` 标签,那么你可以在 Secret、ConfigMap 或自定义资源上使用此注解。
规范的部分功能用来实现[在 kubectl 中基于 ApplySet 的删除](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune)。
此注解应用于父对象,这些父对象用于跟踪 ApplySet 以指示哪个工具管理 AppySet。
此注解应用于父对象,这些父对象用于跟踪 ApplySet 以指示哪个工具管理 ApplySet。
工具应该拒绝改变属于其他工具 ApplySets。
该值必须采用 `<toolname>/<semver>` 格式。
@ -655,7 +655,7 @@ For example, Kustomize removes objects with this annotation from its final build
当值为 `"false"` 时,可以用来声明该对象应提交到 API 服务器,即使它是本地对象。
该注解是 Kubernetes 资源模型 (KRM) 函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
该注解是 Kubernetes 资源模型KRM函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
例如Kustomize 会从其最终构建输出中删除带有此注解的对象。
<!--
@ -709,13 +709,13 @@ A KRM function **must not** modify annotations with this prefix, unless otherwis
given annotation. This enables orchestrator tools to add additional internal annotations, without
requiring changes to existing functions.
-->
### internal.config.kubernetes.io/* (保留的前缀) {#internal.config.kubernetes.io-reserved-wildcard}
### internal.config.kubernetes.io/*(保留的前缀) {#internal.config.kubernetes.io-reserved-wildcard}
类别:注解
用于:所有对象
该前缀被保留,供遵从 Kubernetes 资源模型 (KRM) 函数规范的编排工具内部使用。
该前缀被保留,供遵从 Kubernetes 资源模型KRM函数规范的编排工具内部使用。
带有该前缀的注解仅在编排过程中使用,不会持久化到文件系统。
换句话说,编排工具应从本地文件系统读取文件时设置这些注解,并在将函数输出写回文件系统时删除它们。
@ -752,7 +752,7 @@ referenced files. A KRM Function **may** include this annotation on objects it g
此注解记录了加载对象清单文件的(斜线分隔、与操作系统无关)相对路径。
该路径相对于文件系统上由编排工具确定的固定位置。
该注解是 Kubernetes 资源模型 (KRM) 函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
该注解是 Kubernetes 资源模型KRM函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
KRM 函数**不应**在输入对象上修改此注解,除非它正在修改引用的文件。
KRM 函数**可以**在它所生成的对象上包含这个注解。
@ -1114,10 +1114,10 @@ referenced files. A KRM Function **may** include this annotation on objects it g
用于:所有对象
该注解记录了包含对象的 YAML 文档在加载对象的清单文件中的零索引位置。
请注意YAML 文档由三个破折号 (---) 分隔,每个文档可以包含一个对象。
请注意YAML 文档由三个破折号---分隔,每个文档可以包含一个对象。
如果未指定此注解,则该值为 0。
该注解是 Kubernetes 资源模型 (KRM) 函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
该注解是 Kubernetes 资源模型KRM函数规范的一部分,被 Kustomize 和其他类似的第三方工具使用。
KRM 函数**不应**在输入对象上修改此注解,除非它正在修改引用的文件。
KRM 函数**可以**在它所生成的对象上包含这个注解。
@ -1581,19 +1581,15 @@ This annotation is used for describing specific behaviour of given object.
此注解用于描述给定对象的特定行为。
<!--
### kubernetes.io/enforce-mountable-secrets {#enforce-mountable-secrets}
### kubernetes.io/enforce-mountable-secrets (deprecated) {#enforce-mountable-secrets}
Type: Annotation
Example: `kubernetes.io/enforce-mountable-secrets: "true"`
Used on: ServiceAccount
The value for this annotation must be **true** to take effect.
When you set this annotation to "true", Kubernetes enforces the following rules for
Pods running as this ServiceAccount:
-->
### kubernetes.io/enforce-mountable-secrets {#enforce-mountable-secrets}
### kubernetes.io/enforce-mountable-secrets已弃用 {#enforce-mountable-secrets}
类别:注解
@ -1601,6 +1597,19 @@ Pods running as this ServiceAccount:
用于ServiceAccount
{{< note >}}
<!--
`kubernetes.io/enforce-mountable-secrets` is deprecated since Kubernetes v1.32. Use separate namespaces to isolate access to mounted secrets.
-->
`kubernetes.io/enforce-mountable-secrets` 自 Kubernetes v1.32 起已弃用。
使用单独的命名空间来隔离对挂载 Secret 的访问。
{{< /note >}}
<!--
The value for this annotation must be **true** to take effect.
When you set this annotation to "true", Kubernetes enforces the following rules for
Pods running as this ServiceAccount:
-->
此注解的值必须为 **true** 才能生效。
当你将此注解设置为 "true" 时Kubernetes 会对以此 ServiceAccount 运行的 Pod 强制执行以下规则:
@ -2789,6 +2798,34 @@ Starting in v1.18, this annotation is deprecated in favor of `spec.ingressClassN
从 v1.18 开始,此注解被弃用,改为鼓励使用 `spec.ingressClassName`
{{</note>}}
<!--
### kubernetes.io/cluster-service (deprecated) {#kubernetes-io-cluster-service}
Type: Label
Example: `kubernetes.io/cluster-service: "true"`
Used on: Service
-->
### kubernetes.io/cluster-service已弃用 {#kubernetes-io-cluster-service}
类别Label
例子:`kubernetes.io/cluster-service: "true"`
用于Service
<!--
This label indicates that the Service provides a service to the cluster, if the value is set to true.
When you run `kubectl cluster-info`, the tool queries for Services with this label set to true.
However, setting this label on any Service is deprecated.
-->
此标签表示当值设置为 `true`Service 向集群提供服务。
当你运行 `kubectl cluster-info` 时,该工具会查询具有此标签且值为 `true` 的 Service。
然而,在此任何 Service 上设置此标签已弃用。
<!--
### storageclass.kubernetes.io/is-default-class
@ -3494,10 +3531,8 @@ Example: `node.kubernetes.io/out-of-service:NoExecute`
Used on: Node
A user can manually add the taint to a Node marking it out-of-service.
If the `NodeOutOfServiceVolumeDetach`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
is enabled on `kube-controller-manager`, and a Node is marked out-of-service with this taint,
the Pods on the node will be forcefully deleted if there are no matching tolerations on it and
If a Node is marked out-of-service with this taint, the Pods on the node
will be forcefully deleted if there are no matching tolerations on it and
volume detach operations for the Pods terminating on the node will happen immediately.
This allows the Pods on the out-of-service node to recover quickly on a different node.
-->
@ -3507,11 +3542,10 @@ This allows the Pods on the out-of-service node to recover quickly on a differen
用于Node
用户可以手动将污点添加到节点,将其标记为停止服务。
如果 `kube-controller-manager` 上启用了 `NodeOutOfServiceVolumeDetach`
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
并且一个节点被这个污点标记为停止服务,如果节点上的 Pod 没有对应的容忍度,
这类 Pod 将被强制删除,并且,针对在节点上被终止 Pod 的卷分离操作将被立即执行。
用户可以手动将污点添加到节点,标记其为停止服务。
如果一个节点被这个污点标记为停止服务,则该节点上的 Pod 将会在没有匹配的容忍时被强制删除,
并且针对在此节点上终止的 Pod 的卷分离操作将立即发生。
这允许停止服务的节点上的 Pod 快速在不同节点上恢复。
{{< caution >}}
<!--
@ -3596,7 +3630,7 @@ For details, see the [customization guide](https://kubernetes-sigs.github.io/nod
所有内置的标签都使用 feature.node.kubernetes.io 标签命名空间,并且格式为
`feature.node.kubernetes.io/<feature-name>: <true>`
NFD 有许多用于创建特定于供应商和应用程序的标签的扩展点。
有关详细信息,请参阅[定制资源](https://kubernetes-sigs.github.io/node-feature-discovery/v0.12/usage/customization-guide).
有关详细信息,请参阅[定制资源](https://kubernetes-sigs.github.io/node-feature-discovery/v0.12/usage/customization-guide)
<!--
### nfd.node.kubernetes.io/master.version
@ -3620,8 +3654,8 @@ It is used for informative use only.
用于:节点
对于调度 NFD-[master](https://kubernetes-sigs.github.io/node-feature-discovery/stable/usage/nfd-master.html)的节点,
此注解记录 NFD-master 的版本。它仅用于提供信息。
对于调度 NFD-[master](https://kubernetes-sigs.github.io/node-feature-discovery/stable/usage/nfd-master.html)
的节点,此注解记录 NFD-master 的版本。它仅用于提供信息。
<!--
### nfd.node.kubernetes.io/worker.version
@ -3669,7 +3703,7 @@ NFD uses this for an internal mechanism. You should not edit this annotation you
用于:节点
此注解记录由 [Node Feature Discovery](https://kubernetes-sigs.github.io/node-feature-discovery/) (NFD)
此注解记录由 [Node Feature Discovery](https://kubernetes-sigs.github.io/node-feature-discovery/)NFD
管理的以逗号分隔的节点特性标签列表。NFD 将其用于内部机制。你不应该自己编辑这个注解。
<!--
@ -3694,7 +3728,7 @@ NFD uses this for an internal mechanism. You should not edit this annotation you
用于:节点
此注解记录由 [Node Feature Discovery](https://kubernetes-sigs.github.io/node-feature-discovery/) (NFD)
此注解记录由 [Node Feature Discovery](https://kubernetes-sigs.github.io/node-feature-discovery/)NFD
管理的以逗号分隔的[扩展资源](/zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources)列表。
NFD 将其用于内部机制。你不应该自己编辑这个注解。
@ -3727,7 +3761,7 @@ These Node Feature Discovery (NFD) labels or annotations only apply to
the nodes where NFD is running. To learn more about NFD and
its components go to its official [documentation](https://kubernetes-sigs.github.io/node-feature-discovery/stable/get-started/).
-->
这些节点特性发现Node Feature Discovery, NFD的标签或注解仅适用于运行 NFD 的节点。
这些节点特性发现Node Feature DiscoveryNFD的标签或注解仅适用于运行 NFD 的节点。
要了解关于 NFD 及其组件的信息,
请访问官方[文档](https://kubernetes-sigs.github.io/node-feature-discovery/stable/get-started/)。
{{< /note >}}
@ -3910,7 +3944,7 @@ timeout in seconds.
用于Service
如果你为 `type: LoadBalancer`服务配置[连接排空](#service-beta-kubernetes-io-aws-load-balancer-connection-draining-enabled)
如果你为 `type: LoadBalancer` Service 配置[连接排空](#service-beta-kubernetes-io-aws-load-balancer-connection-draining-enabled)
且你使用 AWS 云服务,则集成机制将根据此注解来配置排空期。
你所设置的值决定了排空超时秒数。
@ -4459,7 +4493,7 @@ There are two permitted values:
-->
示例:`service.beta.kubernetes.io/aws-load-balancer-type: external`
Kubernetes 官方与 AWS 的集成使用此注解来决定 AWS 云提供商是否应管理 `type: LoadBalancer`服务
Kubernetes 官方与 AWS 的集成使用此注解来决定 AWS 云提供商是否应管理 `type: LoadBalancer` Service
有两个允许的值:
@ -4487,7 +4521,7 @@ and your cluster has a working deployment of the AWS Load Balancer controller,
then the AWS Load Balancer controller attempts to deploy a load balancer based
on the Service specification.
-->
如果你在 AWS 上部署 `type: LoadBalancer`服务,并且没有设置任何
如果你在 AWS 上部署 `type: LoadBalancer` Service,并且没有设置任何
`service.beta.kubernetes.io/aws-load-balancer-type` 注解AWS 集成将部署经典的弹性负载均衡器。
这种行为是不带注解的默认行为,除非你另有指定。
@ -4570,7 +4604,7 @@ for more information.
值**必须**是 `privileged`、`baseline` 或 `restricted` 之一,它们对应于
[Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards) 级别。
特别地,`enforce` 标签 **禁止** 在带标签的 Namespace 中创建任何不符合指示级别要求的 Pod。
特别地,`enforce` 标签**禁止**在带标签的 Namespace 中创建任何不符合指示级别要求的 Pod。
请请参阅[在名字空间级别实施 Pod 安全性](/zh-cn/docs/concepts/security/pod-security-admission)了解更多信息。