From 203ab83f22103f117cd42cca4dc122626719ccc2 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Mon, 18 May 2020 12:46:06 +0900 Subject: [PATCH 1/6] update /ja/docs/concepts/overview/working-with-objects/names/ --- .../overview/working-with-objects/names.md | 66 +++++++++++++++++-- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/content/ja/docs/concepts/overview/working-with-objects/names.md b/content/ja/docs/concepts/overview/working-with-objects/names.md index b8762cb33c..903e0ba8fc 100644 --- a/content/ja/docs/concepts/overview/working-with-objects/names.md +++ b/content/ja/docs/concepts/overview/working-with-objects/names.md @@ -1,30 +1,82 @@ --- reviewers: -title: 名前 +title: オブジェクトの名前とID content_template: templates/concept weight: 20 --- {{% capture overview %}} -KubernetesのREST API内の全てのオブジェクトは、名前とUIDで明確に識別されます。 +クラスター内の各オブジェクトには、そのタイプのリソースに固有の[_名前_](#names)があります。 +すべてのKubernetesオブジェクトには、クラスター全体で一意の[_UID_](#uids)もあります。 -ユーザーが付与する一意ではない属性については、Kubernetesが[ラベル](/docs/user-guide/labels)と[アノテーション](/docs/concepts/overview/working-with-objects/annotations/)を付与します。 +たとえば、同じ[名前空間](/docs/concepts/overview/working-with-objects/namespaces/)内に`myapp-1234`という名前のPodは1つしか含められませんが、`myapp-1234`という名前の1つのPodと1つのDeploymentを含めることができます。 -名前とUIDに関する正確な構文については、[識別子デザインドキュメント](https://git.k8s.io/community/contributors/design-proposals/architecture/identifiers.md)を参照してください。 +ユーザーが付与する一意ではない属性については、Kubernetesが[ラベル](/ja/docs/concepts/overview/working-with-objects/labels/)と[アノテーション](/ja/docs/concepts/overview/working-with-objects/annotations/)を付与します。 {{% /capture %}} {{% capture body %}} -## 名前 +## 名前 {#names} {{< glossary_definition term_id="name" length="all" >}} -慣例的に、Kubernetesリソースの名前は最長253文字で、かつ英小文字、数字、また`-`、`.`から構成します。しかし、特定のリソースはより具体的な制限があります。 +以下は、リソースに一般的に使用される3つのタイプの名前制約です。 -## UID +### DNSサブドメイン名 {#dns-subdomain-names} + +ほとんどのリソースタイプには、[RFC 1123](https://tools.ietf.org/html/rfc1123)で定義されているDNSサブドメイン名として使用できる名前が必要です。 +つまり、名前は次のとおりでなければなりません: + +- 253文字以内 +- 英小文字、数字、「-」または「.」のみを含む +- 英数字で始まる +- 英数字で終わる + +### DNSラベル名 {#dns-label-names} + +一部のリソースタイプでは、[RFC 1123](https://tools.ietf.org/html/rfc1123)で定義されているDNSラベル標準に従う名前が必要です。 +つまり、名前は次のとおりでなければなりません: + +- 63文字以内 +- 英小文字、数字または「-」のみを含む +- 英数字で始まる +- 英数字で終わる + +### パスセグメント名 {#path-segment-names} + +一部のリソースタイプでは、名前をパスセグメントとして安全にエンコードできるようにする必要があります。 +つまり、名前を「.」や「..」にすることはできず、名前に「/」または「%」を含めることはできません。 + +以下は、`nginx-demo`という名前のPodのマニフェストの例です。 + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: nginx-demo +spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +``` + +{{< note >}} +一部のリソースタイプには、名前に追加の制限があります。 +{{< /note >}} + +## UID {#uids} {{< glossary_definition term_id="uid" length="all" >}} +Kubernetes UIDは、普遍的に一意の識別子(UUIDとも呼ばれます)です。 +UUIDは、ISO/IEC 9834-8およびITU-T X.667として標準化されています。 + +{{% /capture %}} +{{% capture whatsnext %}} +* Kubernetesの[ラベル](/ja/docs/concepts/overview/working-with-objects/labels/)についてお読みください。 +* [Kubernetesの識別子と名前](https://git.k8s.io/community/contributors/design-proposals/architecture/identifiers.md)設計ドキュメントをご覧ください。 {{% /capture %}} From 4cfae3b87f8848c68ebc9cf0ee3b110eeac04f38 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Mon, 18 May 2020 12:52:44 +0900 Subject: [PATCH 2/6] update link to /ja/docs/concepts/overview/working-with-objects/names/ --- content/ja/docs/reference/glossary/name.md | 6 +++--- .../configure-pod-container/configure-pod-configmap.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/ja/docs/reference/glossary/name.md b/content/ja/docs/reference/glossary/name.md index c9b0bcd5ef..48c4ca4db9 100755 --- a/content/ja/docs/reference/glossary/name.md +++ b/content/ja/docs/reference/glossary/name.md @@ -2,17 +2,17 @@ title: 名前(Name) id: name date: 2018-04-12 -full_link: /docs/concepts/overview/working-with-objects/names +full_link: /ja/docs/concepts/overview/working-with-objects/names short_description: > クライアントから提供され、リソースURL内のオブジェクトを参照する文字列です。例えば`/api/v1/pods/何らかの名前`のようになります。 -aka: +aka: tags: - fundamental --- クライアントから提供され、リソースURL内のオブジェクトを参照する文字列です。例えば`/api/v1/pods/何らかの名前`のようになります。 - + 同じ種類のオブジェクトは、同じ名前を同時に持つことは出来ません。しかし、オブジェクトを削除することで、旧オブジェクトと同じ名前で新しいオブジェクトを作成できます。 diff --git a/content/ja/docs/tasks/configure-pod-container/configure-pod-configmap.md b/content/ja/docs/tasks/configure-pod-container/configure-pod-configmap.md index f23a98cb6b..17b39e7e1f 100644 --- a/content/ja/docs/tasks/configure-pod-container/configure-pod-configmap.md +++ b/content/ja/docs/tasks/configure-pod-container/configure-pod-configmap.md @@ -32,7 +32,7 @@ ConfigMapを使用すると、設定をイメージのコンテンツから切 kubectl create configmap ``` -\の部分はConfigMapに割り当てる名前で、\はデータを取得するディレクトリ、ファイル、またはリテラル値です。ConfigMapの名前は有効な[DNSサブドメイン名](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)である必要があります。 +\の部分はConfigMapに割り当てる名前で、\はデータを取得するディレクトリ、ファイル、またはリテラル値です。ConfigMapの名前は有効な[DNSサブドメイン名](/ja/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names)である必要があります。 ファイルをベースにConfigMapを作成する場合、\ のキーはデフォルトでファイル名になり、値はデフォルトでファイルの中身になります。 From 43a201d50302f3771e8c5feabca3c56e3fa74ad4 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Wed, 20 May 2020 12:38:28 +0900 Subject: [PATCH 3/6] Update content/ja/docs/concepts/overview/working-with-objects/names.md Co-authored-by: nasa9084 --- content/ja/docs/concepts/overview/working-with-objects/names.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/ja/docs/concepts/overview/working-with-objects/names.md b/content/ja/docs/concepts/overview/working-with-objects/names.md index 903e0ba8fc..b8e1335c58 100644 --- a/content/ja/docs/concepts/overview/working-with-objects/names.md +++ b/content/ja/docs/concepts/overview/working-with-objects/names.md @@ -12,7 +12,7 @@ weight: 20 たとえば、同じ[名前空間](/docs/concepts/overview/working-with-objects/namespaces/)内に`myapp-1234`という名前のPodは1つしか含められませんが、`myapp-1234`という名前の1つのPodと1つのDeploymentを含めることができます。 -ユーザーが付与する一意ではない属性については、Kubernetesが[ラベル](/ja/docs/concepts/overview/working-with-objects/labels/)と[アノテーション](/ja/docs/concepts/overview/working-with-objects/annotations/)を付与します。 +ユーザーが一意ではない属性を付与するために、Kubernetesは[ラベル](/ja/docs/concepts/overview/working-with-objects/labels/)と[アノテーション](/ja/docs/concepts/overview/working-with-objects/annotations/)を提供しています。 {{% /capture %}} From 72fa37e344f302d71e05a4f37947de9f2b9ecb6b Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Wed, 20 May 2020 12:41:02 +0900 Subject: [PATCH 4/6] apply review --- .../ja/docs/concepts/overview/working-with-objects/names.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/ja/docs/concepts/overview/working-with-objects/names.md b/content/ja/docs/concepts/overview/working-with-objects/names.md index b8e1335c58..614e87903e 100644 --- a/content/ja/docs/concepts/overview/working-with-objects/names.md +++ b/content/ja/docs/concepts/overview/working-with-objects/names.md @@ -22,7 +22,7 @@ weight: 20 {{< glossary_definition term_id="name" length="all" >}} -以下は、リソースに一般的に使用される3つのタイプの名前制約です。 +以下は、一般的にリソースに使用される3種類の名前に関する制約です。 ### DNSサブドメイン名 {#dns-subdomain-names} @@ -72,11 +72,11 @@ spec: {{< glossary_definition term_id="uid" length="all" >}} -Kubernetes UIDは、普遍的に一意の識別子(UUIDとも呼ばれます)です。 +Kubernetes UIDは、UUIDのことを指します。 UUIDは、ISO/IEC 9834-8およびITU-T X.667として標準化されています。 {{% /capture %}} {{% capture whatsnext %}} * Kubernetesの[ラベル](/ja/docs/concepts/overview/working-with-objects/labels/)についてお読みください。 -* [Kubernetesの識別子と名前](https://git.k8s.io/community/contributors/design-proposals/architecture/identifiers.md)設計ドキュメントをご覧ください。 +* [Kubernetesの識別子と名前](https://git.k8s.io/community/contributors/design-proposals/architecture/identifiers.md)デザインドキュメントをご覧ください。 {{% /capture %}} From 2a560b906197d43bda0623bbfaecff9f9ee95e41 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Thu, 21 May 2020 09:28:37 +0900 Subject: [PATCH 5/6] apply review --- content/ja/docs/concepts/overview/working-with-objects/names.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/ja/docs/concepts/overview/working-with-objects/names.md b/content/ja/docs/concepts/overview/working-with-objects/names.md index 614e87903e..7e36d1bd36 100644 --- a/content/ja/docs/concepts/overview/working-with-objects/names.md +++ b/content/ja/docs/concepts/overview/working-with-objects/names.md @@ -22,7 +22,7 @@ weight: 20 {{< glossary_definition term_id="name" length="all" >}} -以下は、一般的にリソースに使用される3種類の名前に関する制約です。 +次の3つの命名規則がよく使われます。 ### DNSサブドメイン名 {#dns-subdomain-names} From 0f8ad9b65c780fabad5d546f26b07cffe7eb5519 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Fri, 22 May 2020 16:40:39 +0900 Subject: [PATCH 6/6] remove new line --- .../ja/docs/concepts/overview/working-with-objects/names.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/ja/docs/concepts/overview/working-with-objects/names.md b/content/ja/docs/concepts/overview/working-with-objects/names.md index 7e36d1bd36..18c762aea5 100644 --- a/content/ja/docs/concepts/overview/working-with-objects/names.md +++ b/content/ja/docs/concepts/overview/working-with-objects/names.md @@ -7,8 +7,7 @@ weight: 20 {{% capture overview %}} -クラスター内の各オブジェクトには、そのタイプのリソースに固有の[_名前_](#names)があります。 -すべてのKubernetesオブジェクトには、クラスター全体で一意の[_UID_](#uids)もあります。 +クラスター内の各オブジェクトには、そのタイプのリソースに固有の[_名前_](#names)があります。すべてのKubernetesオブジェクトには、クラスター全体で一意の[_UID_](#uids)もあります。 たとえば、同じ[名前空間](/docs/concepts/overview/working-with-objects/namespaces/)内に`myapp-1234`という名前のPodは1つしか含められませんが、`myapp-1234`という名前の1つのPodと1つのDeploymentを含めることができます。