Lonare
Lonare

Reputation: 4663

GCP Build with Google Run always create a new service why?

Hi have a basic CI/CD setup

Whenever I push new code on my GitHub repository (trigger).

It should push it via Google Build to Google Run

But currently, whenever the trigger is initiated, it creates a new service on my cloud account.

Now, I am not sure why it's happening!

What I want is to update the current running service on Google Run

or

Create a new service, migrate 100% traffic to it and delete the old one.

This is my Deployment screen looks like. I have highlighted the section which I believe might be the reason for this duplicate services.

enter image description here

Upvotes: 1

Views: 91

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75775

When you deploy a new version of your service (a new version can be a new image, or the same image with different parameters (concurrency, min/max instance, CPU, env vars,...)), it's named a revision. There is no limit on the number of revision (in fact yes, you have a limit at 1000, then the oldest will be deleted when a new one is created).

The pricing model of Cloud Run (and other serverless product) is simple: you pay when your service is running. In your case, you haven't a min instance parameter, and therefore your revision will run (and you will start to pay) when request invokes your service (and you pay only when you go over the free tier)

Same thing for Cloud Build: you start to pay when you use it. And you use it every time you push your code on GitHub (that invoke a Cloud Build trigger and then deploy your code on Cloud Run). Here again, you have a comfortable free tiers of 120 minutes free per day for Cloud Build.

Upvotes: 1

Related Questions