Problem Statement
Explain the difference between a Kubernetes Service of type LoadBalancer and an Ingress resource and when you would use each.
Explanation
A Service of type LoadBalancer provisions a cloud provider’s external load-balancer and assigns the service an external IP so it can route traffic to backend pods directly. An Ingress resource works at layer-7 (HTTP/HTTPS) and allows routing requests based on host or path, often consolidating multiple services behind one load-balancer. Use LoadBalancer when you just need a simple external endpoint; use Ingress when you want more flexible routing, path-based rules or certificate termination.
