Hi,
I am trying to call one of my cloud run services via cloud build.
My cloud run service network is configured with
- Ingress control: internal
- A VPC connector to our default VPC network on this project
For cloud build,
- I create a private pool on the default VPC network of this project as well and using a custom IP range which I created following https://cloud.google.com/build/docs/private-pools/set-up-private-pool-to-use-in-vpc-network
However, with this setup, the builds fail because the requests to https://MYCLOUDRUN.run.app/get failed with 404.
Thanks for your help!
Hi @outflier,
Welcome to Google Cloud Community!
There are several ways on how to resolve error 404:
For Cloud Run:
gcloud run services describe [service_name] | grep [URL]
404
.404
should not be present in Cloud Logging when using this filter:
resource.type="cloud_run_revision"
log_name="projects/[project_id]/logs/run.googleapis.com%2Frequests"
httpRequest.status=404
For Cloud Build:
You may check the following documentations for your reference:
Hope this helps.
The requests from Cloud Build shared or private work pools are not considered internal, So it is not possible to access the cloud run endpoint from Cloud Build if you set the ingress control to internal only. You need to expose the cloud run behind an internal load balancer or a proxy to access the cloud run service from the cloud build. Refer to https://cloud.google.com/run/docs/securing/private-networking#from-gcp