मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट22k · #10284

gke-cost-analysis

यह क्या करती है

यह स्किल AI एजेंट को Google Kubernetes Engine की लागत के सवालों के सरल जवाब देने में मदद करती है। यह उन लोगों के लिए है जो जानना चाहते हैं कि कौन से projects, namespaces या workloads सबसे ज़्यादा खर्च करते हैं।

कब इस्तेमाल करें

  • ✓जब आप projects या namespaces में अपनी GKE लागत जानना चाहें।
  • ✓जब आपको GKE खर्च के लिए BigQuery में billing exports क्वेरी करने हों।
  • ✓जब cluster की लागत अचानक बढ़ जाए और आप उसका कारण ढूँढना चाहें।

Skill का लिंक

https://github.com/google/skills/blob/main/skills/cloud/gke-cost-analysis/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/google/skills/blob/main/skills/cloud/gke-cost-analysis/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“पिछले महीने मेरे GKE cluster का कौन सा namespace सबसे ज़्यादा खर्च कर गया?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट बताता है कि BigQuery में GKE billing डेटा कैसे क्वेरी करें, जाँचता है कि cost allocation चालू है या नहीं, और pods जो माँगते हैं उसकी तुलना वे असल में जो इस्तेमाल करते हैं, उससे करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

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. 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:

# 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 mod

अक्सर पूछे जाने वाले सवाल

क्या मुझे cost allocation चालू करना होगा?

हाँ। स्किल कहती है कि namespace और label के हिसाब से लागत डेटा पाने के लिए GKE cost allocation चालू होना चाहिए।

billing डेटा कहाँ से आता है?

यह Cloud Billing के विस्तृत BigQuery export से आता है।

क्या यह budgets जाँच सकती है?

हाँ। यह gcloud billing कमांड से cluster की लागत बजट जाँच सकती है।

जानकारी

लेखक का मूल विवरण

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).

repo: google/skills

लोकप्रियता

GitHub स्टार
22k
रैंकिंग में स्थान
#10284
लाइसेंस
Apache-2.0
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

finding-google-skills

22k

आपके एजेंट को किसी सेटअप काम के लिए सही Google गाइड खोजने में मदद करती है, जैसे hosting, databases, storage, sign-in या AI model serving।

AI और एजेंटएजेंट

gcloud

22k

यह आपके एजेंट को Google Cloud gcloud कमांड लिखने और जाँचने में मदद करती है, कुछ भी चलाने से पहले सटीक सिंटैक्स देखकर, ताकि फ़्लैग का अंदाज़ा न लगे।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

google-cloud-recipe-auth

22k

आपके एजेंट को Google Cloud की पहचान और पहुँच समझाती है, जिसमें यह शामिल है कि लोग और सेवाएँ कैसे साइन इन करते हैं और उन्हें कौन सी अनुमतियाँ मिलती हैं।

कोडिंगसिक्योरिटी

google-cloud-recipe-onboarding

22k

एक नए डेवलपर को Google Cloud पर पहले कदमों में मदद करती है, जिसमें प्रोजेक्ट चुनना, बिलिंग जोड़ना और पहला संसाधन डिप्लॉय करना शामिल है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

मिलती-जुलती skills