IntermediatePhone
2 min
Kubernetes Ingress vs Service
KubernetesNetworkingCloud
Advertisement
Interview Question
What is the difference between Kubernetes Ingress and Service, and when would you use each?
Key Points to Cover
- Service exposes pods internally or externally at stable IP/port
- Ingress manages external HTTP/S routing via rules and controllers
- Use Service for cluster-internal traffic; Ingress for consolidated edge routing
Evaluation Rubric
Defines Service roles34% weight
Explains Ingress routing and purpose33% weight
Gives appropriate usage examples33% weight
Hints
- 💡Ingress requires a controller like NGINX or Traefik.
Common Pitfalls to Avoid
- ⚠️Confusing Ingress as a 'type' of Service, rather than a separate API object that uses Services as its backend targets.
- ⚠️Not understanding that Ingress requires an active Ingress Controller (like NGINX, HAProxy, etc.) to function; Ingress resources alone do nothing.
- ⚠️Trying to use Ingress for non-HTTP/S traffic (e.g., UDP, database connections), where a LoadBalancer Service or NodePort Service would be appropriate.
- ⚠️Over-exposing individual applications with multiple `LoadBalancer` type Services, leading to higher cloud costs and less organized routing, when a single Ingress with multiple rules would be more efficient.
- ⚠️Failing to comprehend the dependency: Ingress routes to Kubernetes Services, not directly to Pods, meaning the target Service must exist.
Potential Follow-up Questions
- ❓What are IngressClass resources?
- ❓How does TLS termination work?
Advertisement