GCP for DevOps — GCP Free Tier

3 minute read

GCP Free Tier

Google Cloud offers one of the most generous free tiers among cloud providers. Understanding it helps you learn GCP without spending money.

Two Types of Free

GCP’s free tier has two components:

┌─────────────────────────────────────────────────────┐
│               GCP Free Tier Structure                │
├─────────────────────────────────────────────────────┤
│                                                      │
│  1. $300 Free Trial Credit                          │
│     └── Valid for 90 days                           │
│     └── Applies to ANY GCP service                  │
│     └── New accounts only                           │
│     └── Must upgrade to paid after trial            │
│                                                      │
│  2. Always Free Products                            │
│     └── Never expires                               │
│     └── Available even after trial ends             │
│     └── Usage-limited per month                     │
│                                                      │
└─────────────────────────────────────────────────────┘

Always Free Products for DevOps

Service Free Allowance DevOps Use Case
Compute Engine 1 e2-micro VM (us regions) Dev/test instance
Cloud Storage 5 GB (US regions) Artifact storage
Cloud Functions 2M invocations/month Event automation
Cloud Build 120 build-minutes/day CI/CD pipelines
Cloud Logging 50 GB/month Log collection
Cloud Monitoring All GCP metrics free Infrastructure monitoring
Artifact Registry 500 MB/month Docker image storage
Secret Manager 6 active secret versions Secret storage
Cloud Shell Free (5 GB home dir) Browser-based CLI
Pub/Sub 10 GB/month Event messaging
Firestore 1 GiB storage, 50K reads/day NoSQL database
BigQuery 1 TB queries, 10 GB storage/month Cost analysis

Free Trial Limitations

During the 90-day free trial:

Allowed Not Allowed
Create most resources Create more than 8 vCPUs per region
Use $300 credit Add GPUs or TPUs
Create projects Use Windows Server images
Enable APIs Request quota increases

After the trial ends, you must upgrade to a paid account. Your resources are NOT automatically charged — GCP deletes them if you don’t upgrade.

Avoiding Surprise Charges

Set Up a Budget Alert

# Using gcloud (limited — full support via Console or API)
# Best done in Console: Billing → Budgets & alerts → Create budget

# Via CLI — create a budget with alert thresholds
$ gcloud billing budgets create \
    --billing-account=0X0X0X-0X0X0X-0X0X0X \
    --display-name="Learning Budget" \
    --budget-amount=10USD \
    --threshold-rule=percent=0.5 \
    --threshold-rule=percent=0.9 \
    --threshold-rule=percent=1.0

Created budget [billingAccounts/0X0X0X-0X0X0X-0X0X0X/budgets/abc-123].

Check Current Spending

# Check billing info for a project
$ gcloud billing projects describe my-devops-lab

billingAccountName: billingAccounts/0X0X0X-0X0X0X-0X0X0X
billingEnabled: true
name: projects/my-devops-lab/billingInfo
projectId: my-devops-lab

Common Cost Traps

Resource Cost Trap Prevention
Compute Engine Forgotten running instances Shut down after practice
Cloud NAT ~$32/month even when idle Delete when not needed
Load Balancers Forwarding rules cost ~$18/month Clean up after labs
GKE Standard Control plane: $73/month Use Autopilot or delete clusters
Persistent Disks Charged even when VM is stopped Delete unattached disks
Static IPs $7.30/month if not attached Release unused IPs

Cleanup Script

Always run this after practice sessions:

# List all running instances
$ gcloud compute instances list

NAME        ZONE            MACHINE_TYPE  STATUS
test-vm     us-central1-a   e2-micro      RUNNING

# Delete a specific instance
$ gcloud compute instances delete test-vm \
    --zone=us-central1-a --quiet

Deleted [https://compute.googleapis.com/compute/v1/projects/my-devops-lab/zones/us-central1-a/instances/test-vm].

# Delete all instances in a project (be careful!)
$ gcloud compute instances list --format="value(name,zone)" | \
    while read name zone; do
      gcloud compute instances delete "$name" --zone="$zone" --quiet
    done

Common Mistakes

Mistake Fix
Assuming everything is free Check pricing before creating resources
Forgetting to delete resources Run cleanup commands after each session
Ignoring budget alerts Set up alerts before starting any labs
Not enabling billing Enable billing first — required even for free tier
Running GKE Standard for learning Use Autopilot (no control plane charge) or Cloud Run

Quick Reference

Item Details
Free credit $300 for 90 days
Free e2-micro 1 instance in us-central1, us-west1, or us-east1
Free Cloud Build 120 minutes/day
Free Cloud Logging 50 GB/month
Budget setup Console → Billing → Budgets & alerts
Check spending Console → Billing → Reports

Next → gcloud CLI Setup

Updated: