Skip to content

Commit d7d4784

Browse files
authored
Merge pull request #35472 from yanrongshi/zh-cn-update-name-and-namespace
[zh-cn]Sync name and namespace
2 parents fa2c79d + f65f5fe commit d7d4784

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Every Kubernetes object also has a [_UID_](#uids) that is unique across your who
2121
For example, you can only have one Pod named `myapp-1234` within the same [namespace](/docs/concepts/overview/working-with-objects/namespaces/), but you can have one Pod and one Deployment that are each named `myapp-1234`.
2222
-->
2323

24-
集群中的每一个对象都有一个[**名称**](#names)来标识在同类资源中的唯一性。
24+
集群中的每一个对象都有一个[**名称**]#names来标识在同类资源中的唯一性。
2525

26-
每个 Kubernetes 对象也有一个 [**UID**](#uids) 来标识在整个集群中的唯一性。
26+
每个 Kubernetes 对象也有一个 [**UID**]#uids来标识在整个集群中的唯一性。
2727

2828
比如,在同一个[名字空间](/zh-cn/docs/concepts/overview/working-with-objects/namespaces/)
2929
中有一个名为 `myapp-1234` 的 Pod,但是可以命名一个 Pod 和一个 Deployment 同为 `myapp-1234`
@@ -172,7 +172,7 @@ Some resource types have additional restrictions on their names.
172172
Kubernetes UIDs are universally unique identifiers (also known as UUIDs).
173173
UUIDs are standardized as ISO/IEC 9834-8 and as ITU-T X.667.
174174
-->
175-
Kubernetes UIDs 是全局唯一标识符(也叫 UUIDs)。
175+
Kubernetes UID 是全局唯一标识符(也叫 UUIDs)。
176176
UUIDs 是标准化的,见 ISO/IEC 9834-8 和 ITU-T X.667。
177177
178178
## {{% heading "whatsnext" %}}

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ weight: 30
1818
<!--
1919
In Kubernetes, _namespaces_ provides a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Namespace-based scoping is applicable only for namespaced objects _(e.g. Deployments, Services, etc)_ and not for cluster-wide objects _(e.g. StorageClass, Nodes, PersistentVolumes, etc)_.
2020
-->
21-
在 Kubernetes 中,名字空间(Namespace)提供一种机制,将同一集群中的资源划分为相互隔离的组。
21+
在 Kubernetes 中,**名字空间(Namespace)**提供一种机制,将同一集群中的资源划分为相互隔离的组。
2222
同一名字空间内的资源名称要唯一,但跨名字空间时没有这个要求。
2323
名字空间作用域仅针对带有名字空间的对象,例如 Deployment、Service 等,
2424
这种作用域对集群访问的对象不适用,例如 StorageClass、Node、PersistentVolume 等。
@@ -28,7 +28,7 @@ In Kubernetes, _namespaces_ provides a mechanism for isolating groups of resourc
2828
<!--
2929
## When to Use Multiple Namespaces
3030
-->
31-
## 何时使用多个名字空间
31+
## 何时使用多个名字空间 {#when-to-use-multiple-namespaces}
3232

3333
<!--
3434
Namespaces are intended for use in environments with many users spread across multiple
@@ -64,10 +64,10 @@ resources within the same namespace.
6464
<!--
6565
## Working with Namespaces
6666
67-
Creation and deletion of namespaces are described in the [Admin Guide documentation
68-
for namespaces](/docs/tasks/administer-cluster/namespaces/).
67+
Creation and deletion of namespaces are described in the
68+
[Admin Guide documentation for namespaces](/docs/tasks/administer-cluster/namespaces).
6969
-->
70-
## 使用名字空间
70+
## 使用名字空间 {#working-with-namespaces}
7171

7272
名字空间的创建和删除在[名字空间的管理指南文档](/zh-cn/docs/tasks/administer-cluster/namespaces/)描述。
7373

@@ -83,7 +83,7 @@ Avoid creating namespaces with the prefix `kube-`, since it is reserved for Kube
8383
8484
You can list the current namespaces in a cluster using:
8585
-->
86-
### 查看名字空间
86+
### 查看名字空间 {#viewing-namespaces}
8787

8888
你可以使用以下命令列出集群中现存的名字空间:
8989

@@ -123,11 +123,11 @@ Kubernetes 会创建四个初始名字空间:
123123
<!--
124124
### Setting the namespace for a request
125125
126-
To set the namespace for a current request, use the `-namespace` flag.
126+
To set the namespace for a current request, use the `--namespace` flag.
127127
128128
For example:
129129
-->
130-
### 为请求设置名字空间
130+
### 为请求设置名字空间 {#setting-the-namespace-for-a-request}
131131

132132
要为当前请求设置名字空间,请使用 `--namespace` 参数。
133133

@@ -144,22 +144,23 @@ kubectl get pods --namespace=<名字空间名称>
144144
You can permanently save the namespace for all subsequent kubectl commands in that
145145
context.
146146
-->
147-
### 设置名字空间偏好
147+
### 设置名字空间偏好 {#setting-the-namespace-preference}
148148

149149
你可以永久保存名字空间,以用于对应上下文中所有后续 kubectl 命令。
150150

151151
```shell
152152
kubectl config set-context --current --namespace=<名字空间名称>
153153
# 验证
154-
kubectl config view | grep namespace:
154+
kubectl config view --minify | grep namespace:
155155
```
156156

157157
<!--
158158
## Namespaces and DNS
159159
160-
When you create a [Service](/docs/user-guide/services), it creates a corresponding [DNS entry](/docs/concepts/services-networking/dns-pod-service/).
160+
When you create a [Service](/docs/concepts/services-networking/service/),
161+
it creates a corresponding [DNS entry](/docs/concepts/services-networking/dns-pod-service/).
161162
-->
162-
## 名字空间和 DNS
163+
## 名字空间和 DNS {#namespaces-and-dns}
163164

164165
当你创建一个[服务](/zh-cn/docs/concepts/services-networking/service/)时,
165166
Kubernetes 会创建一个相应的 [DNS 条目](/zh-cn/docs/concepts/services-networking/dns-pod-service/)
@@ -214,12 +215,13 @@ TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt).
214215
<!--
215216
## Not All Objects are in a Namespace
216217
-->
217-
## 并非所有对象都在名字空间中
218+
## 并非所有对象都在名字空间中 {#not-all-objects-are-in-a-namespace}
218219

219220
<!--
220221
Most Kubernetes resources (e.g. pods, services, replication controllers, and others) are
221222
in some namespaces. However namespace resources are not themselves in a namespace.
222-
And low-level resources, such as [nodes](/docs/concepts/architecture/nodes/) and
223+
And low-level resources, such as
224+
[nodes](/docs/concepts/architecture/nodes/) and
223225
persistentVolumes, are not in any namespace.
224226
-->
225227
大多数 kubernetes 资源(例如 Pod、Service、副本控制器等)都位于某些名字空间中。

0 commit comments

Comments
 (0)