Name Load balancer which you are using in your application and what all steps need to follow while configuring it with Kubernetes or any of the cloud?

A load balancer, such as NGINX, distributes incoming traffic across multiple instances of a service, and configuring it with Kubernetes typically means deploying it as an Ingress Controller that routes external traffic into the cluster.

Key Points: • The NGINX Ingress Controller is deployed into the cluster and acts as the entry point for all external HTTP/HTTPS traffic. • Ingress resources define routing rules, mapping hostnames and URL paths to specific backend Kubernetes Services. • The Ingress Controller watches for changes to Ingress resources and updates its routing configuration automatically, without manual reconfiguration. • TLS termination, path rewriting, and basic rate limiting can be configured directly on the Ingress resource or via NGINX-specific annotations. • Behind the scenes, Kubernetes Services already load-balance across healthy pod replicas, so the Ingress Controller and the Service together provide traffic distribution at both the edge and within the cluster.

Example: An Ingress resource might route example.com/orders to the order-service Kubernetes Service and example.com/users to the user-service Service, and the NGINX Ingress Controller spreads incoming requests for each path across all healthy pods behind that Service.

Code Example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: app-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: example.com
      http:
        paths:
          - path: /orders
            pathType: Prefix
            backend:
              service:
                name: order-service
                port:
                  number: 80

Interview Tip: A concise interview answer is:

"I typically use NGINX as the load balancer, deployed as an Ingress Controller in Kubernetes. I define Ingress resources with routing rules mapping hosts and paths to backend Services, and the controller automatically picks those up and distributes traffic to healthy pods, with TLS and rate limiting configured through annotations."