Kubernetes Ports and Protocols
Luke Hebert
- 2 minutes read - 238 wordsWhen running Kubernetes in an environment with strict network boundaries, such as an on-premises datacenter with physical network firewalls or Virtual Networks in a public cloud, it helps to know exactly which ports and protocols the components rely on. The sections below outline the required ports for control plane and worker nodes, along with notes on overriding defaults.
Control Plane
| Protocol | Direction | Port Range | Purpose | Used By |
|---|---|---|---|---|
| TCP | Inbound | 6443 | Kubernetes API server | All |
| TCP | Inbound | 2379-2380 | etcd server client API | kube-apiserver, etcd |
| TCP | Inbound | 10250 | Kubelet API | Self, Control plane |
| TCP | Inbound | 10259 | kube-scheduler | Self |
| TCP | Inbound | 10257 | kube-controller-manager | Self |
Although etcd ports are listed in the control plane section, you can also host your own etcd cluster externally or on custom ports.
Worker Nodes
| Protocol | Direction | Port Range | Purpose | Used By |
|---|---|---|---|---|
| TCP | Inbound | 10250 | Kubelet API | Self, Control plane |
| TCP | Inbound | 10256 | kube-proxy | Self, Load balancers |
| TCP | Inbound | 30000-32767 | NodePort Services† | All |
| UDP | Inbound | 30000-32767 | NodePort Services† | All |
† Default port range for NodePort Services.
All default port numbers can be overridden. When custom ports are used, those ports need to be open instead of the defaults listed here.
One common example is the API server port, which is sometimes switched to 443. Alternatively, the default port is kept as is and the API server is placed behind a load balancer that listens on 443 and routes requests to the API server on the default port.