GoogleCloudPlatform/cloud-run-hello

Make the container display the value of an env var if present

steren opened this issue · 4 comments

Now that Cloud Run supports traffic splits, we often need a demo container ro demo blue/green deployment.

What I usually do is I take a go hello world that display the value of an env var (if present), and I set it to "blue" and "green" in two revisions for my demo.

It could be useful to have this container do the same, so that we don't even need to build one.

One word of the text could change based on this env var for example

If it helps showing blue/green deployments, we actively maintain:

  • gcr.io/google-samples/hello-app:1.0
  • gcr.io/google-samples/hello-app:2.0

which print different version numbers (hence indicating canary rollout).

Good to know.

I still think it would help to show the concept of revision to be able to alter the page with an "quick and outside of the container" change.

No rush, I was just capturing a need I had this morning.

+1 on this request. I demo these things randomly without much prep and I usually just grab the cloud-run-hello container because it's shown in the UI.

PRs welcome, this change should be straightforward (the code already looks for some env vars)