Load Balancer for multiple workloads on different ports

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:
Cloud being used: GCP
Installation method:
Host OS:
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

Hi All,

I am new to this forum and infect very new to Kubernetes as well. I am faced with the situation where I need to expose pods (2 pods per workload) from multiple workloads (3 workloads) which are running on different ports (one per workload) under same load balancer IP/Port to distribute the traffic. While I am aware that I can add an LB service very easily on top of all pods from same workload but not sure how to accommodate all pods under same LB service from all workloads.

Any help or pointers to useful documentation is greatly appreciated.



Are the ports all fungible, or do you need to expose 3 different ports?

Do you need it to be port based or is HTTP host or path better?

If HTTP is better, you want Ingress. If it needs to be ports, you
need Service. Some providers will let you manually assign IP
addresses to Service LBs and even re-use that IP across multiple LBs,
as long as the ports are disjoint.