🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ### **规范定义** 我们先介绍[四种规范的定义](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md#definitions): * [rfc1035](http://www.ietf.org/rfc/rfc1035.txt)/[rfc1123](http://www.ietf.org/rfc/rfc1123.txt)`label`(DNS\_LABEL): An alphanumeric (a-z, and 0-9) string, with a maximum length of 63 characters, with the '-' character allowed anywhere except the first or last character, suitable for use as a hostname or segment in a domain name. (中文意思大致为,`DNS_LABEL`只能:(1)由小写字母、数字、中划线组成(2)中划线不能出现在第一位与最后一位(3)总长度不超过63个字符 * [rfc1035](http://www.ietf.org/rfc/rfc1035.txt)/[rfc1123](http://www.ietf.org/rfc/rfc1123.txt)`subdomain`(DNS\_SUBDOMAIN): One or more lowercase rfc1035/rfc1123 labels separated by '.' with a maximum length of 253 characters. (中文意思大致为,`DNS_SUBDOMAIN`由:(1)一个或多个`DNS_LABEL`组成(2)如果由多个`DNS_LABEL`组成,`DNS_LABEL`之间由`.`号隔开(3)总长度不超过253个字符 * [rfc4122](http://www.ietf.org/rfc/rfc4122.txt)`universally unique identifier`(UUID): A 128 bit generated value that is extremely unlikely to collide across time and space and requires no central coordination. * [rfc6335](https://tools.ietf.org/rfc/rfc6335.txt)`port name`(IANA\_SVC\_NAME): An alphanumeric (a-z, and 0-9) string, with a maximum length of 15 characters, with the '-' character allowed anywhere except the first or the last character or adjacent to another '-' character, it must contain at least a (a-z) character. ### **K8S的命名规范的设计** 接下来,我们再来看[K8S的命名规范的设计](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md#general-design) * K8S对象的名字:要符合`DNS_SUBDOMAIN` * K8S命名空间:要符合`DNS_LABEL` ### **参考** * https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md