diff --git a/content/zh/docs/concepts/overview/working-with-objects/names.md b/content/zh/docs/concepts/overview/working-with-objects/names.md new file mode 100644 index 0000000000000..cff7f34e4a35c --- /dev/null +++ b/content/zh/docs/concepts/overview/working-with-objects/names.md @@ -0,0 +1,67 @@ +--- +title: 名称 +content_template: templates/concept +weight: 20 +--- + +{{% capture overview %}} + + + +Kubernetes REST API 中的所有对象都由名称和 UID 明确标识。 + + + +对于非唯一的用户提供的属性,Kubernetes 提供了[标签](/docs/user-guide/labels)和[注释](/docs/concepts/overview/working-with-objects/annotations/)。 + +有关名称和 UID 的精确语法规则,请参见[标识符设计文档](https://git.k8s.io/community/contributors/design-proposals/architecture/identifiers.md)。 + +{{% /capture %}} + + +{{% capture body %}} + + + +## 名称 + +{{< glossary_definition term_id="name" length="all" >}} + + + +按照惯例,Kubernetes 资源的名称最大长度应为 253 个字符,由小写字母、数字、`-`和 `.` 组成,但某些资源有更具体的限制。 + + + +例如,下面是一个配置文件,Pod 名为 `nginx demo`,容器名为 `nginx`: + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: nginx-demo +spec: + containers: + - name: nginx + image: nginx:1.7.9 + ports: + - containerPort: 80 +``` + +## UIDs + +{{< glossary_definition term_id="uid" length="all" >}} + +{{% /capture %}} diff --git a/content/zh/docs/reference/glossary/name.md b/content/zh/docs/reference/glossary/name.md new file mode 100755 index 0000000000000..161082e0522cb --- /dev/null +++ b/content/zh/docs/reference/glossary/name.md @@ -0,0 +1,25 @@ +--- +title: Name +id: name +date: 2018-04-12 +full_link: /docs/concepts/overview/working-with-objects/names +short_description: > + A client-provided string that refers to an object in a resource URL, such as `/api/v1/pods/some-name`. + +aka: +tags: +- fundamental +--- + + +客户端提供的字符串,引用资源 url 中的对象,如`/api/v1/pods/some name`。 + + + + + +一次只能有一个给定类型的对象具有给定的名称。但是,如果删除对象,则可以创建同名的新对象。 diff --git a/content/zh/docs/reference/glossary/uid.md b/content/zh/docs/reference/glossary/uid.md new file mode 100755 index 0000000000000..a8f61a0449a42 --- /dev/null +++ b/content/zh/docs/reference/glossary/uid.md @@ -0,0 +1,27 @@ +--- +title: UID +id: uid +date: 2018-04-12 +full_link: /docs/concepts/overview/working-with-objects/names +short_description: > + A Kubernetes systems-generated string to uniquely identify objects. + +aka: +tags: +- fundamental +--- + + +Kubernetes 系统生成的字符串,唯一标识对象。 + + + + + +在 Kubernetes 集群的整个生命周期中创建的每个对象都有一个不同的 uid,它旨在区分类似实体的历史事件。 + +