Home > other >  kubernetes load balancer same ip adress different ports
kubernetes load balancer same ip adress different ports

Time:01-19

I have 3 different services and their service types LoadBalancer. Each one has different external ip. However I want to use one ip address for every one but different ports as external ip. Is it possible?

CodePudding user response:

The only way you can have the same IP across different services that I am aware of, is to use an Ingress. But depending on the controller implementation, you may only be able to use ports 80/443.

CodePudding user response:

You can implement it using ingress.

  1. Let you applications deployed using the Deployment type workload
  2. Expose your deployments using services
  3. Install ingress controller (you can use nginx ingress controller)
  4. Create your ingress resource to route your request based on a particualr context to a particular service.

Here is the reference from the kubernetes documentation which clearly elaborates on it - https://kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout

  •  Tags:  
  • Related