首页 > 解决方案 > Why GCP loadbalancer frontend has only two ports enabled?

问题描述

I am trying to create a load balancer in GCP. I have created two instance groups and each instance group has single vm attached to itself. One vm is having a port 80 and another vm is having a port enabled at 86.

The moment I create a load balancer, I find a frontend ip configuration always enabled at 80.

I am looking forward to something like this, ip:80 and ip:86. Since I am new to GCP, I am struggling with this part

标签: google-cloud-platform

解决方案


A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud load balancer. With Google cloud you can create a single forwarding rule with a single IP by adding 2 ports separated by comma. This port limitation for the TCP proxy load balancer and is due to the way TCP proxy load balancers are managed within the GCP internal infrastructure. It is not possible to use any port outside of this list.

For example: Create a named port for the instance group.

gcloud compute instance-groups set-named-ports us-ig2
--named-ports tcp110:110
--zone us-east1-b

gcloud compute health-checks create tcp my-tcp-health-check --port 110


推荐阅读