gke-cost-analysis

Analyze GKE cluster and workload costs using BigQuery billing exports and live cluster metrics.

Updated May 11, 2026
One-click install
npx skills add https://github.com/alon3153/upe-social-publisher --skill gke-cost-analysis-alon3153
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gke-cost-analysis
Source: https://github.com/alon3153/upe-social-publisher/tree/main/.agents/skills/gke-cost-analysis
Command: npx skills add https://github.com/alon3153/upe-social-publisher --skill gke-cost-analysis-alon3153

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Answering questions about Google Kubernetes Engine spending—such as which namespace or workload drives costs, or why a cluster bill is spiking—requires joining BigQuery billing exports with cluster metadata and live utilization data, which is tedious and error-prone to do manually. ## Core Features & Use Cases - BigQuery Billing Analysis: Provides ready-to-adapt Standard SQL templates for the GCP Billing Detailed Export to break down costs by project, cluster, namespace, and workload. - Cost Allocation Verification: Explains how to check and enable GKE Cost Allocation so namespace- and workload-level labels appear in billing data. - Utilization Diagnosis: Compares live resource usage (kubectl top) against pod requests to identify over-provisioning in Autopilot or idle nodes in Standard clusters. - Use Case: Ask "What is my most expensive namespace in cluster X over the last 30 days?" and receive a concrete bq query command plus an explanation of the pricing drivers behind the result. ## Quick Start Ask the assistant to analyze your GKE costs by providing your BigQuery billing export table path and the cluster or namespace you want to investigate.

Frequently Asked Questions about gke-cost-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query GKE costs in BigQuery by namespace?

Query the GCP Billing Detailed Export table filtering on the k8s-namespace label, grouping by namespace and summing cost plus credits. GKE Cost Allocation must be enabled on the cluster for these labels to be populated.

How to find the most expensive workload in a GKE cluster?

Run a BigQuery query grouping by k8s-workload-name and k8s-workload-type labels, ordered by cost descending with a limit of 10. The billing export must include the goog-k8s-cluster-name label to scope results to GKE.

Why are namespace labels empty in my GKE billing export?

Empty namespace and workload labels mean GKE Cost Allocation is not enabled on the cluster. Enable it with gcloud container clusters update --enable-cost-allocation, noting labels only populate from enablement onward with no historical backfill.

What is the difference between Autopilot and Standard GKE pricing?

Autopilot bills on pod resource requests for CPU, memory, and ephemeral storage, while Standard bills on provisioned node pool VMs plus a cluster management fee of about $0.10 per hour. Both modes incur the management fee unless covered by the free tier.

Can this skill apply cost optimization changes to my cluster?

No, this skill is read-only and focused on analysis and diagnosis. For applying rightsizing changes such as VPA recommendations, Spot VMs, or ComputeClasses, use the gke-cost-optimization skill instead.