I have a cloud build pipeline which builds and tries to deploy a multi-container service on Cloud Run.
The containers are:
I specified in the cloudbuild.yaml that frontend
depends on backend
:
args:
- beta
- run
- deploy
- $_SERVICE_NAME
- >-
--container=frontend
- >-
--image=$_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME-frontend:$COMMIT_SHA
- --port=3000
- --depends-on=backend
However, this doesn't build because of error:
spec.template.spec.containers[0].depends_on: Dependent container 'backend' must have startup probe specified
And I don't see a way to specify the startup probe in the docs. https://cloud.google.com/sdk/gcloud/reference/beta/run/deploy
You cannot use gcloud [beta] run deploy
This may be (!?) because the complexity in the service configuration becomes somewhat overwhelming to define using CLI args|flags.
You will need to define your service as a Knative Service
and you can then use gcloud [beta] run services replace
to deploy it.
In my experience, defined Cloud Run resources using the YAML configuration is probable the better way to go and more closely mirrors Kubernetes' model.