📖 Scenario: You are working as a cloud engineer for a small online store. Your task is to design a simple, reliable infrastructure on Google Cloud Platform (GCP) that can handle user requests even if some parts fail.
🎯 Goal: Build a basic GCP setup using Compute Engine instances behind a Load Balancer with health checks to ensure reliability.
📋 What You'll Learn
Create a list of Compute Engine instance names
Set a threshold for minimum healthy instances
Use a loop to create instance configurations
Add a health check configuration to the load balancer
💡 Why This Matters
🌍 Real World
This project models how cloud engineers set up reliable infrastructure components on GCP to keep services running smoothly even when some parts fail.
💼 Career
Understanding reliability design principles and how to configure health checks and instance groups is essential for roles like Cloud Engineer, Site Reliability Engineer, and DevOps Engineer.
Progress0 / 4 steps
1
Create a list of Compute Engine instance names
Create a list called instance_names with these exact values: "web-server-1", "web-server-2", and "web-server-3".
GCP
Hint
Use square brackets to create a list and include the names as strings separated by commas.
2
Set a threshold for minimum healthy instances
Create a variable called min_healthy_instances and set it to the integer 2.
GCP
Hint
Use a simple assignment statement to set the variable.
3
Create instance configurations using a loop
Use a for loop with the variable name to iterate over instance_names. Inside the loop, create a dictionary called instance_config with keys "name" set to name and "status" set to "running". Append each instance_config to a list called instances. Initialize instances as an empty list before the loop.
GCP
Hint
Remember to create the list before the loop and append each dictionary inside the loop.
4
Add a health check configuration to the load balancer
Create a dictionary called health_check with keys "type" set to "HTTP", "port" set to 80, and "healthy_threshold" set to min_healthy_instances.
GCP
Hint
Use a dictionary with the exact keys and values as described.
Practice
(1/5)
1. Which of the following is a key reliability design principle in Google Cloud Platform (GCP)?
easy
A. Disable monitoring to save costs
B. Use only one zone to reduce complexity
C. Distribute resources across multiple zones to avoid single points of failure
D. Avoid backups to speed up deployment
Solution
Step 1: Understand reliability basics in GCP
Reliability means keeping services running even if parts fail. Using multiple zones helps avoid single points of failure.
Step 2: Evaluate each option
Only distributing resources across zones improves reliability. Using one zone or disabling monitoring/backups reduces reliability.
Final Answer:
Distribute resources across multiple zones to avoid single points of failure -> Option C
Quick Check:
Multi-zone deployment = Reliable service [OK]
Hint: Think about avoiding single points of failure [OK]
Common Mistakes:
Choosing single zone for simplicity
Ignoring monitoring importance
Skipping backups to save time
2. Which GCP service feature helps improve reliability by automatically restarting failed instances?
easy
A. BigQuery scheduled queries
B. Cloud Storage versioning
C. Cloud Functions triggers
D. Managed instance group with auto-healing
Solution
Step 1: Identify features that improve instance reliability
Managed instance groups can automatically restart or replace failed VM instances, improving reliability.
Step 2: Match features to options
Cloud Storage versioning protects data, Cloud Functions triggers run code, BigQuery schedules queries but do not auto-restart instances.
Final Answer:
Managed instance group with auto-healing -> Option D
Quick Check:
Auto-healing = Instance reliability [OK]
Hint: Auto-healing means automatic restart of failed instances [OK]
Common Mistakes:
Confusing data versioning with instance recovery
Thinking triggers restart instances
Assuming scheduled queries affect VM health
3. Consider this GCP setup: A Compute Engine VM runs in zone us-central1-a with no backups or snapshots. What happens if the zone experiences an outage?
medium
A. The VM automatically moves to another zone without downtime
B. The VM becomes unavailable until the zone recovers or manual action is taken
C. The VM data is preserved and accessible from other zones instantly
D. The VM restarts automatically in a different region
Solution
Step 1: Understand zone outage impact on single-zone VM
If a VM runs only in one zone without backups, an outage in that zone makes the VM unavailable.
Step 2: Analyze options for VM behavior
Automatic movement or restart in other zones requires multi-zone setup or managed groups, which is missing here.
Final Answer:
The VM becomes unavailable until the zone recovers or manual action is taken -> Option B
Quick Check:
Single zone outage = VM downtime [OK]
Hint: Single zone failure means VM downtime without backups [OK]
Common Mistakes:
Assuming automatic failover without multi-zone setup
Confusing data preservation with availability
Thinking VM restarts in different region automatically
4. You deployed a Cloud SQL instance without enabling automated backups. After accidental data deletion, you cannot restore the data. What is the main reliability design mistake here?
medium
A. Not enabling automated backups for recovery
B. Not enabling logging for audit
C. Not using a managed instance group
D. Not using multiple zones for the instance
Solution
Step 1: Identify recovery options for Cloud SQL
Automated backups allow restoring data after accidental deletion.
Step 2: Match mistake to options
Without backups, recovery is impossible. Multi-zone improves availability but not data recovery. Managed groups and logging do not restore data.
Final Answer:
Not enabling automated backups for recovery -> Option A
Quick Check:
Backups enable data recovery [OK]
Hint: Backups are essential for data recovery [OK]
Common Mistakes:
Confusing availability with data recovery
Thinking multi-zone replaces backups
Ignoring backup importance
5. You want to design a highly reliable web application on GCP that remains available even if an entire region fails. Which combination of design principles should you apply?
hard
A. Distribute instances across multiple regions with load balancing and automated failover
B. Use a single zone with Cloud Storage backups and manual failover
C. Deploy instances in multiple zones within one region and enable auto-healing
D. Deploy all resources in one region and rely on Cloud Monitoring alerts
Solution
Step 1: Understand regional failure impact
To survive a whole region failure, resources must be in multiple regions, not just zones.
Step 2: Evaluate design options
Multi-zone in one region protects only against zone failure. Single zone with backups is slow and manual. One region with monitoring does not prevent downtime. Multi-region with load balancing and failover ensures high availability.
Final Answer:
Distribute instances across multiple regions with load balancing and automated failover -> Option A
Quick Check:
Multi-region + failover = High availability [OK]
Hint: Multi-region deployment handles region failures [OK]
Common Mistakes:
Confusing zone and region failures
Relying on manual failover
Ignoring load balancing benefits
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.