Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Kubernetes 中哪些模式对容器和端口的名称有效?
我在端口和容器的名称中有下划线并出现错误。用连字符替换下划线有效。
容器名称和端口名称必须符合 DNS 标签的RFC 1123 定义。
名称不得超过 63 个字符,必须以小写字母或数字开头和结尾,并且可以包含小写字母、数字和连字符。
表示为正则表达式:
[a-z0-9]([-a-z0-9]*[a-z0-9])?
这是 GitHub 中用于检查容器名称、检查端口名称和定义可接受名称的适用代码。