0
votes

I'm new to google cloud.

Our project has been deployed on google Cloud. We are using gcloud deploy commands to deploy any build and we are good with it.

My question is: what if my current build fails during production deployment and there's lots of users using the application.

So, how can I update the previous image/build immediately in GCP? I have tried it with pull docker and push it then submitting via "gcloud build submit" command... but it's not deploying actual specified docker image, it's deploying that folder where I'm running commands of "gcloud build submit"..

Please share your suggestions..

1
Which product are you using?guillaume blaquiere
product means ?RK7002
Where are you deploying your workload? On Compute Engine? On Cloud Run? On App Engine?....guillaume blaquiere
On App Engine..RK7002
@guillaumeblaquiere Actually what i need, we have already existing production environment and we are new to google cloud app engine deployment things... So, I know how to deploy our new changes on gcloud.. but it's risky for us because it's first time... we just want to know about the rollback steps.. if any thing goes wrong we will able to revert previous build on google cloud.. so, any user can stuck in liveRK7002

1 Answers

2
votes

Your concern to not break all the users when you are deploying a broken version is legit, and you aren't alone!!

That's why a cool feature exist on App Engine (and also on Cloud Run): Traffic splitting.

To use it efficiently, you can deploy your new version in production like this:

gcloud app deploy --no-promote

Here the new version is deployed but 0% of the traffic is routed to it. Now use this command to increase the traffic, let say 1%

gcloud app services set-traffic <YOUR_SERVICE> --splits <OldVersionName>=99,<NewVersionName>=1

Monitor your application for a while, and, if there isn't error, continue to increase gradually the traffic, up to be confident and routed 100%

In case of bad version, set the traffic to 0% to the new version and now/or low impact to your users.