Catalog / Google Cloud Platform (GCP) DevOps Cheatsheet
Google Cloud Platform (GCP) DevOps Cheatsheet
A comprehensive cheat sheet for DevOps engineers working with Google Cloud Platform (GCP). This guide provides a quick reference to essential GCP services, commands, and best practices for implementing DevOps principles in the cloud.
Core Services & Concepts
Compute Engine
Description: |
Virtual machines in the cloud. Provides customizable instances with various OS options. |
Key Features: |
Scalable, Customizable, Global infrastructure. |
Use Cases: |
Web hosting, application servers, batch processing. |
gcloud command to create instance: |
|
Kubernetes Engine (GKE)
Description: |
Managed Kubernetes service for container orchestration. |
Key Features: |
Automated deployment, scaling, and management of containerized applications. |
Use Cases: |
Microservices architecture, containerized workloads. |
gcloud command to create cluster: |
|
Cloud Storage
Description: |
Scalable and durable object storage. |
Key Features: |
Object versioning, lifecycle management, multiple storage classes (Standard, Nearline, Coldline, Archive). |
Use Cases: |
Storing backups, media files, and data archives. |
gsutil command to create bucket: |
|
Infrastructure as Code (IaC)
Cloud Deployment Manager
Description: |
GCP’s native IaC service. |
Key Features: |
Uses YAML or Python to define infrastructure, supports templates and reusable configurations. |
Use Cases: |
Automating infrastructure provisioning and management. |
Example Deployment Manager Configuration (YAML): |
|
Terraform on GCP
Description: |
A popular open-source IaC tool that supports GCP. |
Key Features: |
Declarative configuration, state management, multi-cloud support. |
Use Cases: |
Managing infrastructure across multiple cloud providers and on-premises environments. |
Example Terraform Configuration: |
|
CI/CD Pipelines
Cloud Build
Description: |
GCP’s managed CI/CD service. |
Key Features: |
Automated build, test, and deployment of applications, integrates with Cloud Source Repositories, GitHub, and Bitbucket. |
Use Cases: |
Continuous integration and continuous delivery pipelines. |
Cloud Build Configuration (cloudbuild.yaml): |
|
Cloud Deploy
Description: |
GCP’s managed continuous delivery service that automates and orchestrates deployments to a variety of environments. |
Key Features: |
Progressive deployments (canary, blue/green), integrations with Cloud Build, approvals, rollback capabilities. |
Use Cases: |
Automated and safe deployments of applications to GKE, Cloud Run, and Compute Engine. |
Monitoring and Logging
Cloud Monitoring
Description: |
Provides visibility into the performance, uptime, and overall health of cloud-powered applications. |
Key Features: |
Dashboards, alerting, uptime checks, service monitoring. |
Use Cases: |
Monitoring application performance, infrastructure health, and user experience. |
Example Metric Query (PromQL): |
|
Cloud Logging
Description: |
Centralized log management for GCP services and applications. |
Key Features: |
Log aggregation, filtering, searching, and exporting. |
Use Cases: |
Troubleshooting application issues, auditing security events, and analyzing usage patterns. |
Example Log Filter: |
|