Skip to content

Commit 51f154c

Browse files
authored
Merge pull request #27795 from tengqm/zh-sync-concepts-13
[zh] Resync concepts section (13)
2 parents d6640e3 + d5f160d commit 51f154c

File tree

4 files changed

+104
-68
lines changed

4 files changed

+104
-68
lines changed

content/zh/docs/concepts/overview/working-with-objects/labels.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,17 @@ _标签_ 是键值对。有效的标签键有两个段:可选的前缀和名
100100
`kubernetes.io/` 前缀是为 Kubernetes 核心组件保留的。
101101

102102
<!--
103-
Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
103+
Valid label value:
104+
105+
* must be 63 characters or less (can be empty),
106+
* unless empty, must begin and end with an alphanumeric character (`[a-z0-9A-Z]`),
107+
* could contain dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
104108
-->
105-
有效标签值必须为 63 个字符或更少,并且必须为空或以字母数字字符(`[a-z0-9A-Z]`)开头和结尾,
106-
中间可以包含破折号(`-`)、下划线(`_`)、点(`.`)和字母或数字。
109+
有效标签值:
110+
111+
* 必须为 63 个字符或更少(可以为空)
112+
* 除非标签值为空,必须以字母数字字符(`[a-z0-9A-Z]`)开头和结尾
113+
* 包含破折号(`-`)、下划线(`_`)、点(`.`)和字母或数字。
107114

108115
<!--
109116
## Label selectors

content/zh/docs/concepts/overview/working-with-objects/names.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ For non-unique user-provided attributes, Kubernetes provides [labels](/docs/user
3636

3737
{{< glossary_definition term_id="name" length="all" >}}
3838

39+
{{< note >}}
40+
<!--
41+
In cases when objects represent a physical entity, like a Node representing a physical host, when the host is re-created under the same name without deleting and re-creating the Node, Kubernetes treats the new host as the old one, which may lead to inconsistencies.
42+
-->
43+
当对象所代表的是一个物理实体(例如代表一台物理主机的 Node)时,
44+
如果在 Node 对象未被删除并重建的条件下,创新创建了同名的物理主机,
45+
则 Kubernetes 会将新的主机看作是老的主机,这可能会带来某种不一致性。
46+
{{< /note >}}
47+
3948
<!--
4049
Below are three types of commonly used name constraints for resources.
4150
-->

content/zh/docs/concepts/overview/working-with-objects/namespaces.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ Namespaces are a way to divide cluster resources between multiple users (via [re
5151
名字空间是在多个用户之间划分集群资源的一种方法(通过[资源配额](/zh/docs/concepts/policy/resource-quotas/))。
5252

5353
<!--
54-
It is not necessary to use multiple namespaces just to separate slightly different
54+
It is not necessary to use multiple namespaces to separate slightly different
5555
resources, such as different versions of the same software: use
56-
[labels](/docs/concepts/overview/working-with-objects/labels/) to distinguish
56+
{{< glossary_tooltip text="labels" term_id="label" >}} to distinguish
5757
resources within the same namespace.
5858
-->
59-
不需要使用多个名字空间来分隔轻微不同的资源,例如同一软件的不同版本:
60-
使用[标签](/zh/docs/concepts/overview/working-with-objects/labels)来区分同一名字空间中的不同资源。
59+
不必使用多个名字空间来分隔仅仅轻微不同的资源,例如同一软件的不同版本:
60+
应该使用{{< glossary_tooltip text="标签" term_id="label" >}}
61+
来区分同一名字空间中的不同资源。
6162

6263
<!--
6364
## Working with Namespaces
@@ -160,7 +161,7 @@ Kubernetes 会创建一个相应的 [DNS 条目](/zh/docs/concepts/services-netw
160161

161162
<!--
162163
This entry is of the form `<service-name>.<namespace-name>.svc.cluster.local`, which means
163-
that if a container just uses `<service-name>`, it will resolve to the service which
164+
that if a container only uses `<service-name>`, it will resolve to the service which
164165
is local to a namespace. This is useful for using the same configuration across
165166
multiple namespaces such as Development, Staging and Production. If you want to reach
166167
across namespaces, you need to use the fully qualified domain name (FQDN).
@@ -197,6 +198,25 @@ kubectl api-resources --namespaced=true
197198
kubectl api-resources --namespaced=false
198199
```
199200

201+
<!--
202+
## Automatic labelling
203+
-->
204+
## 自动打标签 {#automatic-labelling}
205+
206+
{{< feature-state state="beta" for_k8s_version="1.21" >}}
207+
208+
<!--
209+
The Kubernetes control plane sets an immutable {{< glossary_tooltip text="label" term_id="label" >}}
210+
`kubernetes.io/metadata.name` on all namespaces, provided that the `NamespaceDefaultLabelName`
211+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled.
212+
The value of the label is the namespace name.
213+
-->
214+
Kubernetes 控制面会为所有名字空间设置一个不可变更的
215+
{{< glossary_tooltip text="标签" term_id="label" >}}
216+
`kubernetes.io/metadata.name`,只要 `NamespaceDefaultLabelName` 这一
217+
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
218+
被启用。标签的值是名字空间的名称。
219+
200220
## {{% heading "whatsnext" %}}
201221

202222
<!--

0 commit comments

Comments
 (0)