Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart/kill all cloud run instances

Lets say I implement some caching on cloud run start, like google suggests in its own documentation: https://cloud.google.com/run/docs/tips/general#using_global_variables

But my data sometimes change and I would like to update the cache. Since cloud run cannot do async task in the background, my only option is to tell cloud run to kill all the instances and create new ones.

How to do that without deploying a new revision?

Or can I deploy new revision without building a new container?

Thank you

like image 924
tech-escape Avatar asked Oct 27 '25 13:10

tech-escape


1 Answers

For time-based refresh, you can mark instance start time in some global state inside your container. Then you can configure healthchecks for your CloudRun instance to check current vs start time and report as unhealthy if it's time to be replaced.

like image 155
Zaar Hai Avatar answered Oct 29 '25 19:10

Zaar Hai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!