CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

hostPort and hostNetwork

The two ways a Pod can take a port on the node it runs on, what each does to scheduling, and why a Deployment that uses either one quietly stops scaling.

Services and Networking Guide 56 of 103 Intermediate

Written against the versions above. Node addresses are this lab's. The scheduler message and the behaviour are the same anywhere.

Four nodes - one tainted control plane and three schedulable workers, which is the number that matters in the third step.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. A Pod that claims a port on its node

  2. A second Pod that wants the same port

  3. What that means for a Deployment

  4. The same idea, taken to its conclusion

Official sources