Skip to content

Commit fc410a7

Browse files
committed
[zh-cn] sync workloads/controllers/* labels-annotations-taints/_index.md
Signed-off-by: xin.li <[email protected]>
1 parent 50a57a4 commit fc410a7

File tree

6 files changed

+31
-70
lines changed

6 files changed

+31
-70
lines changed

content/zh-cn/docs/concepts/workloads/controllers/cron-jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This example CronJob manifest prints the current time and a hello message every
7777

7878
下面的 CronJob 示例清单会在每分钟打印出当前时间和问候消息:
7979

80-
{{< codenew file="application/job/cronjob.yaml" >}}
80+
{{% code file="application/job/cronjob.yaml" %}}
8181

8282
<!--
8383
([Running Automated Tasks with a CronJob](/docs/tasks/job/automated-tasks-with-cron-jobs/)

content/zh-cn/docs/concepts/workloads/controllers/daemonset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describes a DaemonSet that runs the fluentd-elasticsearch Docker image:
7373
你可以在 YAML 文件中描述 DaemonSet。
7474
例如,下面的 daemonset.yaml 文件描述了一个运行 fluentd-elasticsearch Docker 镜像的 DaemonSet:
7575

76-
{{< codenew file="controllers/daemonset.yaml" >}}
76+
{{% code file="controllers/daemonset.yaml" %}}
7777

7878
<!--
7979
Create a DaemonSet based on the YAML file:

content/zh-cn/docs/concepts/workloads/controllers/job.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ It takes around 10s to complete.
7373
下面是一个 Job 配置示例。它负责计算 π 到小数点后 2000 位,并将结果打印出来。
7474
此计算大约需要 10 秒钟完成。
7575

76-
{{< codenew file="controllers/job.yaml" >}}
76+
{{% code file="controllers/job.yaml" %}}
7777

7878
<!--
7979
You can run the example with this command:
@@ -692,7 +692,7 @@ Here is a manifest for a Job that defines a `podFailurePolicy`:
692692
-->
693693
下面是一个定义了 `podFailurePolicy` 的 Job 的清单:
694694

695-
{{< codenew file="/controllers/job-pod-failure-policy-example.yaml" >}}
695+
{{% code file="/controllers/job-pod-failure-policy-example.yaml" %}}
696696

697697
<!--
698698
In the example above, the first rule of the Pod failure policy specifies that
@@ -1443,52 +1443,17 @@ mismatch.
14431443

14441444
{{< feature-state for_k8s_version="v1.26" state="stable" >}}
14451445

1446-
{{< note >}}
1447-
<!--
1448-
The control plane doesn't track Jobs using finalizers, if the Jobs were created
1449-
when the feature gate `JobTrackingWithFinalizers` was disabled, even after you
1450-
upgrade the control plane to 1.26.
1451-
-->
1452-
如果 Job 是在特性门控 `JobTrackingWithFinalizers` 被禁用时创建的,即使你将控制面升级到 1.26,
1453-
控制面也不会使用 Finalizer 跟踪 Job。
1454-
{{< /note >}}
1455-
14561446
<!--
14571447
The control plane keeps track of the Pods that belong to any Job and notices if
14581448
any such Pod is removed from the API server. To do that, the Job controller
14591449
creates Pods with the finalizer `batch.kubernetes.io/job-tracking`. The
14601450
controller removes the finalizer only after the Pod has been accounted for in
14611451
the Job status, allowing the Pod to be removed by other controllers or users.
1462-
1463-
Jobs created before upgrading to Kubernetes 1.26 or before the feature gate
1464-
`JobTrackingWithFinalizers` is enabled are tracked without the use of Pod
1465-
finalizers.
1466-
The Job {{< glossary_tooltip term_id="controller" text="controller" >}} updates
1467-
the status counters for `succeeded` and `failed` Pods based only on the Pods
1468-
that exist in the cluster. The contol plane can lose track of the progress of
1469-
the Job if Pods are deleted from the cluster.
14701452
-->
14711453
控制面会跟踪属于任何 Job 的 Pod,并通知是否有任何这样的 Pod 被从 API 服务器中移除。
14721454
为了实现这一点,Job 控制器创建的 Pod 带有 Finalizer `batch.kubernetes.io/job-tracking`
14731455
控制器只有在 Pod 被记入 Job 状态后才会移除 Finalizer,允许 Pod 可以被其他控制器或用户移除。
14741456

1475-
在升级到 Kubernetes 1.26 之前或在启用特性门控 `JobTrackingWithFinalizers`
1476-
之前创建的 Job 被跟踪时不使用 Pod Finalizer。
1477-
Job {{< glossary_tooltip term_id="controller" text="控制器" >}}仅根据集群中存在的 Pod
1478-
更新 `succeeded``failed` Pod 的状态计数器。如果 Pod 被从集群中删除,控制面可能无法跟踪 Job 的进度。
1479-
1480-
<!--
1481-
You can determine if the control plane is tracking a Job using Pod finalizers by
1482-
checking if the Job has the annotation
1483-
`batch.kubernetes.io/job-tracking`. You should **not** manually add or remove
1484-
this annotation from Jobs. Instead, you can recreate the Jobs to ensure they
1485-
are tracked using Pod finalizers.
1486-
-->
1487-
你可以根据检查 Job 是否含有 `batch.kubernetes.io/job-tracking` 注解,
1488-
来确定控制面是否正在使用 Pod Finalizer 追踪 Job。
1489-
****应该给 Job 手动添加或删除该注解。
1490-
取而代之的是你可以重新创建 Job 以确保使用 Pod Finalizer 跟踪这些 Job。
1491-
14921457
<!--
14931458
### Elastic Indexed Jobs
14941459
-->

content/zh-cn/docs/concepts/workloads/controllers/replicaset.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Deployment,并在 spec 部分定义你的应用。
113113
-->
114114
## 示例 {#example}
115115

116-
{{< codenew file="controllers/frontend.yaml" >}}
116+
{{% code file="controllers/frontend.yaml" %}}
117117

118118
<!--
119119
Saving this manifest into `frontend.yaml` and submitting it to a Kubernetes cluster will
@@ -263,7 +263,7 @@ Pod,它还可以像前面小节中所描述的那样获得其他 Pod。
263263

264264
以前面的 frontend ReplicaSet 为例,并在以下清单中指定这些 Pod:
265265

266-
{{< codenew file="pods/pod-rs.yaml" >}}
266+
{{% code file="pods/pod-rs.yaml" %}}
267267

268268
<!--
269269
As those Pods do not have a Controller (or any object) as their owner reference and match the selector of the frontend
@@ -668,7 +668,7 @@ ReplicaSet 也可以作为[水平的 Pod 扩缩器 (HPA)](/zh-cn/docs/tasks/run-
668668
的目标。也就是说,ReplicaSet 可以被 HPA 自动扩缩。
669669
以下是 HPA 以我们在前一个示例中创建的副本集为目标的示例。
670670

671-
{{< codenew file="controllers/hpa-rs.yaml" >}}
671+
{{% code file="controllers/hpa-rs.yaml" %}}
672672

673673
<!--
674674
Saving this manifest into `hpa-rs.yaml` and submitting it to a Kubernetes cluster should

content/zh-cn/docs/concepts/workloads/controllers/replicationcontroller.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: ReplicationController
33
content_type: concept
44
weight: 90
5+
description: >-
6+
用于管理可水平扩展的工作负载的旧版 API。
7+
被 Deployment 和 ReplicaSet API 取代。
58
---
69

710
<!--
@@ -11,6 +14,9 @@ reviewers:
1114
title: ReplicationController
1215
content_type: concept
1316
weight: 90
17+
description: >-
18+
Legacy API for managing workloads that can scale horizontally.
19+
Superseded by the Deployment and ReplicaSet APIs.
1420
-->
1521

1622
<!-- overview -->
@@ -34,7 +40,7 @@ always up and available.
3440
<!-- body -->
3541

3642
<!--
37-
## How a ReplicationController Works
43+
## How a ReplicationController works
3844
3945
If there are too many pods, the ReplicationController terminates the extra pods. If there are too few, the
4046
ReplicationController starts more pods. Unlike manually created pods, the pods maintained by a
@@ -75,7 +81,7 @@ This example ReplicationController config runs three copies of the nginx web ser
7581

7682
这个示例 ReplicationController 配置运行 nginx Web 服务器的三个副本。
7783

78-
{{< codenew file="controllers/replication.yaml" >}}
84+
{{% code file="controllers/replication.yaml" %}}
7985

8086
<!--
8187
Run the example job by downloading the example file and then running this command:
@@ -608,4 +614,3 @@ ReplicationController。
608614
- 了解 [Depolyment](/zh-cn/docs/concepts/workloads/controllers/deployment/),ReplicationController 的替代品。
609615
- `ReplicationController` 是 Kubernetes REST API 的一部分,阅读 {{< api-reference page="workload-resources/replication-controller-v1" >}}
610616
对象定义以了解 replication controllers 的 API。
611-

content/zh-cn/docs/reference/labels-annotations-taints/_index.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Starting from v1.9, this label is deprecated.
8383
<!--
8484
### app.kubernetes.io/instance
8585
86-
Type: Label
86+
Type: Label
8787
8888
Example: `app.kubernetes.io/instance: "mysql-abcxzy"`
8989
@@ -765,7 +765,7 @@ This label can have one of three values: `Reconcile`, `EnsureExists`, or `Ignore
765765
- `Ignore`: Addon resources will be ignored. This mode is useful for add-ons that are not
766766
compatible with the add-on manager or that are managed by another controller.
767767
768-
For more details, see [Addon-manager](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md)
768+
For more details, see [Addon-manager](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md).
769769
-->
770770
### addonmanager.kubernetes.io/mode
771771

@@ -785,7 +785,7 @@ For more details, see [Addon-manager](https://github.com/kubernetes/kubernetes/b
785785
- `Ignore`:插件资源将被忽略。此模式对于与外接插件管理器不兼容或由其他控制器管理的插件程序非常有用。
786786

787787
有关详细信息,请参见
788-
[Addon-manager](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md)
788+
[Addon-manager](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md)
789789

790790
<!--
791791
### beta.kubernetes.io/arch (deprecated)
@@ -1469,7 +1469,7 @@ Kubernetes makes a few assumptions about the structure of zones and regions:
14691469
14701470
1. regions and zones are hierarchical: zones are strict subsets of regions and
14711471
no zone can be in 2 regions
1472-
2) zone names are unique across regions; for example region "africa-east-1" might be comprised
1472+
2. zone names are unique across regions; for example region "africa-east-1" might be comprised
14731473
of zones "africa-east-1a" and "africa-east-1b"
14741474
-->
14751475
Kubernetes 对 Zone 和 Region 的结构做了一些假设:
@@ -1540,7 +1540,7 @@ Example: `volume.beta.kubernetes.io/storage-provisioner: "k8s.io/minikube-hostpa
15401540
Used on: PersistentVolumeClaim
15411541
15421542
This annotation has been deprecated since v1.23.
1543-
See [volume.kubernetes.io/storage-provisioner](#volume-kubernetes-io-storage-provisioner)
1543+
See [volume.kubernetes.io/storage-provisioner](#volume-kubernetes-io-storage-provisioner).
15441544
-->
15451545
### volume.beta.kubernetes.io/storage-provisioner (已弃用) {#volume-beta-kubernetes-io-storage-provisioner}
15461546

@@ -1581,7 +1581,7 @@ This annotation has been deprecated. Instead, set the
15811581
[`storageClassName` field](/docs/concepts/storage/persistent-volumes/#class)
15821582
for the PersistentVolumeClaim or PersistentVolume.
15831583
-->
1584-
此注解可以为 PersistentVolume (PV) 或 PersistentVolumeClaim (PVC) 指定
1584+
此注解可以为 PersistentVolume(PV)或 PersistentVolumeClaimPVC指定
15851585
[StorageClass](/zh-cn/docs/concepts/storage/storage-classes/)
15861586
`storageClassName` 属性和 `volume.beta.kubernetes.io/storage-class` 注解均被指定时,
15871587
注解 `volume.beta.kubernetes.io/storage-class` 将优先于 `storageClassName` 属性。
@@ -1997,7 +1997,7 @@ resource without a class specified will be assigned this default class.
19971997
资源将被设置为此默认类。
19981998

19991999
<!--
2000-
### alpha.kubernetes.io/provided-node-ip
2000+
### alpha.kubernetes.io/provided-node-ip (alpha) {#alpha-kubernetes-io-provided-node-ip}
20012001
20022002
Type: Annotation
20032003
@@ -2012,7 +2012,7 @@ and legacy in-tree cloud providers), it sets this annotation on the Node to deno
20122012
set from the command line flag (`--node-ip`). This IP is verified with the cloud provider as valid
20132013
by the cloud-controller-manager.
20142014
-->
2015-
### alpha.kubernetes.io/provided-node-ip {#alpha-kubernetes-io-provided-node-ip}
2015+
### alpha.kubernetes.io/provided-node-ip (alpha) {#alpha-kubernetes-io-provided-node-ip}
20162016

20172017
类别:注解
20182018

@@ -2094,8 +2094,7 @@ container.
20942094
<!--
20952095
This annotation is deprecated. You should use the
20962096
[`kubectl.kubernetes.io/default-container`](#kubectl-kubernetes-io-default-container)
2097-
annotation instead.
2098-
Kubernetes versions 1.25 and newer ignore this annotation.
2097+
annotation instead. Kubernetes versions 1.25 and newer ignore this annotation.
20992098
-->
21002099
此注解已被弃用。取而代之的是使用
21012100
[`kubectl.kubernetes.io/default-container`](#kubectl-kubernetes-io-default-container) 注解。
@@ -2143,11 +2142,8 @@ Example: `batch.kubernetes.io/job-tracking: ""`
21432142
21442143
Used on: Jobs
21452144
2146-
The presence of this annotation on a Job indicates that the control plane is
2145+
The presence of this annotation on a Job used to indicate that the control plane is
21472146
[tracking the Job status using finalizers](/docs/concepts/workloads/controllers/job/#job-tracking-with-finalizers).
2148-
The control plane uses this annotation to safely transition to tracking Jobs
2149-
using finalizers, while the feature is in development.
2150-
You should **not** manually add or remove this annotation.
21512147
-->
21522148
### batch.kubernetes.io/job-tracking (已弃用) {#batch-kubernetes-io-job-tracking}
21532149

@@ -2158,18 +2154,13 @@ You should **not** manually add or remove this annotation.
21582154
用于:Job
21592155

21602156
Job 上存在此注解表明控制平面正在[使用 Finalizer 追踪 Job](/zh-cn/docs/concepts/workloads/controllers/job/#job-tracking-with-finalizers)
2161-
控制平面使用此注解来安全地转换为使用 Finalizer 追踪 Job,而此特性正在开发中。
2162-
**** 可以手动添加或删除此注解。
21632157

2164-
{{< note >}}
21652158
<!--
2166-
Starting from Kubernetes 1.26, this annotation is deprecated.
2167-
Kubernetes 1.27 and newer will ignore this annotation and always track Jobs
2168-
using finalizers.
2159+
Adding or removing this annotation no longer has an effect (Kubernetes v1.27 and later)
2160+
All Jobs are tracked with finalizers.
21692161
-->
2170-
从 Kubernetes 1.26 开始,该注解被弃用。
2171-
Kubernetes 1.27 及以上版本将忽略此注解,并始终使用 Finalizer 追踪 Job。
2172-
{{< /note >}}
2162+
添加或删除此注解不再有效(Kubernetes v1.27 及更高版本),
2163+
所有 Job 均通过 Finalizer 进行追踪。
21732164

21742165
<!--
21752166
### job-name (deprecated) {#job-name}
@@ -2605,7 +2596,7 @@ Type: Label
26052596
26062597
Example: `feature.node.kubernetes.io/network-sriov.capable: "true"`
26072598
2608-
Used on: Node
2599+
Used on: Node
26092600
26102601
These labels are used by the Node Feature Discovery (NFD) component to advertise
26112602
features on a node. All built-in labels use the `feature.node.kubernetes.io` label
@@ -3975,7 +3966,7 @@ ignores that node while calculating Topology Aware Hints.
39753966

39763967
类别:标签
39773968

3978-
用于: 节点
3969+
用于:节点
39793970

39803971
用来指示该节点用于运行控制平面组件的标记标签。Kubeadm 工具将此标签应用于其管理的控制平面节点。
39813972
其他集群管理工具通常也会设置此污点。

0 commit comments

Comments
 (0)