Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
yanrongshi committed Jul 28, 2022
1 parent 3f09152 commit f65f5fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Every Kubernetes object also has a [_UID_](#uids) that is unique across your who
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`.
-->

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

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

比如,在同一个[名字空间](/zh-cn/docs/concepts/overview/working-with-objects/namespaces/)
中有一个名为 `myapp-1234` 的 Pod,但是可以命名一个 Pod 和一个 Deployment 同为 `myapp-1234`
Expand Down Expand Up @@ -172,7 +172,7 @@ Some resource types have additional restrictions on their names.
Kubernetes UIDs are universally unique identifiers (also known as UUIDs).
UUIDs are standardized as ISO/IEC 9834-8 and as ITU-T X.667.
-->
Kubernetes UIDs 是全局唯一标识符(也叫 UUIDs)。
Kubernetes UID 是全局唯一标识符(也叫 UUIDs)。
UUIDs 是标准化的,见 ISO/IEC 9834-8 和 ITU-T X.667。
## {{% heading "whatsnext" %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ weight: 30
<!--
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)_.
-->
在 Kubernetes 中,名字空间(Namespace)提供一种机制,将同一集群中的资源划分为相互隔离的组。
在 Kubernetes 中,**名字空间(Namespace)**提供一种机制,将同一集群中的资源划分为相互隔离的组。
同一名字空间内的资源名称要唯一,但跨名字空间时没有这个要求。
名字空间作用域仅针对带有名字空间的对象,例如 Deployment、Service 等,
这种作用域对集群访问的对象不适用,例如 StorageClass、Node、PersistentVolume 等。
Expand All @@ -28,7 +28,7 @@ In Kubernetes, _namespaces_ provides a mechanism for isolating groups of resourc
<!--
## When to Use Multiple Namespaces
-->
## 何时使用多个名字空间
## 何时使用多个名字空间 {#when-to-use-multiple-namespaces}

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

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

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

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

Expand Down Expand Up @@ -123,11 +123,11 @@ Kubernetes 会创建四个初始名字空间:
<!--
### Setting the namespace for a request
To set the namespace for a current request, use the `-namespace` flag.
To set the namespace for a current request, use the `--namespace` flag.
For example:
-->
### 为请求设置名字空间
### 为请求设置名字空间 {#setting-the-namespace-for-a-request}

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

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

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

```shell
kubectl config set-context --current --namespace=<名字空间名称>
# 验证
kubectl config view | grep namespace:
kubectl config view --minify | grep namespace:
```

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

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

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

0 comments on commit f65f5fe

Please sign in to comment.