0
0
Kubernetesdevops~5 mins

NodePort service type in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a NodePort service in Kubernetes?
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
What is the default port range for NodePort services?
A1024-49151
B80-8080
C30000-32767
D40000-45000
How do you specify a custom NodePort number?
AIn spec.ports.nodePort in the service YAML
BIn pod annotations
CIn deployment labels
DIn configMap
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
NodePort services forward traffic to pods using which Kubernetes feature?
ACluster IP
BPersistent volume
CIngress controller
DConfigMap
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.