
บทนำ: ทำไม IT Professional ต้องรู้จัก Google Cloud Platform?
เมื่อพูดถึง cloud computing คนส่วนใหญ่ในวงการ IT จะนึกถึง AWS เป็นอันดับแรก ตามด้วย Microsoft Azure แต่ผู้เล่นอันดับ 3 ที่กำลังเติบโตอย่างรวดเร็วและมีจุดแข็งเฉพาะตัวคือ Google Cloud Platform (GCP) ที่ครองส่วนแบ่งตลาดประมาณ 12% ทั่วโลก และกำลังขยายตัวเร็วกว่า AWS และ Azure ในหลายภูมิภาค
สำหรับ IT Professional ในไทย GCP มีความสำคัญเพิ่มขึ้นเรื่อยๆ ด้วยเหตุผลหลายประการ: GCP มี Region ในกรุงเทพ (asia-southeast1 ที่สิงคโปร์ใกล้ที่สุด และมีแผนขยาย), หลายองค์กรใหญ่ในไทยเริ่มใช้ GCP โดยเฉพาะด้าน data analytics และ AI/ML, Google Workspace (เดิม G Suite) เป็น SaaS ยอดนิยมที่ integrate กับ GCP ได้ดี และ GCP มีจุดแข็งด้าน Kubernetes (GKE), BigQuery (data analytics) และ AI/ML ที่เหนือกว่าคู่แข่งในหลายมิติ
บทความนี้จะสอนทุกสิ่งที่ IT Professional ต้องรู้เกี่ยวกับ GCP ตั้งแต่ core services, compute, storage, networking, IAM, จนถึง certifications และแนวทางการเรียนรู้ เพื่อให้คุณสามารถเริ่มต้นใช้งาน GCP ได้อย่างมั่นใจ
ส่วนที่ 1: GCP คืออะไร? ทำความรู้จัก Google Cloud Platform
1.1 ประวัติและจุดเด่นของ GCP
Google Cloud Platform เปิดให้บริการครั้งแรกในปี 2008 โดยเริ่มจาก Google App Engine (PaaS) ก่อนจะขยายบริการเป็น IaaS (Compute Engine), Container (GKE), Serverless (Cloud Functions, Cloud Run) และอีกมากมาย สิ่งที่ทำให้ GCP แตกต่างจากผู้ให้บริการ cloud อื่นคือ GCP สร้างขึ้นจากโครงสร้างพื้นฐานเดียวกับที่ Google ใช้ run Google Search, YouTube, Gmail และ Google Maps ซึ่งรองรับผู้ใช้หลายพันล้านคนทั่วโลก
1.2 GCP vs AWS vs Azure — เปรียบเทียบจุดแข็ง
Cloud Provider Positioning:
┌──────────────────┬───────────────┬───────────────┬───────────────┐
│ Category │ AWS │ Azure │ GCP │
├──────────────────┼───────────────┼───────────────┼───────────────┤
│ Market Share │ ~31% │ ~25% │ ~12% │
│ # of Services │ 200+ │ 200+ │ 150+ │
│ Global Regions │ 34 │ 60+ │ 40+ │
│ จุดแข็งหลัก │ Breadth+Scale │ Enterprise IT │ Data+AI+K8s │
│ Kubernetes │ EKS (good) │ AKS (good) │ GKE (best) │
│ Data Analytics │ Redshift │ Synapse │ BigQuery(best)│
│ AI/ML │ SageMaker │ Azure ML │ Vertex AI │
│ Serverless │ Lambda(best) │ Functions │ Cloud Run │
│ Networking │ Very good │ Good │ Best (private)│
│ Pricing Model │ Complex │ Complex │ Simpler │
│ Free Tier │ 12 months │ 12 months │ Always Free+ │
│ Enterprise Focus │ High │ Highest │ Medium-High │
│ เหมาะกับ │ General │ Microsoft shop│ Data/ML/K8s │
└──────────────────┴───────────────┴───────────────┴───────────────┘
GCP Unique Strengths:
1. BigQuery — serverless data warehouse, no cluster management
2. GKE — best managed Kubernetes (Google created K8s)
3. Global network — Google's private fiber backbone
4. Pricing — per-second billing, sustained use discounts (auto)
5. Cloud Run — best serverless containers experience
6. Vertex AI — integrated ML platform
7. Anthos — hybrid/multi-cloud Kubernetes management
ส่วนที่ 2: GCP Core Services — บริการหลักที่ต้องรู้
2.1 Compute Services
GCP Compute Services:
1. Compute Engine (IaaS — Virtual Machines):
├── เทียบกับ: AWS EC2, Azure Virtual Machines
├── Machine Types:
│ ├── General Purpose: E2, N2, N2D, N1
│ │ └── E2: cost-optimized, N2: balanced
│ ├── Compute Optimized: C2, C2D, C3
│ │ └── High CPU performance, gaming, HPC
│ ├── Memory Optimized: M2, M3
│ │ └── SAP HANA, in-memory databases
│ ├── Accelerator Optimized: A2, A3, G2
│ │ └── GPU (NVIDIA T4, A100, H100, L4)
│ └── Custom Machine Types: กำหนด vCPU/RAM เองได้
│ └── จุดเด่น GCP: ไม่ต้องเลือก fixed size
├── Disk Types:
│ ├── pd-standard: HDD ($0.04/GB/mo)
│ ├── pd-balanced: Balanced SSD ($0.10/GB/mo)
│ ├── pd-ssd: Performance SSD ($0.17/GB/mo)
│ └── pd-extreme: Highest performance
├── Pricing Options:
│ ├── On-demand: จ่ายตามใช้ (per-second billing)
│ ├── Preemptible/Spot VMs: ลด 60-91% (may be terminated)
│ ├── Committed Use Discounts: 1yr=-37%, 3yr=-55%
│ └── Sustained Use Discounts: auto discount when use > 25%
│ └── จุดเด่น GCP: ลดราคาอัตโนมัติไม่ต้องสมัคร!
└── Live Migration: ย้าย VM ระหว่าง host ไม่ต้อง downtime
└── จุดเด่น GCP: maintenance window = zero downtime
2. Google Kubernetes Engine — GKE:
├── เทียบกับ: AWS EKS, Azure AKS
├── ทำไม GKE เป็น best-in-class:
│ ├── Google สร้าง Kubernetes (Borg → K8s)
│ ├── Auto-upgrade & auto-repair nodes
│ ├── Autopilot mode: fully managed, pay per pod
│ ├── Multi-cluster management (fleet)
│ ├── Binary Authorization (security)
│ └── Fastest Kubernetes version support
├── Modes:
│ ├── Standard: คุณ manage nodes
│ └── Autopilot: Google manage everything, pay per pod
│ └── คิดเงินตาม resource ที่ pod ใช้จริง
└── ราคา: Control plane $0.10/hr, Autopilot per-pod pricing
3. Cloud Run (Serverless Containers):
├── เทียบกับ: AWS Fargate+Lambda, Azure Container Apps
├── Features:
│ ├── Deploy container → get URL (that's it!)
│ ├── Scale to zero (ไม่มี traffic = ไม่เสียเงิน)
│ ├── Scale to thousands of instances
│ ├── Any language/framework (Docker container)
│ ├── gRPC, WebSocket, HTTP/2 support
│ ├── Built-in HTTPS + custom domain
│ └── VPC connector for private resources
├── Use Cases:
│ ├── Web APIs / microservices
│ ├── Event-driven processing
│ ├── Background jobs
│ └── Migration from VM/container to serverless
└── ราคา: $0.00002400/vCPU-second, free tier: 2M requests/mo
└── จุดเด่น: easiest serverless container experience
4. Cloud Functions (FaaS — Serverless Functions):
├── เทียบกับ: AWS Lambda, Azure Functions
├── Gen 2 (based on Cloud Run):
│ ├── Languages: Node.js, Python, Go, Java, .NET, Ruby, PHP
│ ├── Triggers: HTTP, Pub/Sub, Cloud Storage, Firestore
│ ├── Max timeout: 60 minutes (Gen 2)
│ ├── Max memory: 32 GB (Gen 2)
│ └── Concurrency: multiple requests per instance
└── ราคา: 2M invocations/mo free, then $0.40/million
5. App Engine (PaaS):
├── เทียบกับ: AWS Elastic Beanstalk, Azure App Service
├── Standard Environment: sandboxed, scale to zero
├── Flexible Environment: Docker-based, more control
└── เหมาะกับ: simple web apps, quick deployment
2.2 Storage Services
GCP Storage Services:
1. Cloud Storage (Object Storage):
├── เทียบกับ: AWS S3, Azure Blob Storage
├── Storage Classes:
│ ├── Standard: frequently accessed ($0.020/GB/mo)
│ ├── Nearline: once/month access ($0.010/GB/mo)
│ ├── Coldline: once/quarter access ($0.004/GB/mo)
│ └── Archive: once/year access ($0.0012/GB/mo)
├── Features:
│ ├── Object Lifecycle Management (auto-transition)
│ ├── Versioning (protect against accidental delete)
│ ├── Customer-managed encryption keys (CMEK)
│ ├── Object Lock (WORM compliance)
│ ├── Transfer Service (from AWS S3, Azure Blob, on-prem)
│ └── Signed URLs (temporary access)
└── จุดเด่น: single API for all classes, auto-class option
2. Persistent Disk (Block Storage):
├── เทียบกับ: AWS EBS, Azure Managed Disks
├── Types: Standard (HDD), Balanced (SSD), SSD, Extreme
├── Features:
│ ├── Snapshots (incremental, cross-region)
│ ├── Resize online (increase only)
│ ├── Multi-attach (read-only to multiple VMs)
│ └── Regional disk (synchronous replication)
└── จุดเด่น: online resize, regional replication built-in
3. Filestore (NFS File Storage):
├── เทียบกับ: AWS EFS, Azure Files
├── Tiers: Basic HDD/SSD, Enterprise
└── Use case: shared file system for VMs/GKE
2.3 Database Services
GCP Database Services:
1. Cloud SQL (Managed Relational DB):
├── Engines: MySQL, PostgreSQL, SQL Server
├── Features:
│ ├── Automated backups + PITR
│ ├── High availability (regional)
│ ├── Read replicas (cross-region)
│ ├── Private IP (VPC-native)
│ ├── Maintenance window control
│ └── Up to 128 vCPUs, 864 GB RAM
└── เหมาะกับ: traditional web apps, ERP, CRM
2. Cloud Spanner (Global Relational DB):
├── เทียบกับ: AWS Aurora Global (แต่ Spanner แข็งแกร่งกว่า)
├── Features:
│ ├── Globally distributed + strongly consistent
│ ├── 99.999% availability (5 nines)
│ ├── Horizontal scaling (relational + scale-out)
│ ├── SQL interface
│ └── Automatic sharding
├── Use case: global financial systems, gaming leaderboards
└── ราคา: expensive ($0.90/node/hr) — for mission-critical only
3. Firestore (NoSQL Document DB):
├── เทียบกับ: AWS DynamoDB, Azure Cosmos DB
├── Features:
│ ├── Serverless, auto-scaling
│ ├── Real-time listeners (live updates)
│ ├── Offline support (mobile SDK)
│ ├── Multi-region replication
│ └── ACID transactions
└── เหมาะกับ: mobile/web apps, real-time features
4. Bigtable (Wide-Column NoSQL):
├── เทียบกับ: AWS DynamoDB (HBase compatible)
├── Use case: IoT time-series, analytics, ad-tech
└── Scale: petabytes, single-digit ms latency
5. Memorystore (In-Memory Cache):
├── Engines: Redis, Memcached
└── Use case: caching, session management
6. AlloyDB (PostgreSQL-compatible):
├── 4x faster than standard PostgreSQL
├── AI-powered query optimization
└── เป็น GCP exclusive — ไม่มีใน AWS/Azure
ส่วนที่ 3: GCP Console และ gcloud CLI
3.1 GCP Console (Web UI)
GCP Console (console.cloud.google.com) เป็น web-based interface สำหรับจัดการ GCP resources ทั้งหมด มี UI ที่สะอาดและใช้งานง่ายกว่า AWS Console ตามความเห็นของผู้ใช้หลายคน GCP Console มี Cloud Shell ในตัว (Linux terminal บน browser) ที่ติดตั้ง gcloud, kubectl, terraform, docker ให้พร้อมใช้งาน ทำให้สามารถทำงานได้ทันทีโดยไม่ต้องติดตั้งอะไรบนเครื่อง
3.2 gcloud CLI — เครื่องมือสำคัญ
gcloud CLI Essential Commands:
# Installation (Windows)
# Download from: https://cloud.google.com/sdk/docs/install
# Initial setup
gcloud init # Login + select project
gcloud auth login # Authenticate
gcloud config set project PROJECT_ID # Set default project
# Project management
gcloud projects list # List all projects
gcloud projects create my-project-123 # Create new project
gcloud config set project my-project-123 # Switch project
# Compute Engine
gcloud compute instances list # List all VMs
gcloud compute instances create my-vm --zone=asia-southeast1-b --machine-type=e2-medium --image-family=ubuntu-2404-lts --image-project=ubuntu-os-cloud --boot-disk-size=50GB --tags=http-server,https-server
gcloud compute ssh my-vm --zone=asia-southeast1-b # SSH to VM
gcloud compute instances stop my-vm --zone=asia-southeast1-b
gcloud compute instances delete my-vm --zone=asia-southeast1-b
# Cloud Storage
gsutil mb gs://my-bucket-name # Create bucket
gsutil cp file.txt gs://my-bucket-name/ # Upload
gsutil ls gs://my-bucket-name/ # List objects
gsutil rsync -r local-dir/ gs://my-bucket-name/ # Sync directory
# Cloud SQL
gcloud sql instances create my-db --database-version=MYSQL_8_0 --tier=db-custom-2-8192 --region=asia-southeast1 --root-password=MY_PASSWORD
gcloud sql databases create myapp --instance=my-db
# GKE
gcloud container clusters create my-cluster --zone=asia-southeast1-b --num-nodes=3 --machine-type=e2-standard-4 --enable-autoscaling --min-nodes=1 --max-nodes=10
gcloud container clusters get-credentials my-cluster --zone=asia-southeast1-b # Get kubeconfig
# Cloud Run
gcloud run deploy my-service --image=gcr.io/PROJECT/my-app:latest --platform=managed --region=asia-southeast1 --allow-unauthenticated
# IAM
gcloud iam service-accounts create my-sa --display-name="My Service Account"
gcloud projects add-iam-policy-binding PROJECT_ID --member="serviceAccount:[email protected]" --role="roles/storage.admin"
3.3 สร้าง VM เครื่องแรกบน GCP — Step by Step
Creating Your First VM on GCP:
Step 1: Create GCP Account
├── ไปที่ cloud.google.com
├── Sign in with Google Account
├── ใส่ข้อมูลบัตรเครดิต (ไม่ charge จนกว่า free credit หมด)
├── ได้รับ $300 free credit (ใช้ได้ 90 วัน)
└── Always Free tier: f1-micro VM, 5GB storage, etc.
Step 2: Create Project
├── Console → Select Project → New Project
├── ตั้งชื่อ: "my-first-project"
├── Project ID: จะ auto-generate (หรือกำหนดเอง)
└── Billing: เลือก billing account
Step 3: Enable Compute Engine API
├── Console → APIs & Services → Enable APIs
├── ค้นหา "Compute Engine API"
├── Click "Enable"
└── รอ 1-2 นาที
Step 4: Create VM Instance
├── Console → Compute Engine → VM Instances → Create
├── Name: "web-server-01"
├── Region: asia-southeast1 (Singapore)
├── Zone: asia-southeast1-b
├── Machine type: e2-medium (2 vCPU, 4 GB RAM)
├── Boot disk:
│ ├── OS: Ubuntu 24.04 LTS
│ ├── Size: 20 GB
│ └── Type: Balanced persistent disk
├── Firewall: Allow HTTP + HTTPS traffic
├── Click "Create"
└── รอ 30-60 วินาที → VM พร้อมใช้งาน
Step 5: Connect to VM
├── Option 1: Browser SSH (click SSH button in console)
├── Option 2: gcloud compute ssh web-server-01
└── Option 3: External SSH client (add SSH key first)
Step 6: Install Web Server
├── sudo apt update && sudo apt install -y nginx
├── sudo systemctl enable nginx
├── เปิด browser → http://EXTERNAL_IP
└── เห็นหน้า "Welcome to nginx!" = สำเร็จ!
Estimated Cost (e2-medium, asia-southeast1):
├── On-demand: ~$24.27/month
├── With sustained use discount: ~$17/month (auto)
├── With 1-year CUD: ~$15.29/month
├── With 3-year CUD: ~$10.92/month
└── Spot/Preemptible: ~$7.28/month (may be terminated)
ส่วนที่ 4: GCP Networking — VPC และ Network Services
4.1 VPC Network
GCP VPC มีความแตกต่างจาก AWS VPC อย่างสำคัญคือ GCP VPC เป็น global resource ไม่ได้ผูกกับ region เดียว ซึ่งหมายความว่า VPC เดียวสามารถมี subnets ใน region ต่างๆ ทั่วโลก และ VM ใน region ต่างๆ ภายใน VPC เดียวกันสามารถสื่อสารกันผ่าน private IP ได้ทันที (ใน AWS ต้องใช้ VPC peering) นี่คือข้อได้เปรียบที่ทำให้ multi-region deployment บน GCP ง่ายกว่ามาก
GCP VPC Networking:
VPC (Global):
├── Subnet: asia-southeast1 (10.148.0.0/20)
│ ├── VM-1: 10.148.0.2
│ └── VM-2: 10.148.0.3
├── Subnet: us-central1 (10.128.0.0/20)
│ └── VM-3: 10.128.0.2
├── Subnet: europe-west1 (10.132.0.0/20)
│ └── VM-4: 10.132.0.2
└── All VMs can communicate via private IP!
Key Differences from AWS:
┌──────────────────┬───────────────┬───────────────┐
│ Feature │ GCP VPC │ AWS VPC │
├──────────────────┼───────────────┼───────────────┤
│ Scope │ Global │ Regional │
│ Subnets │ Regional │ AZ-specific │
│ Cross-region │ Built-in │ VPC Peering │
│ Firewall │ Network-level │ SG + NACL │
│ Routes │ Global │ Per-VPC │
│ DNS │ Auto internal │ Route 53 PHZ │
│ Default VPC │ Auto-mode │ Per region │
└──────────────────┴───────────────┴───────────────┘
4.2 Firewall Rules
GCP Firewall Rules:
# GCP ใช้ network-level firewall (ไม่มี Security Groups แบบ AWS)
# Firewall rules apply to VPC network, filter by tags or service accounts
Rule Components:
├── Direction: INGRESS or EGRESS
├── Priority: 0-65535 (lower = higher priority)
├── Action: ALLOW or DENY
├── Targets: All instances, Target tags, Service accounts
├── Source/Destination: IP ranges, Source tags, Service accounts
├── Protocols/Ports: TCP, UDP, ICMP, specific ports
└── Logs: optional packet logging
Example Firewall Rules:
# Allow SSH from specific IP
gcloud compute firewall-rules create allow-ssh-admin --network=my-vpc --allow=tcp:22 --source-ranges=203.0.113.10/32 --target-tags=ssh-allowed --priority=1000
# Allow HTTP/HTTPS from anywhere
gcloud compute firewall-rules create allow-web --network=my-vpc --allow=tcp:80,tcp:443 --source-ranges=0.0.0.0/0 --target-tags=http-server --priority=1000
# Deny all ingress (catch-all) — GCP has implied deny by default
# But explicit deny can override allowed rules
# Allow internal communication
gcloud compute firewall-rules create allow-internal --network=my-vpc --allow=tcp,udp,icmp --source-ranges=10.0.0.0/8 --priority=1000
Best Practices:
├── ใช้ target tags แทน IP ranges สำหรับ VM-to-VM rules
├── Minimize 0.0.0.0/0 source ranges
├── Enable firewall logging for audit
├── Use service accounts for identity-based rules
└── Review and clean up unused rules quarterly
4.3 Network Services
GCP Network Services:
1. Cloud NAT:
├── Managed NAT gateway for private VMs
├── No public IP needed for outbound internet
├── Auto-scaling (no bandwidth limits)
├── Logging for audit
└── เทียบกับ: AWS NAT Gateway
2. Cloud VPN:
├── HA VPN: 99.99% SLA, 2 tunnels per gateway
├── Classic VPN: single tunnel, 99.9% SLA
├── IPsec IKEv2
├── Max bandwidth: 3 Gbps per tunnel
├── ราคา: ~$0.025/hr per tunnel
└── เทียบกับ: AWS Site-to-Site VPN
3. Cloud Interconnect:
├── Dedicated Interconnect: 10/100 Gbps physical connection
│ └── ราคา: $1,700/mo per 10 Gbps
├── Partner Interconnect: via ISP partner
│ ├── 50 Mbps - 50 Gbps
│ └── Partners in Thailand: TRUE, AIS, DTAC, NTT
└── เทียบกับ: AWS Direct Connect
4. Cloud DNS:
├── Managed authoritative DNS
├── 100% availability SLA
├── DNSSEC support
├── Private DNS zones (VPC-internal)
└── ราคา: $0.20/zone/mo + $0.40/M queries
5. Cloud Load Balancing:
├── Global HTTP(S) Load Balancer:
│ ├── Single anycast IP → route to nearest backend
│ ├── SSL termination
│ ├── CDN integration
│ ├── URL-based routing
│ └── จุดเด่น: truly global, single IP for all regions
├── Regional TCP/UDP Load Balancer:
│ ├── Pass-through (no proxy)
│ └── Very high performance
├── Internal Load Balancer:
│ ├── Private IP load balancing
│ └── For internal services/databases
└── เทียบกับ: AWS ALB/NLB/GLB
6. Cloud CDN:
├── Integrated with Global Load Balancer
├── Edge locations worldwide
├── Cache static + dynamic content
├── Signed URLs/cookies
└── ราคา: $0.02-0.08/GB (depends on region)
ส่วนที่ 5: IAM และ Service Accounts
5.1 GCP IAM Model
GCP IAM ใช้โมเดล Resource Hierarchy ที่แตกต่างจาก AWS โดยมีลำดับชั้น: Organization → Folder → Project → Resource โดย IAM policies สามารถ set ที่ระดับใดก็ได้ และจะ inherit ลงมาจากระดับบนสุด ซึ่งแตกต่างจาก AWS ที่ใช้ IAM Users/Groups/Policies ที่ระดับ account
GCP IAM Hierarchy:
Organization (example.com)
├── IAM: Organization Admin, Billing Admin
├── Folder: "Production"
│ ├── IAM: Folder Admin
│ ├── Project: "prod-web-app"
│ │ ├── IAM: Project Owner, Editor, Viewer
│ │ └── Resources: VMs, databases, buckets
│ └── Project: "prod-data-analytics"
│ ├── IAM: BigQuery Admin, Data Viewer
│ └── Resources: BigQuery datasets
├── Folder: "Development"
│ └── Project: "dev-web-app"
│ ├── IAM: Developer role (Editor)
│ └── Resources: VMs, databases (dev)
└── Folder: "Shared Services"
└── Project: "shared-networking"
├── IAM: Network Admin
└── Resources: Shared VPC, VPN, DNS
IAM Components:
├── Members (Who):
│ ├── Google Account ([email protected])
│ ├── Service Account ([email protected])
│ ├── Google Group ([email protected])
│ ├── Google Workspace domain (example.com)
│ └── Cloud Identity domain
├── Roles (What permissions):
│ ├── Basic Roles: Owner, Editor, Viewer (broad — avoid in production)
│ ├── Predefined Roles: roles/compute.admin, roles/storage.objectViewer
│ │ └── Google maintains 1000+ predefined roles
│ └── Custom Roles: create your own combination of permissions
└── Policy (Binding members to roles on resources)
Best Practices:
├── ใช้ Predefined Roles แทน Basic Roles
├── Apply principle of least privilege
├── ใช้ Google Groups สำหรับ team access
├── ใช้ Service Accounts สำหรับ application access
├── Enable audit logging (Cloud Audit Logs)
└── Review IAM bindings regularly
5.2 Service Accounts
GCP Service Accounts:
What: Identity for applications/services (not humans)
Use: VM → access Cloud Storage, Cloud SQL, BigQuery, etc.
Types:
├── User-managed: คุณสร้างเอง
├── Default: auto-created per service (Compute, App Engine)
│ └── ระวัง: default SA มี Editor role (over-privileged!)
└── Google-managed: internal Google services
Key Management:
├── Option 1: Attached to resource (VM, Cloud Run, GKE)
│ └── Best practice: ไม่ต้อง download key
│ └── Workload Identity (GKE) — no keys needed
├── Option 2: Service Account Key (JSON file)
│ ├── Download JSON key file
│ ├── Set GOOGLE_APPLICATION_CREDENTIALS env var
│ ├── Application uses ADC (Application Default Credentials)
│ └── ระวัง: key file = security risk if leaked!
└── Option 3: Workload Identity Federation
├── Allow external identity (AWS, Azure, GitHub) to impersonate SA
└── No key file needed — best for multi-cloud/CI-CD
Example: VM with Service Account
gcloud compute instances create my-vm [email protected] --scopes=cloud-platform --zone=asia-southeast1-b
# VM can now access GCP services as "my-sa"
# No key file needed on the VM!
ส่วนที่ 6: BigQuery — Data Analytics ระดับ Petabyte
6.1 BigQuery คืออะไร?
BigQuery เป็น serverless data warehouse ที่เป็นจุดแข็งที่สุดของ GCP และเป็นเหตุผลหลักที่หลายองค์กรเลือกใช้ GCP BigQuery สามารถ query ข้อมูลขนาด petabytes ได้ภายในวินาทีโดยไม่ต้อง manage cluster, provision server หรือ tune performance ใดๆ คุณแค่ upload data แล้ว run SQL query ได้เลย Google จัดการ infrastructure ทั้งหมดให้
BigQuery Overview:
Architecture:
├── Dremel Engine: massively parallel query execution
├── Colossus: Google's distributed storage system
├── Jupiter Network: petabit bisection bandwidth
└── Borg: cluster management (predecessor of Kubernetes)
Key Features:
├── Serverless: no cluster/server to manage
├── Columnar storage: optimized for analytics queries
├── SQL interface: standard SQL (ANSI 2011)
├── Streaming inserts: real-time data ingestion
├── Partitioning: by date, integer range, or ingestion time
├── Clustering: sort data by specified columns
├── Materialized views: pre-computed aggregations
├── BI Engine: in-memory analysis for fast dashboards
├── ML in SQL: CREATE MODEL with SQL (BigQuery ML)
├── GIS functions: geographic analysis
└── Public datasets: free access to thousands of datasets
Pricing:
├── Storage: $0.02/GB/mo (active), $0.01/GB/mo (long-term)
├── Query: $6.25/TB scanned (on-demand)
│ └── First 1 TB/month FREE!
├── Flat-rate: $2,000/mo per 100 slots (predictable cost)
└── Streaming inserts: $0.012/200 MB
Example Queries:
-- Query public dataset (free)
SELECT
name, SUM(number) as total
FROM `bigquery-public-data.usa_names.usa_1910_current`
GROUP BY name
ORDER BY total DESC
LIMIT 10;
-- Create ML model with SQL (no Python needed!)
CREATE OR REPLACE MODEL `my_dataset.sales_forecast`
OPTIONS(model_type='linear_reg') AS
SELECT
sales_amount AS label,
day_of_week, month, store_id, promotion_flag
FROM `my_dataset.sales_data`
WHERE year BETWEEN 2023 AND 2025;
-- Predict with the model
SELECT * FROM ML.PREDICT(MODEL `my_dataset.sales_forecast`,
(SELECT day_of_week, month, store_id, promotion_flag
FROM `my_dataset.new_data`));
IT Use Cases for BigQuery:
├── Log analysis: centralize all server/application logs
├── Network traffic analysis: flow logs, firewall logs
├── Security analytics: SIEM alternative for large-scale
├── Cost analysis: cloud billing data analytics
├── Performance monitoring: metrics aggregation
└── Compliance reporting: audit log analysis
ส่วนที่ 7: GKE สำหรับ Kubernetes
7.1 ทำไม GKE ถึงเป็น Best Managed Kubernetes?
Google เป็นผู้สร้าง Kubernetes (พัฒนาจากระบบ Borg ที่ Google ใช้ภายใน) ดังนั้น GKE จึงได้รับ Kubernetes version ใหม่เร็วที่สุด มี feature ที่ advanced ที่สุด และมี integration ที่ลึกที่สุดกับ cloud platform GKE มี 2 modes หลักคือ Standard (คุณ manage worker nodes เอง) และ Autopilot (Google manage ทุกอย่างรวมถึง nodes คุณแค่ deploy pods)
GKE Quick Start:
# Create GKE Autopilot cluster
gcloud container clusters create-auto my-cluster --region=asia-southeast1
# Get credentials
gcloud container clusters get-credentials my-cluster --region=asia-southeast1
# Deploy application
kubectl create deployment my-app --image=nginx:latest --replicas=3
# Expose service
kubectl expose deployment my-app --type=LoadBalancer --port=80
# Check external IP
kubectl get service my-app
# → EXTERNAL-IP: 35.x.x.x (Google Cloud Load Balancer)
GKE Autopilot vs Standard:
┌──────────────────┬───────────────┬───────────────┐
│ Feature │ Autopilot │ Standard │
├──────────────────┼───────────────┼───────────────┤
│ Node management │ Google │ You │
│ Billing │ Per pod │ Per node │
│ Security │ Hardened │ You configure │
│ Scaling │ Auto per pod │ Node autoscale│
│ GPU │ Supported │ Supported │
│ Flexibility │ Limited │ Full │
│ เหมาะกับ │ Most workloads│ Special needs │
└──────────────────┴───────────────┴───────────────┘
GKE Advanced Features:
├── Workload Identity: SA binding (no key files in pods)
├── Binary Authorization: verify container image signatures
├── Config Sync: GitOps for cluster configuration
├── Policy Controller: enforce policies (OPA Gatekeeper)
├── Multi-cluster Services: service mesh across clusters
├── Backup for GKE: automated cluster backup/restore
├── Cost Optimization: right-sizing recommendations
└── GKE Enterprise: multi-cluster fleet management
ส่วนที่ 8: Cloud Run — Serverless Containers
8.1 Cloud Run คืออะไร?
Cloud Run เป็นบริการที่หลายคนบอกว่าเป็น “best serverless container platform” ความเรียบง่ายของ Cloud Run คือ: คุณ build Docker container → deploy ไป Cloud Run → ได้ HTTPS URL ทันที → scale to zero เมื่อไม่มี traffic (ไม่เสียเงิน) → scale to thousands เมื่อ traffic มา ไม่ต้อง manage server, cluster, load balancer หรืออะไรเลย
Cloud Run Deployment Example:
# 1. Write Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["gunicorn", "-b", "0.0.0.0:8080", "app:app"]
# 2. Build and push to Artifact Registry
gcloud builds submit --tag asia-southeast1-docker.pkg.dev/PROJECT/my-repo/my-app:v1
# 3. Deploy to Cloud Run
gcloud run deploy my-app --image=asia-southeast1-docker.pkg.dev/PROJECT/my-repo/my-app:v1 --region=asia-southeast1 --allow-unauthenticated --min-instances=0 --max-instances=100 --memory=512Mi --cpu=1
# 4. Done! Get URL:
# Service URL: https://my-app-xxxxx-as.a.run.app
Cloud Run Use Cases:
├── Web applications (any language/framework)
├── REST APIs / GraphQL APIs
├── Webhook receivers
├── Async processing (with Pub/Sub trigger)
├── Scheduled jobs (with Cloud Scheduler)
├── Migration from: VMs → containers → Cloud Run
└── Cost: scale to zero = pay only when handling requests
Cloud Run vs Cloud Functions vs GKE:
┌──────────────────┬───────────────┬───────────────┬───────────────┐
│ Feature │ Cloud Run │ Cloud Funcs │ GKE │
├──────────────────┼───────────────┼───────────────┼───────────────┤
│ Unit │ Container │ Function │ Pod/Container │
│ Scale to zero │ Yes │ Yes │ No (min 1 node│
│ Max timeout │ 60 min │ 60 min (Gen2) │ Unlimited │
│ Custom runtime │ Any Docker │ Limited langs │ Any Docker │
│ Networking │ VPC connector │ VPC connector │ Full VPC │
│ Stateful │ No │ No │ Yes (PV) │
│ Complexity │ Low │ Lowest │ High │
│ เหมาะกับ │ Most apps │ Event handlers│ Complex apps │
└──────────────────┴───────────────┴───────────────┴───────────────┘
ส่วนที่ 9: Cost Management — จัดการค่าใช้จ่าย GCP
9.1 GCP Pricing Model
GCP Cost Optimization Strategies:
1. Sustained Use Discounts (SUD):
├── GCP exclusive feature
├── อัตโนมัติ — ไม่ต้องสมัคร!
├── ใช้ VM เกิน 25% ของเดือน → เริ่มได้ discount
├── ใช้ 100% ของเดือน → ลดราคา ~30% automatically
└── Apply to: Compute Engine (N1, N2, custom machine types)
2. Committed Use Discounts (CUD):
├── Commit 1 year: ลด 37%
├── Commit 3 years: ลด 55%
├── Apply to: vCPU, memory, GPU, local SSD
├── Resource-based (not instance-based like AWS RI)
│ └── จุดเด่น: flexible — apply to any VM shape
└── Spend-based CUD: commit $ amount (for Cloud SQL, etc.)
3. Preemptible / Spot VMs:
├── ลดราคา 60-91% จาก on-demand
├── May be terminated with 30-second notice
├── Max runtime: 24 hours (Preemptible), no limit (Spot)
├── เหมาะกับ: batch processing, CI/CD, fault-tolerant workloads
└── Spot VM: แนะนำมากกว่า Preemptible (ใหม่กว่า, flexible)
4. Right-sizing Recommendations:
├── GCP Console → Compute Engine → VM instances
├── Recommendations tab shows underutilized VMs
├── Suggestion: downsize, change machine type, or delete
└── Based on actual CPU/memory usage data
5. Budget Alerts:
├── Billing → Budgets & Alerts
├── Set budget amount per project
├── Alert at 50%, 90%, 100%
├── Can trigger Cloud Function to auto-stop resources
└── Email + programmatic notification
Cost Management Tools:
├── Billing Reports: detailed cost breakdown
├── Cost Table: resource-level cost details
├── BigQuery billing export: analyze costs with SQL
├── Recommender API: right-sizing + idle resources
├── Active Assist: ML-based optimization suggestions
└── Quotas & Limits: prevent runaway costs
ส่วนที่ 10: Cloud Operations — Monitoring, Logging, Security
10.1 Cloud Monitoring
GCP Cloud Operations Suite:
1. Cloud Monitoring (formerly Stackdriver):
├── Metrics collection from GCP resources
├── Custom metrics (application-level)
├── Dashboards (drag-and-drop)
├── Alerting policies:
│ ├── Conditions: metric threshold, absence, rate of change
│ ├── Notifications: email, SMS, Slack, PagerDuty, webhook
│ └── Incident management
├── Uptime checks: HTTP(S), TCP, ICMP
├── SLO monitoring: define and track SLIs/SLOs
└── Integration: Grafana, Datadog, Prometheus
2. Cloud Logging:
├── Centralized log management
├── Auto-collect: GCE, GKE, Cloud Run, Cloud Functions
├── Log Router: route logs to different sinks
│ ├── Cloud Storage (archive)
│ ├── BigQuery (analytics)
│ ├── Pub/Sub (stream processing)
│ └── Splunk / 3rd party SIEM
├── Log-based metrics: create metrics from log patterns
├── Log Explorer: query and search logs
└── Audit Logs: Admin Activity, Data Access, System Event
3. Cloud Trace:
├── Distributed tracing for microservices
├── Auto-instrumentation for GCP services
├── Latency analysis
└── Integration: OpenTelemetry, Zipkin
4. Error Reporting:
├── Automatic error detection and grouping
├── Stack trace analysis
├── Error count trends
└── Notification on new errors
10.2 Security Services
GCP Security Services:
1. Security Command Center (SCC):
├── Centralized security management
├── Asset discovery and inventory
├── Vulnerability scanning
├── Threat detection (Event Threat Detection)
├── Compliance monitoring (CIS, PCI DSS, ISO 27001)
├── Security Health Analytics
└── Tiers: Standard (free), Premium (paid)
2. Cloud Armor:
├── DDoS protection (Layer 3/4/7)
├── WAF (Web Application Firewall)
├── IP allowlist/denylist
├── Geo-based access control
├── Rate limiting
├── Pre-configured WAF rules (OWASP Top 10)
├── Adaptive Protection (ML-based)
└── Works with: Global HTTP(S) Load Balancer
3. Other Security Services:
├── Cloud KMS: Key Management Service (CMEK, CSEK)
├── Secret Manager: store API keys, passwords, certificates
├── Certificate Authority Service: managed private CA
├── VPC Service Controls: prevent data exfiltration
├── BeyondCorp Enterprise: Zero Trust access
├── Binary Authorization: verify container images
├── Web Security Scanner: automated vulnerability scanning
└── Chronicle: Google's security analytics platform (SIEM)
Security Best Practices:
├── Enable Organization Policy constraints
├── Use VPC Service Controls for sensitive data
├── Enable Cloud Audit Logs (all services)
├── Enable Security Command Center
├── Use private Google Access (no public IP for GCP APIs)
├── Encrypt at rest (default) + CMEK for compliance
├── Regular IAM review + remove unused permissions
└── Enable MFA for all user accounts
ส่วนที่ 11: Anthos — Hybrid & Multi-Cloud
11.1 Anthos คืออะไร?
Anthos คือ platform ของ Google สำหรับบริหารจัดการ workloads แบบ hybrid cloud และ multi-cloud ทำให้สามารถ run Kubernetes workloads ได้ทั้งบน GCP, on-premise (VMware, bare metal) และบน cloud อื่นๆ (AWS, Azure) โดยใช้ management plane เดียว Anthos เป็นคำตอบของ Google สำหรับองค์กรที่ไม่สามารถย้ายไป cloud 100% ได้ หรือต้องการใช้หลาย cloud providers
Anthos Architecture:
┌─────────────────────────────────────────────────┐
│ Anthos Management Plane │
│ ├── Fleet Management (multi-cluster) │
│ ├── Config Sync (GitOps) │
│ ├── Policy Controller │
│ ├── Service Mesh (Anthos Service Mesh / Istio) │
│ ├── Anthos Config Management │
│ └── Centralized monitoring & logging │
├─────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ GKE on │ │ Anthos │ │ Anthos │ │
│ │ GCP │ │ on VMware│ │ on AWS │ │
│ │ │ │ (on-prem)│ │ (EKS) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ Same policies, same tools, same management │
└─────────────────────────────────────────────────┘
Anthos Use Cases:
├── Modernize on-prem apps with Kubernetes
├── Consistent multi-cloud management
├── Compliance: keep data on-prem, use cloud for compute
├── Gradual cloud migration
└── Avoid vendor lock-in
ส่วนที่ 12: GCP Certifications — แนวทางการ Certify
12.1 GCP Certification Paths
GCP Certification Roadmap for IT Professional:
Foundational:
├── Cloud Digital Leader
│ ├── Level: Entry-level, non-technical
│ ├── Target: ผู้จัดการ, ผู้บริหาร, คนที่เริ่มต้นเรียนรู้ cloud
│ ├── Topics: cloud concepts, GCP products, business value
│ ├── Format: 50 questions, 90 minutes
│ ├── Cost: $99 USD
│ └── Difficulty: ★★☆☆☆
Associate:
├── Associate Cloud Engineer
│ ├── Level: Hands-on practitioner
│ ├── Target: IT Professional ที่ deploy/manage GCP
│ ├── Topics:
│ │ ├── Set up cloud environment (projects, billing, IAM)
│ │ ├── Plan and configure cloud solution
│ │ ├── Deploy and implement (Compute, GKE, Cloud Run)
│ │ ├── Ensure successful operation (monitoring, logging)
│ │ └── Configure access and security
│ ├── Format: 50 questions, 120 minutes
│ ├── Cost: $200 USD
│ ├── Difficulty: ★★★☆☆
│ └── แนะนำ: เริ่มที่ cert นี้สำหรับ IT Professional
Professional:
├── Professional Cloud Architect
│ ├── Level: Advanced, most popular GCP cert
│ ├── Topics: design, plan, manage cloud architecture
│ ├── Case studies: real-world scenarios
│ ├── Cost: $200 USD
│ ├── Difficulty: ★★★★☆
│ └── แนะนำ: cert ที่มีค่าที่สุดสำหรับ career growth
│
├── Professional Cloud DevOps Engineer
│ ├── Topics: CI/CD, SRE, monitoring, incident management
│ └── Difficulty: ★★★★☆
│
├── Professional Cloud Network Engineer
│ ├── Topics: VPC, hybrid connectivity, load balancing
│ └── Difficulty: ★★★★☆
│
├── Professional Cloud Security Engineer
│ ├── Topics: IAM, VPC SC, encryption, compliance
│ └── Difficulty: ★★★★☆
│
├── Professional Data Engineer
│ ├── Topics: BigQuery, Dataflow, Dataproc, Pub/Sub
│ └── Difficulty: ★★★★☆
│
└── Professional Machine Learning Engineer
├── Topics: Vertex AI, ML pipeline, MLOps
└── Difficulty: ★★★★★
Study Resources:
├── Google Cloud Skills Boost (cloud.google.com/training)
│ └── Free labs and learning paths
├── Coursera: Google Cloud Professional Certificate
├── A Cloud Guru / Pluralsight
├── Official practice exams ($20-40)
├── Qwiklabs: hands-on labs
└── YouTube: Google Cloud Tech channel
ส่วนที่ 13: GCP จุดแข็งและข้อจำกัด
13.1 GCP Strengths — เหตุผลที่ควรเลือก GCP
GCP Strengths:
1. Data Analytics:
├── BigQuery: best serverless data warehouse
├── Dataflow: managed Apache Beam (batch + stream)
├── Dataproc: managed Hadoop/Spark
├── Pub/Sub: real-time messaging at scale
├── Looker: enterprise BI platform
└── Data Studio → Looker Studio (free BI dashboards)
2. Machine Learning / AI:
├── Vertex AI: unified ML platform
├── AutoML: no-code ML training
├── Pre-trained APIs: Vision, Speech, NLP, Translation
├── TPU (Tensor Processing Unit): custom ML hardware
├── Gemini: Google's most capable AI model
├── Generative AI Studio: prompt engineering + tuning
└── BigQuery ML: create ML models with SQL
3. Kubernetes:
├── GKE: best managed Kubernetes (Google created K8s)
├── Cloud Run: easiest serverless containers
├── Artifact Registry: container image storage
├── Anthos: multi-cloud Kubernetes management
└── Istio/Anthos Service Mesh: traffic management
4. Global Network:
├── Google's private global fiber network
├── Premium Tier networking (Google backbone end-to-end)
├── Lowest latency to many regions
├── Global load balancing with single anycast IP
└── Cloud CDN with 100+ edge locations
5. Pricing:
├── Per-second billing (not per-hour like others)
├── Sustained Use Discounts (automatic!)
├── Custom machine types (pay for exact CPU/RAM needed)
├── Preemptible/Spot VMs: up to 91% discount
└── Free tier: generous always-free limits
6. Developer Experience:
├── Clean, intuitive console
├── Cloud Shell: free terminal in browser
├── Cloud Code: IDE extensions (VS Code, IntelliJ)
├── gcloud CLI: consistent, well-designed
└── Terraform GCP provider: excellent documentation
13.2 GCP Limitations — ข้อจำกัดที่ต้องรู้
GCP Limitations to Consider:
1. Market Share & Ecosystem:
├── Smaller market share = fewer Thai community resources
├── Fewer third-party integrations compared to AWS
├── Fewer certified professionals to hire
└── Some enterprises still prefer AWS/Azure
2. Enterprise Features:
├── Fewer managed services than AWS (200+ vs 150+)
├── Less mature in some enterprise areas
├── Support plans can be expensive
└── Partner ecosystem smaller than AWS/Azure
3. Regional Presence:
├── Fewer regions than Azure (40 vs 60+)
├── No Thailand region yet (nearest: Singapore, Jakarta)
├── Some services not available in all regions
└── Data residency: may need specific region for compliance
4. Migration Tools:
├── Migrate for Compute Engine (good for VMs)
├── Database Migration Service (good)
├── But fewer migration accelerators than AWS
└── Less third-party migration tooling
Recommendation:
├── เลือก GCP ถ้า: data analytics, ML/AI, Kubernetes เป็น priority
├── เลือก AWS ถ้า: ต้องการ broadest service catalog, enterprise maturity
├── เลือก Azure ถ้า: ใช้ Microsoft 365/Active Directory เป็นหลัก
└── Multi-cloud: ใช้ GCP BigQuery + AWS/Azure compute = common pattern
ส่วนที่ 14: GCP Quick Start Checklist
14.1 เริ่มต้นใช้ GCP สำหรับ IT Professional
GCP Getting Started Checklist:
Week 1: Foundation
├── [ ] สร้าง GCP account + claim $300 free credit
├── [ ] สร้าง Organization (ถ้ามี Google Workspace domain)
├── [ ] สร้าง Project แรก
├── [ ] ทดลอง GCP Console + Cloud Shell
├── [ ] ติดตั้ง gcloud CLI บนเครื่อง
├── [ ] สร้าง VM แรก (Compute Engine)
├── [ ] SSH เข้า VM + install nginx
└── [ ] ลอง Cloud Storage: upload/download files
Week 2: Core Services
├── [ ] สร้าง VPC + subnets + firewall rules
├── [ ] สร้าง Cloud SQL instance (MySQL/PostgreSQL)
├── [ ] Connect VM to Cloud SQL (private IP)
├── [ ] ทดลอง Cloud Run: deploy container
├── [ ] ทดลอง BigQuery: query public dataset
├── [ ] Setup Cloud Monitoring: dashboard + alert
├── [ ] Setup IAM: create service account + roles
└── [ ] Setup budget alert (protect from overspending)
Week 3: Advanced Topics
├── [ ] Create GKE cluster (Autopilot)
├── [ ] Deploy application to GKE
├── [ ] Setup Cloud Load Balancer
├── [ ] Cloud VPN or Cloud NAT
├── [ ] Explore Cloud Functions (event-driven)
├── [ ] Cloud Logging: log router + BigQuery sink
├── [ ] Security Command Center: review findings
└── [ ] Cost analysis: review billing reports
Week 4: Certification Prep
├── [ ] Register for Associate Cloud Engineer exam
├── [ ] Complete Google Cloud Skills Boost learning path
├── [ ] Practice with Qwiklabs
├── [ ] Take practice exam
├── [ ] Review weak areas
└── [ ] Schedule exam at testing center or online
Free Tier Resources (Always Free):
├── Compute Engine: 1 e2-micro VM (US regions)
├── Cloud Storage: 5 GB Standard storage
├── BigQuery: 1 TB queries/month, 10 GB storage
├── Cloud Functions: 2 million invocations/month
├── Cloud Run: 2 million requests/month
├── Cloud Build: 120 build-minutes/day
├── Pub/Sub: 10 GB messages/month
├── Cloud Logging: 50 GB/month
├── Firestore: 1 GB storage, 50K reads/day
└── Artifact Registry: 500 MB storage
ส่วนที่ 15: สรุป
Google Cloud Platform เป็น cloud provider ที่แม้จะมี market share น้อยกว่า AWS และ Azure แต่มีจุดแข็งเฉพาะตัวที่เหนือกว่าในหลายด้าน โดยเฉพาะ BigQuery ที่เป็น serverless data warehouse ที่ดีที่สุดในตลาด, GKE ที่เป็น managed Kubernetes ที่ดีที่สุด (เพราะ Google สร้าง Kubernetes เอง), Cloud Run ที่ให้ประสบการณ์ serverless containers ที่ง่ายที่สุด, Vertex AI สำหรับ ML/AI ที่ integrate กับ ecosystem ของ Google ได้อย่างลงตัว และ global network ที่ใช้ private fiber backbone ของ Google เอง สำหรับ IT Professional ที่ต้องการเริ่มต้นเรียนรู้ GCP แนะนำให้เริ่มจากการสร้าง free account, ลองใช้ Cloud Shell, สร้าง VM แรก, ทดลอง BigQuery กับ public datasets แล้วค่อยๆ ขยายไปสู่ GKE, Cloud Run และ networking เมื่อพร้อมแล้วสมัครสอบ Associate Cloud Engineer ซึ่งเป็น certification ที่คุ้มค่าที่สุดสำหรับ IT Professional ที่ต้องการพิสูจน์ความรู้ด้าน GCP ในปี 2026 ที่ทุกองค์กรต้องการคนที่เข้าใจ multi-cloud การรู้จัก GCP นอกเหนือจาก AWS/Azure จะทำให้คุณมีความได้เปรียบในตลาดแรงงานอย่างแน่นอน