I'm sure the solution to my issue is somewhere in the documentation, but I cannot figure out how to configure a default service that gets used when setting up my global external load balancer on GCP. It might be relevant to mention that all my services behind the load balancer are Cloud Run services.
I have my base URL, say example.com, and a bunch of services that are attached to it. For example, I have a example.com/login and a example.com/api. This part works perfectly fine so far. Now I would like to add a "default" service that gets called when the user access the base URL.
What I have (and is working as expected) is something like this:
gcloud compute network-endpoint-groups create $SERVERLESS_NEG_NAME \
--region=$REGION \
--network-endpoint-type=serverless \
--cloud-run-url-mask="${BASE_URL}/<service>"
# create backend service
gcloud compute backend-services create $BACKEND_SERVICE_NAME \
--load-balancing-scheme=EXTERNAL_MANAGED \
--global
# add serverless NEG to backend service
gcloud compute backend-services add-backend $BACKEND_SERVICE_NAME \
--global \
--network-endpoint-group=$SERVERLESS_NEG_NAME \
--network-endpoint-group-region=$REGION
# create URL map with just one backend service
gcloud compute url-maps create $URL_MAP_NAME \
--default-service=$BACKEND_SERVICE_NAME
How would I add a default service (e.g. default-service) which gets forwarded to when the base URL is accessed?