LinkedIn Carousel: Cloud Run vs Kubernetes

Post type: Opinion · 7 slides
Blog post: https://www.nuvikatech.com/blog/posts/cloud-run-vs-kubernetes


SLIDE 1 — Cover

Headline: $800/month in idle Kubernetes node charges. So we switched to Cloud Run. Then hit a problem nobody warned us about.

Sub-line: How a cold-start bug killed our workers silently — and the fix that became a permanent codebase rule.


SLIDE 2

Label: WHY CLOUD RUN

Headline: Scale to zero. No cluster management. Pay for what you use.

Body: For a pre-revenue startup whose dev environment sits idle most of the time, Cloud Run dropped infrastructure costs from ~$800/month to ~$60/month. The case was straightforward.


SLIDE 3

Label: THE PROBLEM

Headline: Cold start: 70 seconds. Cloud Run’s SIGTERM timeout: 60 seconds.

Body: Our Celery workers were loading AWS, Azure, and GCP SDKs at module level. Cold start time exceeded the kill timeout. Workers were being terminated before they could boot — silently, with no error logs.


SLIDE 4

Label: THE FIX

Headline: Lazy imports. Move every cloud SDK import inside the function that uses it.

Body: One change dropped cold start from 70+ seconds to under 8. It also became a permanent rule in our codebase: no cloud SDK imports at module level, ever.


SLIDE 5

Label: THE SECOND-ORDER EFFECT

Headline: Lazy imports rewrote how we patch in tests.

Body: With module-level imports, you patch the name on the module. With lazy imports, you patch at the source package. We had to audit and fix ~40 test files. Not painful, but a surprise.


SLIDE 6

Label: THE BROADER LESSON

Headline: Your infrastructure rewrites your code architecture.

Body: Kubernetes tolerates heavy module-level imports — containers stay warm. Cloud Run punishes them. Neither is objectively better. The question is: do you understand what your platform penalises?


SLIDE 7 — CTA

Headline: Want the full story?

Body: The full breakdown: the 3-day debugging saga, the test patching audit, and whether we’d make the same infrastructure choice again.

Link: nuvikatech.com/blog/posts/cloud-run-vs-kubernetes