Learn the core services of Google Cloud Platform and DevOps automation. Covers GKE (Google Kubernetes Engine) hybrid operations, deploying serverless containers on Cloud Run, VPC firewall design, IAM service account authentication, and the gcloud CLI.
Intermediate
Updated Oct 1, 2026
~3 min read
8 sections
5 code examples
Learning Paths that include this guide
This guide is one step in the paths below. Study it together with the steps before and after.
Learn the core services of Google Cloud Platform and DevOps automation. Covers GKE (Google Kubernetes Engine) hybrid operations, deploying serverless containers on Cloud Run, VPC firewall design, IAM service account authentication, and the gcloud CLI. Rather than listing concepts, this guide is organized so you can follow the content in the order you have to make decisions on a real project.
Key perspective
Infrastructure / operations
Rather than memorizing install commands, understand the order in which traffic, runtime, observability, and incident response connect.
Operating Kubernetes on GKECloud Run serverlessVPC & firewall designgcloud CLI automation
Architecture diagrams
To make what you read stick, it helps to capture the flow as a picture first. The two diagrams below are reference maps you can keep coming back to while learning GCP.
Learning flow
Rendering diagram…
Architecture view
Rendering diagram…
Operating Kubernetes on GKE
When you first open GCP, the big picture matters more than individual commands. This section starts with the problems the concepts ahead were created to solve.
GKE (Google Kubernetes Engine) provides a managed Kubernetes service. With support for autoscaling, automatic upgrades, and Cloud Logging integration, it greatly lowers the overhead of operating microservices.
BASH
# Example of creating a GKE clustergcloud container clusters create "gke-dev-cluster" \\ --region "us-central1" \\ --num-nodes "3" \\ --enable-autoscaling --min-nodes "1" --max-nodes "5" \\ --enable-ip-alias# Fetch the cluster credentialsgcloud container clusters get-credentials gke-dev-cluster --region us-central1
Serverless deployment on Cloud Run
Here you look at Serverless deployment on Cloud Run alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Cloud Run is a serverless container runtime that scales instances fully automatically from 0 according to requests. It is very well suited to deploying stateless HTTP APIs and AI Agent API facades.
BASH
# Build the container from source and deploy it in one stepgcloud run deploy my-api-service \\ --source . \\ --region us-central1 \\ --allow-unauthenticated \\ --set-env-vars="ENV=production,MODEL=gpt-4o-mini"
IAM service account security
Here you look at IAM service account security alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
GCP uses Service Accounts for calls between services and for application access. Create one on a least-privilege policy, then either inject the JSON key file through a secure volume or use Workload Identity to map permissions directly to pods.
BASH
# Create a service accountgcloud iam service-accounts create my-app-sa \\ --description="App Service Account" \\ --display-name="my-app-sa"# Grant the admin role for S3-compatible Storagegcloud projects add-iam-policy-binding my-project-id \\ --member="serviceAccount:my-app-sa@my-project-id.iam.gserviceaccount.com" \\ --role="roles/storage.admin"
Cloud Monitoring & Logging
Here you look at Cloud Monitoring & Logging alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
GKE and Cloud Run send logs to Cloud Logging and resource metrics to Cloud Monitoring automatically, with no extra setup. But for "getting an alert when the error rate jumps", you have to create an Alert Policy yourself, and it needs to be managed as code rather than by clicking in the console so the alert setup is reproduced along with every deployment.
BASH
# Create a notification channel (email)gcloud alpha monitoring channels create \ --display-name="oncall-email" \ --type=email \ --channel-labels=email_address=oncall@example.com# Create an alert policy for the Cloud Run 5xx ratio (references a policy JSON file)gcloud alpha monitoring policies create --policy-from-file=cloudrun-5xx-policy.json# View recent ERROR logsgcloud logging read "resource.type=cloud_run_revision AND severity>=ERROR" \ --limit 20 --format="table(timestamp, textPayload)"
Metric
Meaning
Why it matters
run.googleapis.com/request_count (5xx)
The number of times Cloud Run returned 5xx
The most direct signal of an application failure
container/cpu/core_usage_time
CPU usage of GKE pods
The basis for HPA scaling decisions and adjusting resource requests
logging.googleapis.com severity=ERROR
Count of logs at severity ERROR or above
Wire it to alerts to detect failures early
gcloud CLI automation
Here you look at gcloud CLI automation alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
The gcloud CLI is very powerful for manipulating Google Cloud resources from the shell and automating deployment scripts.
BASH
# Set the active project and default zonegcloud config set project my-project-idgcloud config set compute/zone us-central1-a# List virtual machines (GCE)gcloud compute instances list
GCP practical design
GCP practical design is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
GCP design puts first the precise mapping of VPC firewalls to IAM service accounts, a dedicated network layout for GKE clusters, and mitigating cold starts of serverless resources such as Cloud Run.
Decision point
Question to ask
Practical guideline
Boundaries
Which parts of the GCP code are most likely to change?
Separate input/output, configuration, external integrations, and the core rules.
State
Where is state created and where does it go away?
Make the owner and lifecycle of state visible in the code.
Failure
What does the caller receive on failure?
Decide the timeout, fallback, and error contract first.
GCP operating standards
This section covers GCP operating standards from a practical perspective. Instead of memorizing the concept, focus on the situations in which you would reach for it.
Monitor the unified Cloud Logging & Monitoring dashboards, the state of GKE node auto-provisioning, IAM service account key expiry dates, and Cloud Storage costs.
GCP verification strategy
GCP verification strategy is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
Go through gcloud CLI dry-runs, Service Account permission audits, Terraform infrastructure validation, and Kubernetes manifest linter checks.
Quality axis
How to verify
Definition of done
Correctness
Automate the normal/failure cases.
The core scenarios pass reproducibly.
Regression prevention
When fixing a bug, leave the same case behind as a test.
The same failure is not deployed again.
Operability
Check the logs, metrics, and alerts.
There is a path for tracing the cause when a problem occurs.
GCP: frequently asked questions
What is a project in GCP?
A project is the basic unit that groups resources, permissions, and billing in GCP. Every resource belongs to one project. Separating development and production into projects cleanly divides permissions and costs.
When do I use Cloud Run and when GKE?
Cloud Run is serverless: upload a container image and it scales with request volume, down to zero when there are no requests. GKE is managed Kubernetes with fine-grained control but more to operate. Start an ordinary web API on Cloud Run and look at GKE when you need what Kubernetes offers.
Is it acceptable to use service account key files?
Avoid them where you can. A leaked key file can be used by anyone until it expires. Attach a service account directly to resources running inside GCP, and for access from external CI use workload identity federation, which authenticates without keys.