A Kubernetes administrator is running a two-node, on-premises cluster that has no cloud load balancer available. A team requests that their HTTP microservice be reachable from outside the cluster for a short round of user-acceptance tests. The requirement is to expose the application on a high TCP port of each node (for example, http://node1.lab.example.com:31777/) without adding any additional ingress controllers. Which Kubernetes Service type should the administrator configure to satisfy this request?
A Service of type NodePort opens the same high-numbered TCP port (by default in the 30000-32767 range) on every cluster node and forwards traffic that arrives on that port to one of the Pods selected by the Service. Because the cluster already has routable node IP addresses, external clients can reach the workload at : without any cloud-provided load balancer.
ClusterIP only exposes an internal virtual IP that is not reachable off-cluster. LoadBalancer automatically provisions (or expects) an external load-balancer resource from the underlying cloud provider, which is absent in this on-prem environment. ExternalName simply creates a DNS CNAME and does not listen on any port at all. Therefore, NodePort is the appropriate choice.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a NodePort in Kubernetes and how does it work?
Open an interactive chat with Bash
What are the differences between NodePort, ClusterIP, and LoadBalancer Service types?
Open an interactive chat with Bash
How is traffic routed from a NodePort to the target Pods?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .