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 cluster monitoring metrics
Install / Use
npx skills add google/skills --skill gke-cost-analysisInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Tags
Our assessment of gke-cost-analysis
gke-cost-analysis scores 90/100 on our quality scale, 89th of 259 Operations skills we index (top 35%).
Its SKILL.md is 5.8 KB long, well organised into 10 sections with 1 code example: a solid amount of guidance for an agent.
With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so gke-cost-analysis is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
gke-cost-analysis compared with similar skills
All 4 of these similar skills score higher than gke-cost-analysis; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| gke-cost-analysis (this skill)by google | 90 | 20.3k | 2d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 4d ago | SKILL.md |
| ui-ux-pro-maxby nextlevelbuilder | 100 | 130.2k | 4d ago | SKILL.md |
Frequently asked questions
- How do I install gke-cost-analysis?
- Run
npx skills add google/skills --skill gke-cost-analysis. The install tabs above show the steps for each supported agent. - Which AI agents does gke-cost-analysis work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is gke-cost-analysis safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is gke-cost-analysis still maintained?
- The repository was last updated 2 days ago, so gke-cost-analysis is actively maintained.
Skill content
View source on GitHubname: gke-cost-analysis
metadata:
version: "1.0.0"
category: CloudObservabilityAndMonitoring
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).
GKE Cost Analysis
This skill provides guidance on answering natural language questions about GKE-related costs, billing reports, and utilization analysis.
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:
- Provide a Direct Answer: Address the specific cost question or analytical request clearly and concisely.
- 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_*). - 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 thegcloudcommand to enable it. - 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. - Provide Actionable Commands/Queries: Provide concrete BigQuery CLI (
bq query) commands or read-onlygcloud/kubectlinspection commands. Preferbqover 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 populategoog-k8s-cluster-name,k8s-namespace,k8s-workload-name, andk8s-workload-typelabels 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.
- Autopilot Pricing: Billed directly on pod resource requests
(
- Credits & Discounts Impact: When analyzing
costversuscost_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:
# 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).
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. 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.
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
ui-ux-pro-max
130.2kUI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
