AKS – 20 – What is different between Load balancer in service and ingress.

LoadBalancer Service:

  • Think of it like giving each dish its own waiter.
  • Every app (service) gets its own entrance and dedicated staff.
  • Simple and direct: one app = one public IP.
  • Good for small menus (few apps).

🧾 Example: You have one app (welcome-app) and want to expose it to the internet. You use LoadBalancer, and your cloud provider gives you a public IP to access it directly.

πŸ›ŽοΈ Ingress:

  • Think of it like a smart receptionist at the front desk.
  • One entrance, but the receptionist routes guests to the right table based on what they ask for.
  • You can serve many dishes (apps) through one public IP.
  • Great for big menus (many apps or microservices).

🧾 Example: You have multiple apps like welcome-app, admin-app, and api-service. Instead of giving each one a separate IP, you use Ingress to route:

  • / β†’ welcome-app
  • /admin β†’ admin-app
  • /api β†’ api-service

πŸ” Summary Table

FeatureLoadBalancerIngress
External IPOne per serviceOne for all services
CostHigher (more IPs/load balancers)Lower (shared IP)
RoutingBasic (just forwards traffic)Smart (path/host-based)
TLS/HTTPSManual setupBuilt-in support
Best forSimple/single appMultiple apps, microservices

βœ… When to Use What?

  • Use LoadBalancer if:
    • You have one or two services.
    • You want quick and simple external access.
    • You don’t need advanced routing.
  • Use Ingress if:
    • You have multiple services.
    • You want to save costs.
    • You need routing, TLS, or custom domains.

multiple types of Ingress Controllers,

1. NGINX Ingress Controller

  • Most widely used and community-supported.
  • Great for general-purpose routing.
  • Supports path-based and host-based routing, TLS, rate limiting, etc.
  • Easy to set up and works well in most environments.

βœ… Best for: Simplicity, flexibility, and community support.

2. Traefik

  • Modern, dynamic, and cloud-native.
  • Auto-discovers services and updates routes in real-time.
  • Built-in dashboard, metrics, and Let’s Encrypt support.

βœ… Best for: Dynamic environments, microservices, and real-time updates.

Istio Ingress Gateway

  • Part of the Istio service mesh.
  • Offers advanced traffic management, security, and observability.
  • More complex to set up.

βœ… Best for: Enterprises using service mesh and needing fine-grained control.

Leave a Reply

Your email address will not be published. Required fields are marked *