CNCFContainer Orchestration

Service & Nodeport — KCNA Practice Question

A representative Kubernetes and Cloud Native Associate (KCNA) exam question on Service & Nodeport. Work through it below, then read why each option is right or wrong.

This question is part of the free Kubernetes and Cloud Native Associate practice test.

Short answer

The correct answer is C. A port from 30000 to 32767, the default range set by the --service-node-port-range flag..

C is correct because the control plane allocates a node port from the range given by --service-node-port-range, whose default is 30000-32767. A is wrong because 1-1023 is not the default node port range. B is wrong because 1024-29999 is below the default range. D is wrong because 32768-65535 is above the default range, which ends at 32767.

The Question

A cluster uses default API server settings. An administrator creates a Service with type NodePort and does not set nodePort. From which range does the control plane allocate the port?

AAny free port from 1 to 1023, the well-known port range that normal processes on each node already use.
BAny free port from 1024 to 29999, the registered port range that is left over below the node port band.
CA port from 30000 to 32767, the default range set by the --service-node-port-range flag.Correct
DAny free port from 32768 to 65535, the dynamic port range that the node operating system hands out.

Why C is correct

C is correct because the control plane allocates a node port from the range given by --service-node-port-range, whose default is 30000-32767. A is wrong because 1-1023 is not the default node port range. B is wrong because 1024-29999 is below the default range. D is wrong because 32768-65535 is above the default range, which ends at 32767.

Why the other options are wrong

Option A: Any free port from 1 to 1023, the well-known port range that normal processes on each node already use.

Option A does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (C) is the only one that fully meets every constraint stated in the question.

Option B: Any free port from 1024 to 29999, the registered port range that is left over below the node port band.

Option B does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (C) is the only one that fully meets every constraint stated in the question.

Option D: Any free port from 32768 to 65535, the dynamic port range that the node operating system hands out.

Option D does not satisfy the requirement in the scenario. Review the explanation above: the correct choice (C) is the only one that fully meets every constraint stated in the question.

Key idea: Service & Nodeport

C is correct because the control plane allocates a node port from the range given by --service-node-port-range, whose default is 30000-32767. A is wrong because 1-1023 is not the default node port range. B is wrong because 1024-29999 is below the default range. D is wrong because 32768-65535 is above the default range, which ends at 32767. On the KCNA exam, questions in the "Container Orchestration" domain test whether you can map a scenario's constraints to the right choice. Read the requirement carefully, eliminate options that violate any single constraint, and pick the one that satisfies all of them with the least operational overhead.

Ready to see how you'd score?

Take the free practice quiz and find out which Kubernetes and Cloud Native Associate domains you need to focus on. No signup required.

Practice 5 similar questions

Same cert, same or adjacent domain. Use these after reviewing the explanation.

Related Kubernetes and Cloud Native Associate Practice Questions

Official sources used

Verify program and exam details at the source before scheduling.