Search code examples
kubernetesload-balancingkubernetes-ingress

How to access multiple services in Kubernetes using Ingress?


We have an application and for each customer we provision a new namespace. There are two deployments running inside a single namespace:

  • front-end Deployment
  • Back-end Deployment

The front-end should be accessed by the users hence we are using LoadBalancer for each customer (We have a VM Based k8s cluster).

The problem is, as of now we have a few customers and when the business grows, the customers will be increasing and will be having more NameSpaces.

For example: If there are 100 Users, we have to have 100 LoadBalancers. This is not practical and can we have a single LoadBalancer instead and allow all the 100 Users to access through that LoadBalancer?

Can we do this using Ingress?


Solution

  • Yes, ingress is a right way to manage your case.

    Generally you've already mentioned why ingress should be used - get a single entry point to the cluster and not having a lot of load balancers which is not convenient and may be expensive in cloud environment.

    Main benefits of using ingress are:

    • TLS termination
    • hosts/paths based routing
    • serves itself as a loadbalancer

    and many more.

    You can choose an ingress which fits better for your use-case. Ingress options

    Most common are:

    Please consider getting familiar with general concepts and examples of kubernetes ingress