Skip to main content

GCP GKE

K8Cost integrates with Google Kubernetes Engine to provide cost analysis using GCP-specific pricing for Compute Engine instances, Persistent Disks, and network egress.

Prerequisites

  • A GKE cluster running Kubernetes 1.24+
  • Metrics Server enabled (GKE enables it by default on Standard clusters)
  • kubectl configured with access to the cluster

How Pricing Works

K8Cost maps each GKE node's machine type (e.g., e2-standard-4, n2-standard-8) to GCP Compute Engine on-demand pricing for the cluster's region. Pod costs are calculated proportionally based on resource requests.

Supported pricing dimensions:

  • Compute: Compute Engine on-demand rates by machine type and region
  • Storage: Persistent Disk pricing (pd-standard, pd-balanced, pd-ssd)
  • Network: Inter-zone, inter-region, and internet egress estimates

Configure the agent for GCP:

kubectl set env cronjob/k8cost-analyzer -n k8cost \
K8COST_PROVIDER=gcp \
K8COST_REGION=us-central1

GKE-Specific Considerations

  • Autopilot clusters: K8Cost detects Autopilot mode and applies per-pod pricing (vCPU + memory per second) rather than node-level rates.
  • Preemptible / Spot VMs: Nodes with the cloud.google.com/gke-preemptible or cloud.google.com/gke-spot label are priced using discounted rates.
  • Committed Use Discounts: Track your CUD coverage in the Commitments dashboard.
  • GKE management fee: The per-cluster GKE fee (Standard: free for one cluster, Autopilot: $0.10/hr) is reflected in the cluster cost summary.

Next Steps