Moving from GKE to Cloud Run

Google Cloud TechAbout 5 min readJun 8, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • Containers
  • Kubernetes Engine (GKE)
  • Cloud Run
  • Artifact Registry
  • Compute Engine service account
  • Cloud SQL
  • Application lifecycle
  • Bursty workloads
  • Scaling to zero
  • Container image
  • Environment variables

1. Main Topics and Key Points:

  • The video addresses the common question of whether developers should deploy their containerized applications on Kubernetes Engine (GKE) or Cloud Run.
  • Mofi suggests that developers should start with whichever platform they are most comfortable with, as switching between them is possible.
  • The video demonstrates migrating a web application from GKE to Cloud Run.
  • Cloud Run is presented as a suitable option for bursty workloads that may benefit from scaling to zero during periods of low traffic.
  • Permissions for accessing Cloud SQL from Cloud Run are discussed, emphasizing the use of service accounts.
  • The deployment process using the gcloud run deploy command is detailed.

2. Important Examples, Case Studies, or Real-World Applications Discussed:

  • The example application is a web app that allows users to vote on whether they prefer coding with spaces or tabs, which accesses Cloud SQL.
  • The case study involves developers who initially chose GKE due to their Kubernetes expertise but later found that their workload was bursty and they didn't want to manage the application lifecycle.

3. Step-by-Step Processes, Methodologies, or Frameworks Explained:

  • Migrating an application from GKE to Cloud Run:
    1. Ensure the application is containerized and the image is stored in Artifact Registry.
    2. Grant the Compute Engine service account the necessary permissions to access Cloud SQL using the gcloud projects add-iam-policy-binding command. Specifically, grant the "Cloud SQL Client" role.
    3. Deploy the container to Cloud Run using the gcloud run deploy command with the following options:
      • --image: Specifies the container image to deploy.
      • --region: Specifies the region to host the service.
      • --add-cloudsql-instances: Adds the connection to the Cloud SQL database.
      • --allow-unauthenticated: Allows anyone to connect to the service.
      • --set-env-vars: Sets environment variables for database access.

4. Key Arguments or Perspectives Presented, with Their Supporting Evidence:

  • Argument: Developers can start with either GKE or Cloud Run and switch later.
    • Evidence: The video demonstrates a practical migration from GKE to Cloud Run.
  • Argument: Cloud Run is suitable for bursty workloads.
    • Evidence: Cloud Run can scale to zero, reducing costs during periods of low traffic.
  • Argument: Cloud Run simplifies deployment.
    • Evidence: The analogy of a 100-meter race where Cloud Run handles the last 50 meters.

5. Notable Quotes or Significant Statements with Proper Attribution:

  • Mofi: "They can start with whatever they're most comfortable with. They can always switch later."
  • Mofi: "If they use Cloud Run, they can scale the application to zero so they don't have to pay for those times."
  • Mofi: "If it's a 100 meter race to deploy an application, with Cloud Run we only have to run the first 50. Cloud Run does the rest."

6. Technical Terms, Concepts, or Specialized Vocabulary with Brief Explanations:

  • Containers: A standardized unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.
  • Kubernetes Engine (GKE): Google's managed Kubernetes service for deploying, managing, and scaling containerized applications.
  • Cloud Run: A managed compute platform that enables you to run stateless containers via web requests or Pub/Sub events.
  • Artifact Registry: A single place for your organization to manage container images and language packages.
  • Compute Engine service account: A special type of Google Cloud account that is used by applications and virtual machines (VMs) to make authorized API calls.
  • Cloud SQL: A fully-managed database service that makes it easy to set up, maintain, manage, and administer your relational databases on Google Cloud.
  • Bursty workloads: Workloads that experience significant fluctuations in traffic or resource demand.
  • Scaling to zero: The ability of a service to automatically reduce its resource allocation to zero when there is no traffic, thus eliminating costs.
  • Container image: A lightweight, standalone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings.
  • Environment variables: A set of dynamic named values that can affect the way running processes will behave on a computer.

7. Logical Connections Between Different Sections and Ideas:

  • The video starts by addressing the initial question of choosing between GKE and Cloud Run.
  • It then presents a practical example of migrating an application from GKE to Cloud Run, illustrating the feasibility of switching between platforms.
  • The discussion of permissions and service accounts logically follows the deployment process, highlighting the necessary configurations for accessing Cloud SQL.
  • The analogy of the 100-meter race reinforces the idea that Cloud Run simplifies deployment.

8. Any Data, Research Findings, or Statistics Mentioned:

  • No specific data, research findings, or statistics are mentioned.

9. Clear Section Headings for Different Topics if Multiple Areas are Covered:

  • The video flows as a conversation and demonstration, so there are no explicit section headings. However, the key topics covered are:
    • Introduction and initial question (GKE vs. Cloud Run)
    • Demonstration of migrating from GKE to Cloud Run
    • Permissions and service accounts
    • Deployment process using gcloud run deploy
    • Conclusion and recommendations

10. A Brief Synthesis/Conclusion of the Main Takeaways:

The main takeaway is that developers should prioritize using containers and choose the platform (GKE or Cloud Run) they are most comfortable with initially, knowing that they can migrate between them later. Cloud Run is particularly well-suited for bursty workloads due to its ability to scale to zero. The video provides a practical demonstration of migrating an application from GKE to Cloud Run, highlighting the necessary steps and configurations.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.