Google Cloud Platform Development Skill¶
This skill provides comprehensive guidance for working with Google Cloud Platform (GCP), covering project setup, service deployment, infrastructure management, security, and operational best practices.
When to Use This Skill¶
Use this skill when: - Setting up new GCP projects or organizations - Deploying applications to GCP services (Cloud Run, App Engine, Kubernetes Engine) - Managing GCP infrastructure with Terraform, Deployment Manager, or gcloud - Working with GCP databases (BigQuery, Cloud SQL, Firestore, Spanner) - Configuring GCP networking, load balancing, and CDN - Implementing security, IAM, and compliance measures - Setting up monitoring, logging, and alerting with Cloud Operations - Optimizing costs and managing billing - Troubleshooting GCP service issues or performance problems - Migrating applications to GCP from other platforms
Prerequisites¶
- Active Google Cloud account with billing enabled
- gcloud CLI installed and configured (
gcloud init) - Appropriate IAM permissions for the tasks
- Basic understanding of cloud computing concepts
- Project-specific requirements (APIs enabled, service accounts created)
Instructions¶
1. Project and Environment Setup¶
-
Authenticate and Configure gcloud
-
Enable Required APIs
-
Create Service Accounts (if needed)
2. Infrastructure Management¶
- Use Terraform for Infrastructure as Code
- Initialize Terraform:
terraform init - Plan changes:
terraform plan -
Apply changes:
terraform apply -
Follow GCP Resource Naming Conventions
- Use consistent prefixes and suffixes
- Include environment indicators (dev, staging, prod)
- Use hyphens for readability
3. Application Deployment¶
- Choose the Right Compute Service
- Cloud Run: For containerized applications
- App Engine: For web applications
- Kubernetes Engine: For complex, scalable applications
-
Compute Engine: For custom VMs
-
Deploy to Cloud Run (Example)
-
Set Up CI/CD Pipelines
- Use Cloud Build for automated builds
- Integrate with GitHub Actions or other CI tools
- Implement blue-green or canary deployments
4. Database and Storage¶
- Select Appropriate Database Service
- BigQuery: For data analytics and warehousing
- Cloud SQL: For relational databases (MySQL, PostgreSQL)
- Firestore: For NoSQL document database
-
Cloud Spanner: For globally distributed relational database
-
Configure Backups and High Availability
-
Use Cloud Storage for Static Assets
5. Security and Networking¶
-
Implement Least Privilege IAM
-
Configure VPC Networks
-
Set Up Load Balancers and CDN
6. Monitoring and Operations¶
-
Enable Cloud Monitoring and Logging
-
Set Up Alerts and Notifications
-
Use Cloud Trace for Performance Monitoring
- Enable tracing in your applications
- Analyze latency and bottlenecks
Examples¶
Example 1: Deploying a Web Application to App Engine¶
Example 2: Creating a BigQuery Dataset and Loading Data¶
# Create dataset
bq mk --dataset \
--description "My dataset description" \
my_dataset
# Create table
bq mk --table my_dataset.my_table schema.json
# Load data
bq load --source_format=CSV \
my_dataset.my_table \
gs://my-bucket/data.csv \
column1:STRING,column2:INTEGER
Example 3: Setting Up a Kubernetes Cluster¶
# Create cluster
gcloud container clusters create my-cluster \
--num-nodes=3 \
--zone=us-central1-a
# Get credentials
gcloud container clusters get-credentials my-cluster \
--zone=us-central1-a
# Deploy application
kubectl apply -f deployment.yaml
Best Practices¶
- Resource Organization: Use folders, projects, and labels for organization
- Cost Management: Set up billing budgets and alerts
- Security: Implement defense in depth with IAM, VPC, and security scanning
- Performance: Use appropriate machine types and autoscaling
- Reliability: Implement multi-region deployments for critical applications
- Monitoring: Set up comprehensive logging and monitoring from day one
- Automation: Use Infrastructure as Code for reproducible deployments
- Compliance: Follow GCP compliance certifications and regional requirements
Common Issues and Solutions¶
Issue: gcloud: command not found
Solution: Install gcloud CLI from https://cloud.google.com/sdk/docs/install
Issue: Authentication timeout
Solution: Run gcloud auth login to refresh authentication
Issue: API not enabled error Solution: Enable the required API in GCP Console or use:
Issue: Quota exceeded Solution: Check quotas in GCP Console and request increases if needed
Issue: Deployment failures Solution: Check Cloud Build logs and ensure proper permissions
Issue: High costs Solution: Use cost calculators, set budgets, and monitor usage with billing reports
Additional Resources¶
- GCP Documentation
- gcloud CLI Reference
- GCP Best Practices
- GCP Pricing Calculator
- GCP Well-Architected Framework
Related Skills¶
terraform-infrastructure: For advanced Infrastructure as Codekubernetes-management: For container orchestrationdatabase-administration: For database-specific taskssecurity-auditing: For security assessments