Skip to content

Commit 1a5c82b

Browse files
authored
Merge pull request #29114 from tengqm/fix-name-requirement
Fix service name requirement
2 parents ba22677 + 26748e3 commit 1a5c82b

File tree

2 files changed

+14
-3
lines changed
  • content/en/docs/concepts

2 files changed

+14
-3
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For non-unique user-provided attributes, Kubernetes provides [labels](/docs/conc
2828
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.
2929
{{< /note >}}
3030

31-
Below are three types of commonly used name constraints for resources.
31+
Below are four types of commonly used name constraints for resources.
3232

3333
### DNS Subdomain Names
3434

@@ -41,7 +41,7 @@ This means the name must:
4141
- start with an alphanumeric character
4242
- end with an alphanumeric character
4343

44-
### DNS Label Names
44+
### RFC 1123 Label Names {#dns-label-names}
4545

4646
Some resource types require their names to follow the DNS
4747
label standard as defined in [RFC 1123](https://tools.ietf.org/html/rfc1123).
@@ -52,6 +52,17 @@ This means the name must:
5252
- start with an alphanumeric character
5353
- end with an alphanumeric character
5454

55+
### RFC 1035 Label Names
56+
57+
Some resource types require their names to follow the DNS
58+
label standard as defined in [RFC 1035](https://tools.ietf.org/html/rfc1035).
59+
This means the name must:
60+
61+
- contain at most 63 characters
62+
- contain only lowercase alphanumeric characters or '-'
63+
- start with an alphabetic character
64+
- end with an alphanumeric character
65+
5566
### Path Segment Names
5667

5768
Some resource types require their names to be able to be safely encoded as a

content/en/docs/concepts/services-networking/service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A Service in Kubernetes is a REST object, similar to a Pod. Like all of the
7272
REST objects, you can `POST` a Service definition to the API server to create
7373
a new instance.
7474
The name of a Service object must be a valid
75-
[DNS label name](/docs/concepts/overview/working-with-objects/names#dns-label-names).
75+
[RFC 1035 label name](/docs/concepts/overview/working-with-objects/names#rfc-1035-label-names).
7676

7777
For example, suppose you have a set of Pods where each listens on TCP port 9376
7878
and contains a label `app=MyApp`:

0 commit comments

Comments
 (0)