GithubHelp home page GithubHelp logo

cloud-run-traffic's Introduction

Switch Cloud Run revisions without mixed traffic

There are two ways.

A. After deploying new revision, and then update routing to the latest.

B. After deploying new revision with new tagged url, and then update routing to it.

From perspective of comfirmability if the new revison was available, the B has advantage rather than A.

Note: Log Analytics or Log sink will enable you to see if traffic was mixed by logging query before working it.

B. After deploying new revision with new tagged url, update routing to it.

Prerequisite

  • Docker engine working on local.
  1. Build image
make image
  1. Deploy the first revison.
make deploy

It will give you the service url.

https://###########-############-uc.a.run.app

You can test the service,

curl https://###########-############-uc.a.run.app/version

You will see like this,

version: standard
  1. Deploy the new tagged revision. Set tag name
export VER=v10

Deploy as below,

make tag-deploy

It generate new tagged url.

https://v10---###########-############-uc.a.run.app
  1. Switch to new one after confirmation. Make sure if the new tagged revision is available completely.
curl https://v10---###########-############-uc.a.run.app/version

After that,

make update-traffic-tag
  1. Access the url of service.
curl https://###########-############-uc.a.run.app/version

You will not see any responses from the old url.

  1. Remove the tagged url after switching successfully.
make remove-tag

That's it.
Have a nice Cloud Run day!

cloud-run-traffic's People

Contributors

shin5ok avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.