You may see that nodes in your Kubernetes cluster are underutilized when pods request a hostPort. This happens because Kubernetes schedules only one pod per node when multiple pods request the same port on the host. These steps help you understand why this occurs and how to avoid the issue.
-
Review pod specifications for hostPort requests
Check whether your pods specify a hostPort. When multiple pods request the same port, Kubernetes schedules each pod onto its own node to avoid port conflicts. -
Remove the hostPort request when possible
Avoid using hostPort unless you have a specific requirement for it. Kubernetes best practices recommend avoiding hostPort because it ties pods to specific nodes and reduces scheduling flexibility. -
Use alternatives such as NodePort or port forwarding
If you only need to expose a local port for debugging or testing, consider using port forwarding instead of hostPort.
For example, you can run:kubectl port-forward deployment/<name> 8080:80 -
Refer to Kubernetes configuration best practices for guidance
For additional context and best practices, see the Kubernetes documentation on configuration and networking.
hostPort, Kubernetes can schedule pods more efficiently. This helps the scheduler place multiple pods onto the same node and improves overall resource usage.Related Articles
Can hostPort settings cause underutilized ECS nodes? 3Number of Views Pods fail after scheduling on B‑series burstable VM nodes 4Number of Views Use AWS node termination handler on Spot nodes in EKS 3Number of Views Pods can't be scheduled because autoscaling is disabled 45Number of Views Pods fail to schedule because of Kubernetes autoscaler deadlock errors 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago