A NodePort service exposes a pod on a static port on each node's IP address, allowing external traffic to access the service through that port.
Click to reveal answer
beginner
How does a NodePort service route traffic to pods?
It forwards traffic received on the node's static port to the target pods via the service's cluster IP and port.
Click to reveal answer
intermediate
What is the default port range for NodePort services in Kubernetes?
The default NodePort range is 30000 to 32767.
Click to reveal answer
intermediate
Can you specify a custom NodePort number in the service definition?
Yes, you can specify a custom NodePort within the allowed range in the service YAML under spec.ports.nodePort.
Click to reveal answer
advanced
What is a limitation of using NodePort services?
NodePort exposes ports on every node, which can be a security risk and may require firewall configuration. Also, it uses a fixed port which might conflict with other services.
Click to reveal answer
What does a NodePort service expose in Kubernetes?
AOnly inside the cluster
BA persistent volume
CA load balancer IP
DA static port on each node's IP
✗ Incorrect
NodePort exposes a static port on each node's IP address to allow external access.
What is the default port range for NodePort services?
A1024-49151
B80-8080
C30000-32767
D40000-45000
✗ Incorrect
The default NodePort range is 30000 to 32767.
How do you specify a custom NodePort number?
AIn spec.ports.nodePort in the service YAML
BIn pod annotations
CIn deployment labels
DIn configMap
✗ Incorrect
Custom NodePort is set in the service YAML under spec.ports.nodePort.
Which is a limitation of NodePort services?
AThey only work inside the cluster
BThey expose ports on all nodes which can be a security risk
CThey automatically create DNS entries
DThey require a cloud provider
✗ Incorrect
NodePort exposes ports on all nodes, which can be a security concern.
NodePort services forward traffic to pods using which Kubernetes feature?
ACluster IP
BPersistent volume
CIngress controller
DConfigMap
✗ Incorrect
NodePort forwards traffic to pods through the service's cluster IP.
Explain how a NodePort service works and when you might use it.
Think about how external users reach your app inside Kubernetes.
You got /4 concepts.
Describe the security considerations when using NodePort services.
Consider what happens when ports are exposed on every node.
You got /4 concepts.
Practice
(1/5)
1. What does a Kubernetes NodePort service do?
easy
A. Exposes the service on a static port on each node's IP address
B. Creates an internal cluster IP only accessible inside the cluster
C. Routes traffic through an external load balancer automatically
D. Runs the service only on a single node in the cluster
Solution
Step 1: Understand NodePort service purpose
A NodePort service exposes the application on a fixed port on every node's IP, allowing external access.
Step 2: Compare with other service types
ClusterIP is internal only, LoadBalancer uses external balancers, and NodePort is not limited to a single node.
Final Answer:
Exposes the service on a static port on each node's IP address -> Option A
Quick Check:
NodePort = fixed port on all nodes [OK]
Hint: NodePort always opens a fixed port on every node IP [OK]