0
0
GCPcloud~30 mins

GKE vs Cloud Run decision in GCP - Hands-On Comparison

Choose your learning style9 modes available
GKE vs Cloud Run Decision Guide
📖 Scenario: You are a cloud architect helping a small company decide how to deploy their containerized applications on Google Cloud Platform. They want to understand when to use Google Kubernetes Engine (GKE) versus Cloud Run.
🎯 Goal: Build a simple Python dictionary that lists application types and their recommended deployment option (GKE or Cloud Run). Then add a configuration variable for workload size, write logic to select the deployment based on workload, and finally complete the decision guide with a summary statement.
📋 What You'll Learn
Create a dictionary named app_deployments with exact keys and values for application types and deployment options
Add a variable named workload_size with a string value representing workload size
Write a function named choose_deployment that takes an application type and workload size and returns the recommended deployment
Add a final variable named decision_summary that stores a summary string using the function
💡 Why This Matters
🌍 Real World
This project helps beginners understand how to decide between GKE and Cloud Run for deploying containerized applications based on workload and application complexity.
💼 Career
Cloud architects and developers often need to choose the right Google Cloud service for deployment. This exercise builds foundational decision-making skills for cloud infrastructure.
Progress0 / 4 steps
1
Create the application deployment dictionary
Create a dictionary called app_deployments with these exact entries: 'microservice': 'Cloud Run', 'batch job': 'Cloud Run', 'complex app': 'GKE', 'stateful app': 'GKE'
GCP
Need a hint?

Use curly braces to create a dictionary with the exact keys and values.

2
Add workload size configuration
Add a variable called workload_size and set it to the string 'small'
GCP
Need a hint?

Assign the string 'small' to the variable workload_size.

3
Write deployment decision function
Write a function called choose_deployment that takes parameters app_type and workload. It should return 'GKE' if workload is 'large', otherwise return the deployment from app_deployments[app_type]
GCP
Need a hint?

Use an if-else statement inside the function to check workload size.

4
Add final decision summary
Add a variable called decision_summary that stores the string "For a microservice with small workload, deploy to " plus the result of choose_deployment('microservice', workload_size)
GCP
Need a hint?

Use string concatenation with the function call to build the summary.