Expose Multiple Apps with one LoadBalancer in Kubernetes

Tasrie IT Services
2 min readMay 5, 2023

--

In most cases, a single Kubernetes cluster may have multiple backend services that require load balancing. In such cases, deploying each app to its load balancer can be expensive and may not be feasible in terms of management and cost. A better approach is to deploy multiple apps to a single load balancer. This is possible using the Ingress resource in Kubernetes.

An Ingress is a Kubernetes resource that defines rules for routing external HTTP(S) traffic to Kubernetes services. In other words, an Ingress is an API object that manages external access to the services in a cluster. The Ingress resource can be configured to route traffic based on the domain name, path, or any other parameter that can be extracted from the HTTP(S) request.

To deploy multiple apps to a single load balancer, you need to create an Ingress resource that maps to the backend services. Each backend service should have a unique hostname or path. When the external traffic hits the load balancer’s front end, the Ingress resource routes the traffic to the appropriate backend service based on the routing rules defined in the Ingress.

Steps to Implement this Approach

  1. Install NGINX Ingress Controller
  2. Deploy you app onto the kubernetes cluster
  3. Create Service with selector label pointing to your app label
  4. Create Ingress using the service name creating above.

If you would like to read detailed guide.

Please visit

https://tasrieit.com/expose-multiple-apps-with-one-loadbalancer-in-kubernetes/

--

--

Tasrie IT Services
Tasrie IT Services

Written by Tasrie IT Services

Accelerating digital transformation with seamless DevOps, Cloud solutions and Services

No responses yet