agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/devops/gcp/SKILL.md

gcp

Skill15 starsChanged 42 days agoMITView on GitHub

Expert Google Cloud Platform (GCP) assistance covering Cloud Run, GKE, Cloud Functions, BigQuery, Pub/Sub, and IAM. Use when architecting and operating scalable, enterprise cloud applications on Google Cloud.

  • Reads credentials

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use standard service account keys.

    line 133

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google Cloud Platform (GCP)

Google Cloud Platform (GCP) provides scalable cloud infrastructure, featuring managed container runtimes (Cloud Run, GKE), BigQuery analytics, and Vertex AI foundation model tooling.

When to Use

  • Enterprise Google Cloud Infrastructure: Compute Engine (GCE), Google Kubernetes Engine (GKE), and Cloud Run.
  • Big Data Analytics & AI/ML: BigQuery data warehousing, Vertex AI foundation models, and Cloud Pub/Sub streaming.
  • Global Anycast Networking & CDN: Google Cloud Armor, Cloud CDN, and Cloud Load Balancing with single global anycast IPs.
  • Serverless Event-Driven Microservices: Cloud Run, Cloud Functions, and Eventarc.

Quick Start

# Deploy container directly to serverless Cloud Run
gcloud run deploy web-service \
  --image us-docker.pkg.dev/cloudrun/container/hello \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

Core Concepts

Cloud Run Container Service Architecture

Deploying containerized microservices that scale to zero and scale up dynamically:

# cloud-run-service.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: order-service
  labels:
    cloud.googleapis.com/location: us-central1
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/minScale: "1"
        autoscaling.knative.dev/maxScale: "50"
        run.googleapis.com/cpu-throttling: "true"
    spec:
      containerConcurrency: 80
      timeoutSeconds: 300
      containers:
        - image: us-central1-docker.pkg.dev/my-project/apps/order-service:v2.1
          resources:
            limits:
              cpu: "1000m"
              memory: "1Gi"
          env:
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: username

Pub/Sub Event Streaming with Python

Publishing and subscribing to real-time events with high throughput:

from google.cloud import pubsub_v1
import json

project_id = "my-gcp-project"
topic_id = "telemetry-events"

publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path(project_id, topic_id)

data = json.dumps({"sensor_id": 401, "temp": 24.5, "status": "OK"}).encode("utf-8")
future = publisher.publish(topic_path, data, origin="edge-gateway")
message_id = future.result()
print(f"Published message ID: {message_id}")

Zero-Trust VPC Service Controls & IAM

Restricting access to GCP APIs within secure service perimeters:

[Internet Client] ──► [Global External HTTPS Load Balancer] (Cloud Armor WAF)
                             │
                             ▼
                    [GKE / Cloud Run] (Private VPC)
                             │ (Private Google Access)
                             ▼
                    [VPC Service Controls Perimeter]
                       ├── BigQuery Datasets
                       └── Cloud Storage Buckets

Common Patterns

Event-Driven Architecture with Cloud Pub/Sub and Cloud Run

Problem: Decoupling synchronous service dependencies to absorb traffic surges without dropping requests.

Solution: Publish events to Pub/Sub and consume via Cloud Run push subscriptions:

# 1. Create Pub/Sub Topic
gcloud pubsub topics create order-events

# 2. Create Cloud Run push subscription targeting invoice worker service
gcloud pubsub subscriptions create order-events-sub \
  --topic order-events \
  --push-endpoint https://invoice-service-xyz-uc.a.run.app/events \
  --push-auth-service-account invoice-invoker@my-project.iam.gserviceaccount.com

Best Practices

Do:

  • Deploy serverless workloads to Cloud Run for automated scale-to-zero and high concurrency per container.
  • Protect applications with Google Cloud Armor security policies to neutralize DDoS and OWASP Top 10 exploits.
  • Configure VPC Service Controls to prevent data exfiltration from BigQuery and Cloud Storage.
  • Enable Secret Manager integration directly into Cloud Run and GKE pods rather than passing raw env strings.

Don't:

  • Use standard service account keys; use Workload Identity for GKE pods and Cloud Run services.
  • Assign roles/editor or roles/owner to service accounts; adhere strictly to least-privilege IAM roles.
  • Expose BigQuery datasets publicly without explicit authorized views.

Troubleshooting

ErrorCauseSolution
Cloud Run: The user-provided container failed to start and listen on the portContainer listening on localhost or ignoring $PORT environment variable.Ensure web server binds to 0.0.0.0 and listens on process.env.PORT (default 8080).
403 Forbidden: Caller does not have required permissionService account lacks IAM role on target resource.Grant appropriate IAM role: roles/run.invoker or roles/storage.objectViewer.
Cloud Build: Step failed with code 1Build failure inside container build step.Inspect build logs in GCP Console under Cloud Build > History.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.