I tried creating an internal load balancer with the following annotation as mentioned in this documentation:
networking.gke.io/internal-load-balancer-allow-global-access: "true"
Here is the full manifest:
apiVersion: v1
kind: Service
metadata:
name: ilb-global
annotations:
cloud.google.com/load-balancer-type: "Internal"
networking.gke.io/internal-load-balancer-allow-global-access: "true"
labels:
app: hello
spec:
type: LoadBalancer
selector:
app: hello
ports:
- port: 80
targetPort: 8080
protocol: TCP
I tried accessing the load balancer from a VM in a different region but the VM is not able to reach the endpoint.
However according to this documentation I ran the following command on the created forwarding-rule (GCP creates a forwarding-rule with a random name for all the load balancers which can be retrieved using gcloud compute forwarding-rules list
command) to update the Global access:
gcloud beta compute forwarding-rules update abcrandomnamehehe --region [REGION-NAME] --allow-global-access
After running the above command and updating the load balancer manually, the endpoint is accessible from all the regions. Is this manual step of running gcloud
command necessary?
If yes,what is the use of the annotation then? I the annotation with the latest available GKE version (1.15.4-gke.22) as well but doesn't work without being updated using the gcloud
command. Is there something I am missing or it is a bug in GCP?
EDIT: I had also opened this issue with GCP which was addressed pretty quickly and they have updated the public documentations (Jan 15, 2020) to specifically mention the requirement of GKE 1.16 for the Global Access feature to work.