Hello everyone,
I'm currently working on deploying a containerized application to Google Cloud Run using Cloud Deploy. The application consists of two components: one API and one client side.
I plan to deploy both components with a single release for each of the deployment targets I have set up: development (dev), staging, and production (prod).
Now, here comes the puzzle: When I deploy, I find that only the client-side component (`silicon-ssr` image) gets successfully deployed and is visible on Google Cloud Run. However, mysteriously enough, the API component (`silicon-api` image) doesn't show up, even though I don't receive any error messages during the deployment process.
At this point, I'm wondering if it's technically feasible to deploy two images simultaneously with a single release for each target. Has anyone run into a similar issue or done something similar?
my current configuration :
cloud build
...
# Create a cloud deploy release for both client and api images at the same time in one release
- id: create-cloud-deploy-release
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: '/bin/bash'
args:
- -c
- |
gcloud deploy releases create r-$REVISION_ID --project=$PROJECT_ID --region=$_REGION --delivery-pipeline=$_PIPELINE_NAME --images=silicon-api=us-central1-docker.pkg.dev/$PROJECT_ID/silicon/$_CONTAINER_REPO_NAME/silicon-api@$(cat /workspace/digest_api.txt),silicon-ssr=us-central1-docker.pkg.dev/$PROJECT_ID/silicon/$_CONTAINER_REPO_NAME/silicon-ssr@$(cat /workspace/digest_client.txt)
wait_for:
- apply-binauthz-policy-client
images:
[
'us-central1-docker.pkg.dev/$PROJECT_ID/silicon/$_CONTAINER_REPO_NAME/silicon-api:$REVISION_ID',
'us-central1-docker.pkg.dev/$PROJECT_ID/silicon/$_CONTAINER_REPO_NAME/silicon-ssr:$REVISION_ID',
]
...
cloud deploy
apiVersion: deploy.cloud.google.com/v1
kind: DeliveryPipeline
metadata:
name: silicon-pipeline
description: silicon deployment pipeline
serialPipeline:
stages:
- targetId: dev
profiles: [dev-api, dev-client]
- targetId: staging
profiles: [staging-api, staging-client]
- targetId: prod
profiles: [prod-api, prod-client]
---
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: dev
description: Cloud Run DEV API service
run:
location: projects/_PROJECT_ID/locations/_LOCATION
---
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: staging
description: Cloud Run STAGING API service
run:
location: projects/_PROJECT_ID/locations/_LOCATION
---
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: prod
description: Cloud Run PROD API service
run:
location: projects/_PROJECT_ID/locations/_LOCATION
skaffold
apiVersion: skaffold/v4beta9
kind: Config
metadata:
name: silicon-pipeline
profiles:
- name: dev-api
manifests:
rawYaml:
- profiles/dev/deploy-dev-api.yaml
- name: staging-api
manifests:
rawYaml:
- profiles/staging/deploy-staging-api.yaml
- name: prod-api
manifests:
rawYaml:
- profiles/prod/deploy-prod-api.yaml
- name: dev-client
manifests:
rawYaml:
- profiles/dev/deploy-dev-client.yaml
- name: staging-client
manifests:
rawYaml:
- profiles/staging/deploy-staging-client.yaml
- name: prod-client
manifests:
rawYaml:
- profiles/prod/deploy-prod-client.yaml
deploy:
cloudrun: {}
profiles/dev/deploy-dev-api.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: silicon-api-app-dev
spec:
template:
spec:
containers:
- image: silicon-api
profiles/dev/deploy-dev-client.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: silicon-ssr-app-dev
spec:
template:
spec:
containers:
- image: silicon-ssr
etc...
Solved! Go to Solution.