The document discusses GKE usage metering, which breaks down GKE cluster costs by users and applications, optimizing resource allocations and expenses. It highlights features like visibility into costs by namespaces and labels, along with methods for exporting billing data to BigQuery and creating dashboards. Overall, GKE usage metering provides insights to improve cost management and resource efficiency in Kubernetes environments.
Application
Modernization
Tip of theweek series
Where does my money go? - Breaking down GKE
cluster cost using GKE Usage Metering
Sreenivas Makam
2.
Why do weneed GKE Usage Metering?
● Break down the GKE cluster cost by individual
users and applications using the cluster
● Map GKE resources requested vs actual
consumption
● Tune GKE cluster configurations to optimize
cost
3.
What is GKEUsage metering?
● Visibility into GKE cluster cost
○ Break down the overall GKE cluster cost into namespaces, labels or a combination of both
○ Cost split into CPU, memory, network, GPU, TPU for the above resources
○ In multi-tenant scenarios, each team can be cross-charged using this capability.
○ Optimize cluster resource allocation thereby reducing overall cost
● Feature enabled as part of creating a cluster or editing an existing cluster
● This feature needs billing and metering data export to bigquery
● Cost correlation is done by matching billing report and usage metering data for the corresponding
kubernetes resources
● Sample datastudio templates are provided to view the GKE metering data from datastudio dashboard
Usage Metering workflow
Createbigquery
dataset and table for
billing data export to
BQ
Create bigquery
dataset and table for
GKE metering export
Create GKE cluster
and enable GKE usage
metering.
Generate query to
correlate billing data
and metering data.
Setup query to run
periodically
Use existing data
studio template to
create dashboard from
the correlated BQ table
6.
Useful dashboards
Usage breakdown
-Gives cost breakdown by namespace
- Visibility into unallocated resources
Cost trends by namespace
- Visibility into cluster, namespace, resource(cpu, memory, network) and SKU(CPU/memory types)
- Understand if the application is cpu, memory or network intensive
Cost trends by labels
- Visibility into individual label cost
- Helps in multi-tenant cost distribution
Consumption trends
- Compares requested vs actually used resources(CPU, memory, network).
- Helps in optimizing resource allocation
7.
Conclusion
With GKE usagemetering, we can get deep visibility
into usage patterns in our cluster which in turn can
help optimize the spend