Application
Modernization
Tip of the week series
Where does my money go? - Breaking down GKE
cluster cost using GKE Usage Metering
Sreenivas Makam
Why do we need 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
What is GKE Usage 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
GKE usage metering - Sample dashboards
Usage Metering workflow
Create bigquery
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
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
Conclusion
With GKE usage metering, we can get deep visibility
into usage patterns in our cluster which in turn can
help optimize the spend
References
GKE Usage metering
That’s a wrap.

GKE Tip Series - Usage Metering

  • 1.
    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
  • 4.
    GKE usage metering- Sample dashboards
  • 5.
    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
  • 8.
  • 9.