Stop 09 · Containers & OrchestrationTopics · 5/9

Managed Container Services (ECS, Cloud Run)

Part of the Cloud Computing Roadmap

In short

Sometimes you just want your container on the internet with HTTPS and autoscaling, and no cluster to babysit. That's what services like Cloud Run and ECS on Fargate are for.

Simpler, more opinionated alternatives to Kubernetes for running containers — less flexible, but significantly easier to operate for teams that don't need Kubernetes' full feature set.

The blob character serves food from a ready-made food court stall.

Think of it like this

The food court stall

You rent a stall that already has a counter, lights, gas and cleaning. You bring your recipe and start serving. More customers at lunch? The food court opens the next stall for you. You never deal with the building.

Watch it happen

Deploy an image, get a URL

You
Registry
Cloud Run
Visitors

push notes-api:1.0

1/5You build your container image and push it to a registry like Artifact Registry.

The big ideas

What you need to know

Bring a container

Any language works as long as it's in an image and, for Cloud Run, listens on the PORT it's given.

Cloud Run

Google's fully managed option: request-driven, scales to zero, billed for the time containers serve.

ECS on Fargate

AWS runs tasks without servers to manage. You define services, tasks and a load balancer yourself.

Know the limits

Less control than Kubernetes: fewer networking tricks, no custom node setups, provider-specific config.

See it in code

Walk through the code

bash
1# From a folder with a Dockerfile (or a supported language)2gcloud run deploy notes-api \3  --source . \4  --region asia-south1 \5  --allow-unauthenticated \6  --min-instances 0 \7  --max-instances 5 \8  --memory 512Mi

1/3Build from the current folder and deploy as a service named notes-api.

--source builds the image for you with Cloud Build. --max-instances caps how far it scales, which also caps the surprise on your bill.

Save yourself the pain

Common mistakes

Oops

Hard-coding port 8080 when Cloud Run passes a PORT environment variable.

Do this instead

Read process.env.PORT (or the equivalent) and listen on it.

Oops

Storing uploaded files on the container's local disk.

Do this instead

Instances come and go. Save files to Cloud Storage or S3 and data to a managed database.

Your mission

Ship a container in 30 minutes

~30 min

Quick check

What does "scale to zero" mean for a Cloud Run service?

Go deeper

  1. 1Deploy a simple container to a managed container service like ECS or Cloud Run.
  2. 2Compare the setup complexity to your managed Kubernetes deployment from the previous topic.
  3. 3Learn why these services are often the right choice for smaller teams or simpler architectures.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge