0

What kind of load balancing HAproxy ingress controller capable of. Can it do load balancing on a Pod level ? or it does it on a Node level load-balancing.

Thanks Yaniv

Yaniv Hakim
  • 77
  • 10

2 Answers2

1

An ingress provides load balancing, name based virtual hosting, SSL/TLS termination. Yes, it will do load balancing on services ( backed by pods ). Here is the sample Ingress kubernetes object manifest file.

Example:

 apiVersion: networking.k8s.io/v1beta1
 kind: Ingress
 metadata:
     name: sample-ingress
     annotations:
        nginx.ingress.kubernetes.io/rewrite-target: /
 spec:
     rules:
     - host: foo.bar.com
       http:
          paths:
          - path: /foo
            backend:
                serviceName: service1 ( Backed by service1 pod )
                servicePort: 4200
          - path: /bar
            backend:
                serviceName: service2  ( Backed by service2 pod )
                servicePort: 8080
1

As mentioned in the official documentation:

The ingress controller gives you the ability to:

  • Use only one IP address and port and direct requests to the correct pod based on the Host header and request path

  • Secure communication with built-in SSL termination

  • Apply rate limits for clients while optionally whitelisting IP addresses

  • Select from among any of HAProxy's load-balancing algorithms

  • Get superior Layer 7 observability with the HAProxy Stats page and Prometheus metrics

  • Set maximum connection limits to backend servers to prevent overloading services

Also I recommend the following resources:

L7 routing is one of the core features of Ingress, allowing incoming requests to be routed to the exact pods that can serve them based on HTTP characteristics such as the requested URL path. Other features include terminating TLS, using multiple domains, and, most importantly, load balancing traffic.

I hope it helps.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37