Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What characters are allowed in kubernetes port and container names?

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.

like image 925
Jeremy Lewi Avatar asked Jan 06 '15 04:01

Jeremy Lewi


People also ask

What is Kubernetes container name?

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).

Which ports are used by Kubernetes?

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)

What is host port and container port in Kubernetes?

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.


1 Answers

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.

like image 63
CJ Cullen Avatar answered Oct 02 '22 06:10

CJ Cullen