116
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill einverne/dotfiles --skill gcloud- SKILL.md21.8 KB
Overview
This skill is a practical guide for implementing and using the Google Cloud SDK (gcloud CLI) to manage Google Cloud resources, automate operations, and integrate cloud tasks into scripts and CI/CD pipelines. It focuses on installation, authentication, configuration management, common workflows (Compute/GKE/Cloud Run/App Engine/Storage), and reliable automation patterns. The content emphasizes secure practices like service account impersonation and idempotent scripting.
How this skill works
The skill explains gcloud command structure, release levels (alpha/beta/GA), components, and global flags, then walks through installation methods for Linux, macOS, Windows, and package-managed installs. It covers authentication options (user accounts, service accounts, ADC, impersonation), named configurations for multi-environment setups, and examples for resource operations. Scripting sections show output formats, filtering, error handling, retries, and CI/CD integration patterns.
When to use it
- Installing or upgrading the Google Cloud SDK on developer machines or CI runners
- Authenticating to Google Cloud with user accounts, service accounts, or ADC
- Managing multiple projects, regions, or environment-specific configurations
- Deploying and managing Compute Engine, GKE, Cloud Run, App Engine, or Cloud Storage
- Automating gcloud operations in scripts and CI/CD pipelines
- Troubleshooting authentication, permissions, or deployment failures
Best practices
- Prefer service account impersonation in production to avoid long-lived keys
- Use named gcloud configurations for dev/staging/prod to avoid accidental changes
- Format output as JSON for reliable parsing in scripts and CI jobs
- Apply server-side filtering with --filter to reduce API and parsing load
- Make scripts idempotent and include retry/exponential backoff for transient errors
- Limit scope of IAM roles; grant least privilege and audit bindings regularly
Example use cases
- Set up a developer laptop: install gcloud, run gcloud init, and create a dev configuration
- CI pipeline: activate service account with key file or use workload identity, set project, and deploy a Cloud Run service
- Operational task: list running Compute Engine instances filtered by zone and status, then stop stale instances
- Kubernetes: create a GKE cluster, fetch credentials with get-credentials, and run kubectl commands
- Backup flow: sync local directory to Cloud Storage using gsutil rsync in a scheduled job
FAQ
Use ADC for client libraries and local development where automatic credential discovery is beneficial. Use activate-service-account in CI or automation when you must provide explicit service account credentials.
How do I avoid leaking service account keys?
Prefer service account impersonation or workload identity federation. If keys are required, store them in a secure secret manager and rotate or revoke keys regularly.