What patterns are valid in kubernetes for the names of containers and ports?
I had underscores in the names of ports and containers and got an error. Replacing the underscores with hyphens worked.
The container runtime is the software that is responsible for running containers. Kubernetes supports container runtimes such as containerd, CRI-O, and any other implementation of the Kubernetes CRI (Container Runtime Interface).
The ports required for a Kubernetes deployment are: 2379/tcp: Kubernetes etcd server client API (on master nodes in multi-master deployments) 2380/tcp: Kubernetes etcd server client API (on master nodes in multi-master deployments) 6443/tcp: Kubernetes API server (master nodes)
hostPort. The hostPort setting applies to the Kubernetes containers. The container port will be exposed to the external network at <hostIP>:<hostPort>, where the hostIP is the IP address of the Kubernetes node where the container is running and the hostPort is the port requested by the user.
Container names and port names must conform to the RFC 1123 definition of a DNS label.
Names must be no longer than 63 characters, must start and end with a lowercase letter or number, and may contain lowercase letters, numbers, and hyphens.
Expressed as a regular expression:
[a-z0-9]([-a-z0-9]*[a-z0-9])?
Here's the applicable code in GitHub for checking container names, checking port names, and defining acceptable names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With