IntermediatePhone
2 min
Kubernetes Service Types
KubernetesNetworkingServices
Advertisement
Interview Question
Briefly explain ClusterIP, NodePort, and LoadBalancer service types in Kubernetes and when to use each.
Key Points to Cover
- ClusterIP: internal-only service, default type
- NodePort: exposes service on each node port
- LoadBalancer: provisions external LB via cloud provider
Evaluation Rubric
Explains ClusterIP usage34% weight
Explains NodePort trade-offs33% weight
Explains LoadBalancer scenario33% weight
Hints
- 💡Internal vs external exposure.
Common Pitfalls to Avoid
- ⚠️Over-exposing services: Using NodePort or LoadBalancer when a ClusterIP would suffice, leading to unnecessary external exposure and potential security vulnerabilities.
- ⚠️Misunderstanding NodePort's role: Relying solely on NodePort for production external access without an external load balancer, which lacks high availability and proper traffic distribution.
- ⚠️Cloud Provider Dependency for LoadBalancer: Assuming LoadBalancer works universally without a compatible cloud provider or an external load balancer controller (like MetalLB for bare-metal), leading to service creation failures.
- ⚠️Label Selector Mismatches: Incorrectly defining `selector` labels in the service definition, causing the service to not route traffic to any pods, making the application unreachable.
- ⚠️Cost and Resource Management with LoadBalancer: Overlooking the costs associated with cloud provider load balancers or hitting API rate limits and resource quotas, impacting scalability and budget.
Potential Follow-up Questions
- ❓What about Ingress vs Service?
- ❓When would you prefer ClusterIP + Ingress?
Advertisement