Managing traffic on Google Cloud Run

762 Views Asked by At

I'm actually using Cloud Build & Cloud Run in my project.

For the CI/CD, I use a cloudbuild.yaml file to define the steps I need to perform to deploy my new revision of Cloud Run.

After several issue on traffic management, I had to add to my Cloud Build file a step to specify that the traffic should be set to 100% to the latest built revision. That is weird but it is working so... be it

cloudbuild.yaml step

# Allocate 100% of the traffic to that new revision
- name: gcr.io/cloud-builders/gcloud
  args: ['run', 'services', 'update-traffic', '${_APP_NAME}', '--to-revisions=LATEST=100', '--platform', 'gke', '--cluster', 'xxxxxx', '--cluster-location', 'xxxxxxxxxxx', '--namespace', 'xxxxxxxx']

Unfortunately, even if the traffic is well set, it always keeps "alive" the old revision .

enter image description here

What is strange is that it is not doing it when I'm doing it remotely using gcloud command. Did you already have that issue in the past ?

Thanks for the help :)

0

There are 0 best solutions below