Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GCP Cloud Deploy parallel deployment of cloud run services

I am trying to move our deployment process to Cloud Deploy. We currently have about 10 different services in the dev environment that are deployed in parallel or independently.

How can I achieve this using Cloud Deploy? 

0 5 2,071
5 REPLIES 5

Hi @Lumexralph ,

A parallel deployment can be performed with Cloud Deploy and Cloud Run using a multi-target and deploy parameters. 

To deploy a single service to Cloud Run, see:

https://cloud.google.com/deploy/docs/deploy-app-run

To deploy a service across multiple regions / in parallel, see:

https://cloud.google.com/deploy/docs/deploy-app-parallel

The 'Basic Walkthrough - Cloud Run' may also be useful. See, here:
https://cloud.google.com/deploy/docs/tutorials

Does this help?

 

@sanderbogdan Thank you for the reply. I had consulted all these docs prior to now and none has a clear configuration of how to parallel deploy multiple cloud run services in the same region.

I tried the parallel deploy of multiple cloud run services into same region but got this error


"error: the manifest contains a KRM definition with kind: Service. As a result the manifest is assumed to define a Cloud Run Service. However, 3 KRM definitions were found, a manifest may only define one Cloud Run Service"

Similar, to what this person is trying to do: https://stackoverflow.com/questions/76982593/can-google-cloud-deploy-deploy-to-multiple-child-target...

@sanderbogdan Any thoughts ? or it's not yet possible?

The way I got this to work is to use deployParameters. I used a single `service.yaml` to stand as a template then used deploy parameters https://cloud.google.com/deploy/docs/parameters to change the attributes using the pipeline Target.

This way, I can deploy multiple cloud run services in parallel.

HI @Lumexralph ,

My apologies for the late reply. Yes, our advisement would be to first separate the present 3 service definitions into a single service definition per file(s). Cloud Deploy cannot deploy multiple Cloud Run services definitions in a single service definition file, concurrently.

Then you would need to decide whether you want those 3 services deployed in separate delivery pipelines, or together, in a single delivery pipeline. If you are deploying them together in a single delivery pipeline, and choose to parallel deploy the services, you would need to consider the approach it appears you have chosen: to create a service definition template for the multi-target, and then to use deploy parameters to parameterize each child target with the service name and desired settings.