gcp-cloud-architect – skill DevOps & Hạ tầng cho agent AI
Thiết kế kiến trúc GCP cho startup và doanh nghiệp lớn. Dùng khi cần thiết kế hạ tầng Google Cloud, triển khai lên GKE hoặc Cloud Run, cấu hình pipeline BigQuery, tối ưu chi phí GCP, hoặc di chuyển sang GCP. Bao gồm Cloud Run, GKE, Cloud Functions, Cloud SQL, BigQuery và tối ưu chi phí.
Cài skill gcp-cloud-architect bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/gcp-cloud-architect-d6c18.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /gcp-cloud-architect – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/gcp-cloud-architect-d6c18.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $gcp-cloud-architect – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/gcp-cloud-architect-d6c18.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /gcp-cloud-architect – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/gcp-cloud-architect-d6c18.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /gcp-cloud-architect – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
GCP Cloud Architect
Design scalable, cost-effective Google Cloud architectures for startups and enterprises with infrastructure-as-code templates.
---
Workflow
Step 1: Gather Requirements
Collect application specifications:
- Application type (web app, mobile backend, data pipeline, SaaS)
- Expected users and requests per second
- Budget constraints (monthly spend limit)
- Team size and GCP experience level
- Compliance requirements (GDPR, HIPAA, SOC 2)
- Availability requirements (SLA, RPO/RTO)Step 2: Design Architecture
Run the architecture designer to get pattern recommendations:
python scripts/architecture_designer.py --input requirements.jsonExample output:
{
"recommended_pattern": "serverless_web",
"service_stack": ["Cloud Storage", "Cloud CDN", "Cloud Run", "Firestore", "Identity Platform"],
"estimated_monthly_cost_usd": 30,
"pros": ["Low ops overhead", "Pay-per-use", "Auto-scaling", "No cold starts on Cloud Run min instances"],
"cons": ["Vendor lock-in", "Regional limitations", "Eventual consistency with Firestore"]
}Select from recommended patterns:
- Serverless Web: Cloud Storage + Cloud CDN + Cloud Run + Firestore
- Microservices on GKE: GKE Autopilot + Cloud SQL + Memorystore + Cloud Pub/Sub
- Serverless Data Pipeline: Pub/Sub + Dataflow + BigQuery + Looker
- ML Platform: Vertex AI + Cloud Storage + BigQuery + Cloud Functions
See references/architecture_patterns.md for detailed pattern specifications.
Validation checkpoint: Confirm the recommended pattern matches the team's operational maturity and compliance requirements before proceeding to Step 3.
Step 3: Estimate Cost
Analyze estimated costs and optimization opportunities:
python scripts/cost_optimizer.py --resources current_setup.json --monthly-spend 2000Example output:
{
"current_monthly_usd": 2000,
"recommendations": [
{ "action": "Right-size Cloud SQL db-custom-4-16384 to db-custom-2-8192", "savings_usd": 380, "priority": "high" },
{ "action": "Purchase 1-yr committed use discount for GKE nodes", "savings_usd": 290, "priority": "high" },
{ "action": "Move Cloud Storage objects >90 days to Nearline", "savings_usd": 75, "priority": "medium" }
],
"total_potential_savings_usd": 745
}Output includes:
- Monthly cost breakdown by service
- Right-sizing recommendations
- Committed use discount opportunities
- Sustained use discount analysis
- Potential monthly savings
Use the [GCP Pricing Calculator](https://cloud.google.com/products/calculator) for detailed estimates.
Step 4: Generate IaC
Create infrastructure-as-code for the selected pattern:
python scripts/deployment_manager.py --app-name my-app --pattern serverless_web --region us-central1Example Terraform HCL output (Cloud Run + Firestore):
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 5.0"
}
}
}
provider "google" {
project = var.project_id
region = var.region
}
variable "project_id" {
description = "GCP project ID"
type = string
}
variable "region" {
description = "GCP region"
type = string
default = "us-central1"
}
resource "google_cloud_run_v2_service" "api" {
name = "${var.environment}-${var.app_name}-api"
location = var.region
template {
containers {
image = "gcr.io/${var.project_id}/${var.app_name}:latest"
resources {
limits = {
cpu = "1000m"
memory = "512Mi"
}
}
env {
name = "FIRESTORE_PROJECT"
value = var.project_id
}
}
scaling {
min_instance_count = 0
max_instance_count = 10
}
}
}
resource "google_firestore_database" "default" {
project = var.project_id
name = "(default)"
location_id = var.region
type = "FIRESTORE_NATIVE"
}Example gcloud CLI deployment:
# Deploy Cloud Run service
gcloud run deploy my-app-api \
--image gcr.io/$PROJECT_ID/my-app:latest \
--region us-central1 \
--platform managed \
--allow-unauthenticated \
--memory 512Mi \
--cpu 1 \
--min-instances 0 \
--max-instances 10
# Create Firestore database
gcloud firestore databases create --location=us-central1> Full templates including Cloud CDN, Identity Platform, IAM, and Cloud Monitoring are generated by deployment_manager.py and also available in references/architecture_patterns.md.
Step 5: Configure CI/CD
Set up automated deployment with Cloud Build or GitHub Actions:
# cloudbuild.yaml
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'my-app-api'
- '--image=gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA'
- '--region=us-central1'
- '--platform=managed'
images:
- 'gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA'# Connect repo and create trigger
gcloud builds triggers create github \
--repo-name=my-app \
--repo-owner=my-org \
--branch-pattern="^main$" \
--build-config=cloudbuild.yamlStep 6: Security Review
Verify security configuration:
# Review IAM bindings
gcloud projects get-iam-policy $PROJECT_ID --format=json
# Check service account permissions
gcloud iam service-accounts list --project=$PROJECT_ID
# Verify VPC Service Controls (if applicable)
gcloud access-context-manager perimeters list --policy=$POLICY_IDSecurity checklist:
- IAM roles follow least privilege (prefer predefined roles over basic roles)
- Service accounts use Workload Identity for GKE
- VPC Service Controls configured for sensitive APIs
- Cloud KMS encryption keys for customer-managed encryption
- Cloud Audit Logs enabled for all admin activity
- Organization policies restrict public access
- Secret Manager used for all credentials
If deployment fails:
1. Check the failure reason:
gcloud run services describe my-app-api --region us-central1
gcloud logging read "resource.type=cloud_run_revision" --limit=20
2. Review Cloud Logging for application errors.
3. Fix the configuration or container image.
4. Redeploy:
gcloud run deploy my-app-api --image gcr.io/$PROJECT_ID/my-app:latest --region us-central1
Common failure causes:
- IAM permission errors -- verify service account roles and
--allow-unauthenticatedflag - Quota exceeded -- request quota increase via IAM & Admin > Quotas
- Container startup failure -- check container logs and health check configuration
- Region not enabled -- enable the required APIs with
gcloud services enable
---
Tools
architecture_designer.py
Recommends GCP services based on workload requirements.
python scripts/architecture_designer.py --input requirements.json --output design.jsonInput: JSON with app type, scale, budget, compliance needs
Output: Recommended pattern, service stack, cost estimate, pros/cons
cost_optimizer.py
Analyzes GCP resources for cost savings.
python scripts/cost_optimizer.py --resources inventory.json --monthly-spend 5000Output: Recommendations for:
- Idle resource removal
- Machine type right-sizing
- Committed use discounts
- Storage class transitions
- Network egress optimization
deployment_manager.py
Generates gcloud CLI deployment scripts and Terraform configurations.
python scripts/deployment_manager.py --app-name my-app --pattern serverless_web --region us-central1Output: Production-ready deployment scripts with:
- Cloud Run or GKE deployment
- Firestore or Cloud SQL setup
- Identity Platform configuration
- IAM roles with least privilege
- Cloud Monitoring and Logging
---
Quick Start
Web App on Cloud Run (< $100/month)
Ask: "Design a serverless web backend for a mobile app with 1000 users"
Result:
- Cloud Run for API (auto-scaling, no cold start with min instances)
- Firestore for data (pay-per-operation)
- Identity Platform for authentication
- Cloud Storage + Cloud CDN for static assets
- Estimated: $15-40/monthMicroservices on GKE ($500-2000/month)
Ask: "Design a scalable architecture for a SaaS platform with 50k users"
Result:
- GKE Autopilot for containerized workloads
- Cloud SQL (PostgreSQL) with read replicas
- Memorystore (Redis) for session caching
- Cloud CDN for global delivery
- Cloud Build for CI/CD
- Multi-zone deploymentServerless Data Pipeline
Ask: "Design a real-time analytics pipeline for event data"
Result:
- Pub/Sub for event ingestion
- Dataflow (Apache Beam) for stream processing
- BigQuery for analytics and warehousing
- Looker for dashboards
- Cloud Functio… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- bumblebee – Chạy quét kiểm kê và mức độ phơi nhiễm chuỗi cung ứng Bumblebee trên macOS/Linux để phát…
- cdk-patterns – Các mẫu và construct AWS CDK phổ biến để xây dựng hạ tầng đám mây bằng TypeScript…
- offensive-osint – Bộ công cụ vận hành cho trinh sát red-team bên ngoài và bug bounty có ủy quyền. Các…
- circleci – Cấu hình workflow và orb của CircleCI cho tích hợp liên tục và triển khai liên tục.
- claude-monitor – Giám sát hiệu năng Claude Code và hệ thống cục bộ. Chẩn đoán tình trạng chậm, đo…
- cloud-architect – Kiến trúc sư đám mây chuyên thiết kế hạ tầng đa đám mây AWS/Azure/GCP, IaC nâng cao…
- cloud-devops – Quy trình hạ tầng đám mây và DevOps, bao gồm AWS, Azure, GCP, Kubernetes, Terraform…
- cloud-iam-deep – Chuỗi tấn công red-team về IAM đám mây trên AWS, Azure, GCP