Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
296e88d
docs(gcp): author chapter q1.md
EdwinPhilip Oct 25, 2026
750f07b
docs(gcp): author chapter q2.md
EdwinPhilip Oct 25, 2026
e220c0f
docs(gcp): author chapter q3.md
EdwinPhilip Oct 25, 2026
554cde6
docs(gcp): author chapter q4.md
EdwinPhilip Oct 25, 2026
2142cea
docs(gcp): author chapter q5.md
EdwinPhilip Oct 25, 2026
78aba45
docs(gcp): author chapter q6.md
EdwinPhilip Oct 25, 2026
be41ca2
docs(gcp): author chapter q7.md
EdwinPhilip Oct 25, 2026
cf24bf7
docs(gcp): author chapter q8.md
EdwinPhilip Oct 25, 2026
73e4abe
docs(gcp): add 40 senior interview follow-ups with complete answers
EdwinPhilip Oct 25, 2026
b8108b6
docs(gcp): add module overview and safe practical labs
EdwinPhilip Oct 25, 2026
67163ca
docs(gcp): add module overview and safe practical labs
EdwinPhilip Oct 25, 2026
926533b
docs(gcp): add chapter sidebar and main navigation
EdwinPhilip Oct 25, 2026
5582d14
docs(gcp): list Module 5 on knowledge base landing page
EdwinPhilip Oct 25, 2026
d18cf5b
docs(gke): add full control-plane and cluster mode chapter
EdwinPhilip Oct 25, 2026
4331f62
docs(gke): add node pool and autoscaling lifecycle chapter
EdwinPhilip Oct 25, 2026
efb1313
docs(gke): explain GKE VPC-native and eBPF packet flows
EdwinPhilip Oct 25, 2026
9f51013
docs(gke): document gateway ingress NEGs and load balancer request flows
EdwinPhilip Oct 25, 2026
de02cd9
docs(gke): add workload identity RBAC and isolation chapter
EdwinPhilip Oct 25, 2026
3ce917d
docs(gke): add CSI storage and stateful recovery chapter
EdwinPhilip Oct 25, 2026
7d917f4
docs(gke): add HPA VPA resource scaling and latency chapter
EdwinPhilip Oct 25, 2026
637d89c
docs(gke): add upgrades SLO incident and recovery chapter
EdwinPhilip Oct 25, 2026
5dd3b31
docs(gke): add 40 senior GKE follow-ups and model answers
EdwinPhilip Oct 25, 2026
55f711c
docs(gke): add full index and safe lab workbook
EdwinPhilip Oct 25, 2026
bf482c0
docs(gke): add full index and safe lab workbook
EdwinPhilip Oct 25, 2026
d6d0a96
docs(gke): integrate Module 6 into VitePress navigation
EdwinPhilip Oct 25, 2026
2fbf585
docs(gke): add Module 6 on knowledge base landing page
EdwinPhilip Oct 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default withMermaid(defineConfig({
{ text: 'Networking', link: '/guides/networking/' },
{ text: 'Linux Internals', link: '/guides/linux-internals/' },
{ text: 'Kubernetes', link: '/guides/kubernetes/' },
{ text: 'Terraform', link: '/guides/terraform/' }
{ text: 'Terraform', link: '/guides/terraform/' },
{ text: 'GCP Fundamentals', link: '/guides/gcp/' },
{ text: 'GKE Architecture', link: '/guides/gke/' },
{ text: 'GKE Operations', link: '/guides/gke/' }
],
sidebar: {
'/guides/networking/': [
Expand Down Expand Up @@ -90,13 +93,44 @@ export default withMermaid(defineConfig({
{ text: '45 difficult follow-ups', link: '/guides/terraform/follow-ups' }
] }
],
'/guides/gcp/': [
{ text: 'GCP Fundamentals and Production Engineering', link: '/guides/gcp/' },
{ text: 'Complete Module 5', items: [
{ text: '1. Resource hierarchy', link: '/guides/gcp/q1' },
{ text: '2. IAM and workload identity', link: '/guides/gcp/q2' },
{ text: '3. VPC, Shared VPC and firewall', link: '/guides/gcp/q3' },
{ text: '4. NAT, DNS and load balancing', link: '/guides/gcp/q4' },
{ text: '5. Compute Engine and MIGs', link: '/guides/gcp/q5' },
{ text: '6. Storage, artifacts and data', link: '/guides/gcp/q6' },
{ text: '7. Observability and SLOs', link: '/guides/gcp/q7' },
{ text: '8. Architecture and recovery', link: '/guides/gcp/q8' },
{ text: 'Hands-on labs', link: '/guides/gcp/labs' },
{ text: '40 challenging follow-ups', link: '/guides/gcp/follow-ups' }
] }
],
'/guides/gke/': [
{ text: 'GKE Architecture & Production Operations', link: '/guides/gke/' },
{ text: 'Complete Module 6', items: [
{ text: '1. Architecture and control plane', link: '/guides/gke/q1' },
{ text: '2. Node pools and scheduling', link: '/guides/gke/q2' },
{ text: '3. VPC-native networking', link: '/guides/gke/q3' },
{ text: '4. Ingress, Gateway and NEGs', link: '/guides/gke/q4' },
{ text: '5. Security and workload identity', link: '/guides/gke/q5' },
{ text: '6. CSI storage and StatefulSets', link: '/guides/gke/q6' },
{ text: '7. Autoscaling and QoS', link: '/guides/gke/q7' },
{ text: '8. Upgrades and incidents', link: '/guides/gke/q8' },
{ text: 'Hands-on labs', link: '/guides/gke/labs' },
{ text: '40 challenging follow-ups', link: '/guides/gke/follow-ups' }
] }
],
'/guides/': [
{ text: 'Learning Guides', items: [
{ text: 'All guides', link: '/guides/' },
{ text: 'Networking Fundamentals', link: '/guides/networking/' },
{ text: 'Linux Internals', link: '/guides/linux-internals/' },
{ text: 'Kubernetes Architecture', link: '/guides/kubernetes/' },
{ text: 'Terraform Architecture', link: '/guides/terraform/' }
{ text: 'Terraform Architecture', link: '/guides/terraform/' },
{ text: 'GCP Fundamentals', link: '/guides/gcp/' }
] }
]
},
Expand Down
254 changes: 254 additions & 0 deletions docs/guides/gcp/follow-ups.md

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions docs/guides/gcp/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Google Cloud Fundamentals and Production Engineering

**Module 5 · Intermediate to senior platform/cloud engineering guide · Eight complete chapters**

Google Cloud has familiar concepts for engineers coming from other providers, but its resource hierarchy, global VPC networking, project policies, IAM federation and load-balancing architecture require their own mental model. This field guide develops those fundamentals from first principles, then connects them to operational debugging and reliable system design.

::: info Public education and accuracy
Examples use fictional marketplace infrastructure and placeholder resource names. They are teaching designs, not claims about a real production environment. Google Cloud services change rapidly: verify version, region, account policy, release stage, CLI syntax and pricing before deployment. Code snippets are educational and sometimes require prerequisites discussed in their chapters.
:::

## Prerequisites

Familiarity with Linux and TCP/IP, service deployment and a basic cloud model. Kubernetes and Terraform knowledge help with the examples but are not required to follow all conceptual material. For labs use a controlled Google Cloud sandbox with an approved budget, IAM rights and a cleanup plan. Read-only commands are sufficient for most investigations.

## What you will learn

- Explain organization, folders, projects, billing, API enablement, quotas and policy inheritance.
- Use IAM roles, service accounts, ADC and federation without long-lived keys.
- Design VPC/subnet, Shared VPC, firewall and hybrid routing based on actual resource scopes.
- Trace HTTPS ingress, backend health, DNS and Cloud NAT egress end to end.
- Operate Compute Engine templates, managed instance groups and autoscaling.
- Choose object storage, artifacts, relational transactions, messaging, caches and analytics deliberately.
- Correlate Cloud Monitoring, Logging, Trace and Audit Logs to a user-facing SLO.
- Evaluate multi-zone/multi-region reliability, disaster recovery, cost and security trade-offs.

## Eight main chapters

1. [Resource hierarchy, projects, governance and quotas](./q1): Administrative hierarchy, org policy, billing, API operations, failure cases.
2. [IAM, service accounts, ADC and workload identity](./q2): Authentication/authorization, token flow, GKE/CI federation, 403 diagnosis.
3. [VPC, Shared VPC, routes and firewall](./q3): Global VPC, regional subnets, firewall, hybrid networking and packet tracing.
4. [Cloud NAT, Cloud DNS and load balancing](./q4): HTTPS request sequence, NAT outbound mapping, proxy types, DNS and troubleshooting.
5. [Compute Engine and managed instance groups](./q5): Templates, VM boot, regional capacity, rolling updates, Spot and autohealing.
6. [Cloud Storage, Artifact Registry and data services](./q6): Objects, images, transactions, Pub/Sub idempotency and product selection.
7. [Observability, SLOs and incident diagnosis](./q7): Metrics, logs, traces, audit evidence, percentile and burn-rate reasoning.
8. [Architecture, security, DR and costs](./q8): Hypothetical marketplace design, failure domains, regional incident, trade-offs.

## Interview and hands-on practice

- [40 difficult interviewer follow-ups with complete model answers](./follow-ups)
- [Eight hands-on and tabletop labs, including expected observations and safety controls](./labs)

## Study order

Start with hierarchy and identity (Q1–Q2), which explains where permissions apply. Then work through network design and packet flow (Q3–Q4). Study compute and data guarantees (Q5–Q6), and finish with service-level observability and architecture decisions (Q7–Q8). Work through labs before answering the entire 40-question bank without notes.

## AWS-to-GCP quick map

| AWS concept | GCP concept | Caution |
| --- | --- | --- |
| Organizations / OUs / accounts | Organization / folders / projects | Not one-to-one isolation or inheritance |
| Regional VPC + zonal subnets | Global VPC + regional subnets | Different network scope |
| IAM roles + STS | IAM principals/roles + federation/impersonation | Different trust model |
| ALB / NLB | Application / Network Load Balancers | Product classes and datapaths differ |
| NAT Gateway | Public NAT | Port and translation models differ |
| EC2 + ASG | Compute Engine + MIG | Regional distribution semantics |
| S3 / ECR | Cloud Storage / Artifact Registry | Location, class and IAM details differ |
| RDS / Aurora | Cloud SQL and other DB products | HA/replication options differ |
| CloudWatch / X-Ray | Monitoring / Logging / Cloud Trace | Query/metric models vary |

## Authoritative references

- [Google Cloud Resource Manager hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy)
- [Cloud IAM overview](https://cloud.google.com/iam/docs/overview)
- [Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation)
- [Google VPC and Shared VPC](https://cloud.google.com/vpc/docs/vpc)
- [Public NAT](https://cloud.google.com/nat/docs/public-nat)
- [Cloud Load Balancing](https://cloud.google.com/load-balancing/docs/load-balancing-overview)
- [Compute Engine managed instance groups](https://cloud.google.com/compute/docs/instance-groups)
- [Cloud Storage](https://cloud.google.com/storage/docs/introduction)
- [Cloud SQL](https://cloud.google.com/sql/docs)
- [Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview)
- [Google Cloud architecture framework](https://cloud.google.com/architecture/framework)

[← All modules](/guides/) · [Start with Q1 →](./q1)
198 changes: 198 additions & 0 deletions docs/guides/gcp/labs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Google Cloud Fundamentals: Eight Practical Labs

The exercises reinforce the eight chapters. Each lab has a result to explain, not simply a command to run.

::: warning Use only an approved sandbox
Google Cloud services can create billable resources. Before creating anything, choose an authorized project, set a budget alert, understand cleanup, avoid real credentials or PII in logs and never open test services publicly without permission. Read-only inspection labs are suitable when creation privileges are unavailable.
:::

## Lab 1. Resource hierarchy, API and quotas

**Goal:** Explain the boundaries between IAM, enabled service APIs, billing, quota and zone capacity.

```bash
gcloud auth list
gcloud config get-value project
gcloud projects describe PROJECT_ID
gcloud services list --enabled --project=PROJECT_ID
gcloud billing projects describe PROJECT_ID
gcloud compute regions describe europe-west1 --project=PROJECT_ID
```

**Expected:** A project can exist without some APIs enabled. CPU quota is scoped by the relevant service/region, while resource availability can also be constrained by the zone. IAM roles on folders/organization can influence project access.

**Challenge:** Describe how `API_DISABLED`, permission denied, quota exceeded and out-of-capacity would differ. Read operation error details instead of guessing.

**Safety:** Do not change org policies, billing or quotas to complete the lab.

## Lab 2. IAM and effective workload identity

**Goal:** Show that authentication identity and resource authorization differ.

On an authorized sandbox bucket, inspect:

```bash
gcloud auth list
gcloud auth application-default print-access-token
gcloud storage buckets get-iam-policy gs://OWNED_BUCKET
gcloud projects get-iam-policy PROJECT_ID --format=json
```

**Expected:** The CLI and ADC identities can differ. A service account with no bucket access authenticates but may fail authorization. An applicable ancestor binding or deny can affect the result.

**Challenge:** Draw an external CI OIDC assertion exchange through workload identity pool/provider, STS and optional service account impersonation. Describe audience, issuer and attribute restrictions.

**Safety:** Never paste actual tokens into public tickets or CI logs. If printing a token for inspection, keep the terminal secure and avoid recording output.

## Lab 3. VPC, Shared VPC and firewall path

**Goal:** Trace a connection from one VM/subnet to another.

Read-only inventory:

```bash
gcloud compute networks list --project=PROJECT_ID
gcloud compute networks subnets list --project=PROJECT_ID
gcloud compute routes list --project=PROJECT_ID
gcloud compute firewall-rules list --project=PROJECT_ID
gcloud compute networks subnets list-usable --project=PROJECT_ID
```

**Expected:** The VPC is global and its subnetworks regional. A route existing does not guarantee firewall permission or application reachability. A Shared VPC consumer can use host-project subnets only with proper host/service attachment and IAM.

**Challenge:** Draw both ingress and egress decisions, including guest firewall and service listener. Explain why Cloud Router isn't a per-packet forwarding VM.

**Safety:** Do not broaden production firewall rules for debugging. Use Connectivity Tests or a permitted temporary test VM with narrow rules.

## Lab 4. Cloud DNS, load balancer and Public NAT

**Goal:** Separate the inbound HTTPS path from outbound internet translation.

```bash
gcloud dns managed-zones list --project=PROJECT_ID
gcloud compute backend-services list --project=PROJECT_ID
gcloud compute url-maps list --project=PROJECT_ID
gcloud compute health-checks list --project=PROJECT_ID
gcloud compute routers list --project=PROJECT_ID
```

On a permitted host with relevant DNS configuration:

```bash
dig example.org A
curl -I --connect-timeout 5 https://example.org/
```

**Expected:** Public and private DNS zones can return different answers. A Cloud Application Load Balancer handles an inbound frontend/target proxy/backend chain. Public NAT handles eligible outbound source translation and does not make the VM directly reachable from the public Internet.

**Challenge:** Differentiate a TLS/SNI failure, LB 502 and outbound Cloud NAT port exhaustion. Describe what NAT metrics and LB backend health would prove.

**Safety:** No production NAT address allocation, DNS zone or LB changes are necessary; cloud provider cost and reachability requirements make creation a separate controlled exercise.

## Lab 5. Compute Engine and managed instance group design

**Goal:** Understand VM versus template versus MIG lifecycle without deploying an expensive regional fleet.

```bash
gcloud compute instances list --project=PROJECT_ID
gcloud compute instance-templates list --project=PROJECT_ID
gcloud compute instance-groups managed list --project=PROJECT_ID
gcloud compute machine-types list --zones=europe-west1-b --limit=10
```

**Expected:** An instance template specifies repeatable configuration, while a MIG controls replica lifecycle. Autoscaling controls count; autohealing replaces unhealthy instances. A regional MIG improves zone distribution, but doesn't eliminate quota and zonal capacity risk.

**Challenge:** Design a rollout with a canary, application warmup, LB health check, surge capacity, draining and rollback. Explain why a Spot-only single-replica financial service is unsafe.

**Safety:** Use design/paper exercise unless an authorized budgeted disposable MIG is available.

## Lab 6. Cloud Storage, Artifact Registry and event idempotency

**Goal:** Distinguish object storage, image artifacts, transactional data and queue delivery semantics.

Read-only:

```bash
gcloud storage buckets list --project=PROJECT_ID
gcloud artifacts repositories list --location=europe-west1 --project=PROJECT_ID
gcloud sql instances list --project=PROJECT_ID
gcloud pubsub subscriptions list --project=PROJECT_ID
```

If an owned test bucket is available:

```bash
printf 'sample\n' > sample.txt
gcloud storage cp sample.txt gs://OWNED_BUCKET/lab/sample.txt
gcloud storage objects describe gs://OWNED_BUCKET/lab/sample.txt
```

**Expected:** Cloud Storage is object storage with generation/retention behavior, not a POSIX database. Artifact Registry contains deployable image/package artifacts. Pub/Sub at-least-once patterns mean consumer business effects must be idempotent.

**Challenge:** Trace a worker committing a DB side effect then crashing before ack. Explain outbox, idempotency key and dead-letter routing.

**Safety:** Only write into an owned sandbox bucket; cleanup may not immediately remove charges if soft delete/retention is enabled.

## Lab 7. Logging, tracing and SLO calculation

**Goal:** Translate a user-facing symptom to traces and resource evidence.

```bash
gcloud logging read 'severity>=ERROR' \
--project=PROJECT_ID --limit=20 --format=json
gcloud logging sinks list --project=PROJECT_ID
```

Choose a hypothetical SLO: 99.9% of valid checkout operations complete successfully within a specified bound over 30 days.

Given 100,000 eligible events and 220 noncompliant events:
- Allowed noncompliant events under 99.9% = 100.
- Actual noncompliant fraction = 0.22%.
- Budget consumption = 220%, exceeding budget by 120%.
- Burn rate relative to steady-state allowed error fraction = 2.2x over that evaluated window.

**Expected:** Explain difference between an event-based SLO and downtime minutes. A trace reveals nested latency; metrics show distributions; audit logs reveal administrative operations; logs can be sampled or excluded.

**Challenge:** Explain why averaging regional p99 values is mathematically wrong. Use aggregate histograms/distributions instead.

## Lab 8. Marketplace architecture and failure-recovery tabletop

**Goal:** Defend a design and a response to failure.

Assume: global external HTTPS API, regional Compute/GKE backends, transactional Cloud SQL, Cloud Storage media, Pub/Sub background work and Cloud NAT outbound partner calls.

```mermaid
flowchart LR
C["Client"] --> LB["HTTPS Load Balancer"]
LB --> APP["Regional application replicas"]
APP --> DB["Transactional database"]
APP --> PUB["Pub/Sub"]
PUB --> WORK["Idempotent workers"]
APP --> NAT["Cloud NAT"]
NAT --> PART["External partner"]
```

**Failure injection (paper exercise):** One region's application replicas become unhealthy, while the secondary region remains healthy but the transactional primary database is still regional.

Answer in order:
1. What user actions are failing and what is the data correctness risk?
2. What do backend health, traces, SQL status and errors say?
3. Is it safe to redirect read requests? What about writes?
4. What is the measured RPO/RTO versus required objective?
5. How do you prevent split-brain or duplicate partner side effects?
6. What are the exact operator approvals and rollback/failback conditions?
7. Which IaC, SLO and recovery changes prevent recurrence?

**Expected:** A multi-region frontend does not guarantee a writable multi-region backend. The correct answer includes data state, authorization, capacity, failover sequencing and post-recovery business checks.

## Completion checklist

- Explain a failed GCP API request through credential, IAM, API enablement, org policy and quota.
- Trace packet forwarding and firewall decisions across Shared VPC projects.
- Distinguish NAT, Private Google Access, DNS and HTTPS LB.
- Design MIG rollout without equating VM startup to application readiness.
- Select object, transactional, analytical and queue services based on guarantees.
- Define a measurable event-based SLO and error budget.
- Demonstrate a safe regional recovery decision, including data correctness.

[← Module 5](./) · [40 follow-up questions](./follow-ups)
Loading
Loading