gke-cost-analysis
Answer natural language questions and perform analysis on GKE cluster and workload costs using BigQuery billing exports, cost allocation data, and live…
Skill by googleOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/google-gke-cost-analysis
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gke-cost-analysis
What's inside
- Skill name
gke-cost-analysis- Description
- Answer natural language questions and perform analysis on GKE cluster and workload costs using BigQuery billing exports, cost allocation data, and live cluster monitoring metrics. Use when querying GKE costs across projects, namespaces, or workloads, analyzing billing reports in BigQuery (`bq`), checking cluster cost budgets (`gcloud billing`), or diagnosing cost drivers like pod requests vs. actual utilization (`kubectl top`). Don't use for applying cost optimization changes, creating rightsizing manifests (VPA/MPA), or selecting ComputeClasses (use gke-cost-optimization instead).
- License
- Apache-2.0
- Metadata
- version: 1.0.1 · category: CloudObservabilityAndMonitoring
- Instructions
- 118 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- attribution.md · references/
- billing-queries.md · references/
SKILL.md (first lines)
# GKE Cost Analysis
This skill provides guidance on answering natural language questions about
GKE-related costs, billing reports, and utilization analysis.
## Attribution
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix `gcloud` with
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-cost-analysis)"`
and append `agent-skills/1.0 (skill:gke-cost-analysis)` to `User-Agent` headers.
## Overview
When users ask about GKE costs (e.g., "What are my costs across projects?",
"What's my most expensive namespace?", "Why is my cluster cost spiking?"), use
this skill to provide a structured and expert response using BigQuery billing
exports, cost allocation metadata, and live cluster metrics.
## Instructions
When handling a cost-related question:
1. **Provide a Direct Answer**: Address the specific cost question or
analytical request clearly and concisely.
2. **Explain BigQuery Integration**: Explain how to query BigQuery for
historical cost breakdown. Note that GKE costs originate from the GCP
Billing Detailed BigQuery Export (`gcp_billing_export_resource_v1_*`).
3. **Check & Verify Cost Allocation**: Explain that GKE Cost Allocation must be
enabled on the cluster (`--enable-cost-allocation`) for namespace, label,
and workload-level billing granularity. If queries return empty labels,
provide the `gcloud` command to enable it.
4. **Analyze Pricing Drivers & Utilization**: When diagnosing cost drivers,
explain whether the cluster is in Autopilot (billed by requested pod
CPU/memory) or Standard mode (billed by underlying VM node size + control
plane fees), and compare live utilization (`kubectl top`) against
provisioned requests.
5. **Provide Actionable Commands/Queries**: Provide concrete BigQuery CLI (`bq
query`) commands or read-only `gcloud`/`kubectl` inspection commands. Prefer
`bq` over BigQuery Studio when available.
## Key Points & Pricing Drivers
- **Data Source**: GKE costs come from GCP Billing Detailed BigQuery Export.
The user must provide the full path to their BigQuery table (dataset name
and table name containing the Billing Account ID).
- **Granularity Requirement**: GKE Cost Allocation
(`--enable-cost-allocation`) must be enabled on the cluster to populate
`goog-k8s-cluster-name`, `k8s-namespace`, `k8s-workload-name`, and
`k8s-workload-type` labels in BigQuery.
- **Autopilot vs. Standard Cost Drivers**:
- **Autopilot Pricing**: Billed directly on pod resource requests
(`requests.cpu`, `requests.memory`, ephemeral storage). Over-requested
pods drive up billing regardless of whether the pod actively uses those
CPU cycles or memory.
- **Standard Pricing**: Billed on provisioned node pool VMs (`e2`, `n4`,
`c3`, etc.). Idle nodes or multiple low-utilization dev clusters drive
excess infrastructure costs.
- **Cluster Management Fee**: ~$0.10/hour per cluster applies to BOTH
Standard and Autopilot modes. The free tier waives it for one eligible
cluster per billing account.
- **Credits & Discounts Impact**: When analyzing `cost` versus
`cost_before_credits`, note that Committed Use Discounts (CUDs) and Spot VMs
appear as credits or reduced rate charges in the billing export.
- **Tools & Syntax**: BigQuery CLI (`bq`) is preferred. When writing Standard
SQL queries, use a dot (`.`) instead of a colon (`:`) to separate the
project ID and dataset name (`{project_id}.{dataset_name}.{table_name}`).
- **Defaults**: Assume last 30 days, row limit 10, ordering by cost descending
(`ORDER BY cost DESC`), unless specified otherwise.
## Live Cluster & Cost Monitoring
Use read-only CLI commands to inspect current cluster budgets, node utilization,
and pod resource consumption vs. requests:
```bash
# View billing budgets for an account (requires Cost Management API)
gcloud billing budgets list --billing-account={billing_account} --quiet
# View live node resource utilization across the cluster
kubectl top nodes
# View pod resource usage across namespaces (compare against requested limits to diagnose waste)
kubectl top pods --all-namespaces --containers
```
> **Warning — cluster mutation, not read-only:** Enabling GKE cost allocation
> modifies the cluster. Get explicit user confirmation before running it, and
> note that namespace/workload labels populate in the billing export only from
> enablement onward (no historical backfill).
>
> ```bash
> gcloud container clusters update {cluster_name} \
> --enable-cost-allocation \
> --region {region}
> ```
## Applying Cost Optimizations
To apply rightsizing changes based on analysis (such as setting up `VPA`
recommendation mode, adjusting CPU/memory to `P95 * 1.2`, configuring Spot VMs
via `nodeSelector` or `ComputeClass`, enforcing `ResourceQuotas`, or selecting
machine types and CUDs), use the **`gke-cost-optimization`** skill.
## BigQuery Query Templates
Ready-to-adapt `bq query` templates — single workload cost, per-workload
per-cluster breakdown, per-namespace breakdown — with the placeholder policy
and defaults (30 days, `LIMIT 10`, `ORDER BY cost DESC`) are in
[references/billing-queries.md](references/billing-queries.md). All parameters
(dataset, table, project, cluster, etc.) must be replaced with user values.
Note: Checking that the `goog-k8s-cluster-name` label exists scopes the total
billing data specifically to GKE costs.From google/skills, Apache-2.0.
More from google/skills
- 0.865score
google-ads-api-account-diagnostics
google-ads-api-teamOfficial
Diagnoses Google Ads account performance issues such as conversion loss (value or volume), low lead flow/volume, and lost impression share (opportunities) due…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-triage
Google LLCOfficial
Expert guidance for security alert triage in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-detection-engineering
Google LLCOfficial
Author, validate, test, and deploy YARA-L 2.0 detection rules and evaluate end-to-end detection coverage gaps in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-hunt
Google LLCOfficial
Expert guidance for proactive threat hunting in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-cases
Google LLCOfficial
Manage Google Security Operations (SecOps) SOAR cases throughout their lifecycle.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-investigate
Google LLCOfficial
Expert guidance for deep security incident and entity investigations in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.824score
google-ads-api-quickstart
google-ads-api-teamOfficial
Guides developers through Google Ads API quickstart: credential setup, choosing from 6 client libraries/REST, configuring environments, and running a…
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.819score
google-ads-api-mcp-setup
google-ads-api-teamOfficial
Guides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-dai-sdk
Google LLCOfficial
Integrates the Google Interactive Media Ads (IMA) Dynamic Ad Insertion (DAI) SDK into websites, web apps, mobile apps, or TV apps.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-sdk-client-side
Google LLCOfficial
Supports Interactive Media Ads (IMA) SDK.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up…
SkillAFreshness: A★ 21.5KClaude Code +9
Signals
- Stars
- 21,542
- Forks
- 1,821
- Open issues
- 21
- Last commit (this folder)
- Oct 19, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.1
- License
- Apache-2.0
- Repository
- github.com/google/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from google
- 0.699score
retrieving-developer-knowledge
googleOfficial
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
data-manager-api-setup
googleOfficial
Guides developers through client library installation and authentication setup steps for the Data Manager API.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-migrate-from-ai-studio
googleOfficial
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI).
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
google-cloud-recipe-onboarding
googleOfficial
Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a first resource.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up…
SkillAFreshness: A★ 21.5KClaude Code +9
Cite this page
gke-cost-analysis skill. Agent Mart. https://agentmart.dev/skills/google-gke-cost-analysis (last updated 2026-10-24)