Harnessing Looker to Demystify GKE Costs and Usage

Avani Vyas
Google Cloud - Community
5 min readJul 9, 2024

Google Kubernetes Engine (GKE) empowers businesses with scalable container orchestration, but managing costs effectively is crucial. Looker steps in as a powerful analytics platform to help one to understand, optimize, and even predict your GKE spending. In this guide, we’ll delve into how Looker transforms raw billing data into actionable insights, tailored for GKE environments.

Who Benefits Most?

  • Complex Environments: Organizations with multiple GKE clusters across regions, projects, or teams, Looker can help us track costs across our entire landscape.
  • Granular Analysis: Need to pinpoint spending by cluster, namespace, specific resources, or custom labels? Looker’s drill-down capabilities make it easy.
  • Multi-Service Users: If one makes use of a variety of GCP services alongside GKE, Looker provides a unified view of our entire cloud bill, simplifying analysis and budgeting

Looker’s Powerful Visualization

Looker goes beyond simple reports. It offers interactive dashboards that visually represent your GKE billing data. With these dashboards, you can answer critical questions about your spending at a glance. For example, one can quickly identify the costliest GKE clusters or see how our spending has trended over time.

To unlock the full potential of visualizing your GKE costs in Looker, one will need to lay the groundwork by enabling the export of your Google Cloud billing data to BigQuery (Export Cloud Billing data to BigQuery). Additionally, one will require to activate GKE Usage Metering for the applicable clusters. These crucial steps ensure Looker has access to the raw cost and usage data required for analysis.

Finally, one would require combining the billing exports and GKE usage metering data to create a dedicated BigQuery table specifically for GKE cost breakdowns (refer template). This granular data will empower us to perform in-depth analysis and generate insightful reports within Looker.

Building Insightful GKE Dashboards!

The GKE Cost Analysis Dashboard offers a detailed overview of your Google Kubernetes Engine (GKE) expenses.

Focused on usage-based pricing, it highlights two key metrics:

  • Allocated GKE Cost: This metric reveals the cost directly linked to your GKE resources.
  • Total GKE Cost: This broader metric encompasses the entire cost of running GKE, including the allocated resources and the expenses associated with unallocated resources. Unallocated resources consist of idle resources or those not specifically assigned by GKE usage metering. These costs are distributed proportionally across all namespaces.

The dashboard features filters for Project ID, Region, Cluster Name, Namespace, Usage Start Time, and Usage End Time, providing users the flexibility to tailor their view for a comprehensive understanding of GKE costs. As of course, using the background LookML the look and feel as well as the filtering options of the dashboard can be adapted to one’s specific needs.

Beyond the high-level overview, the “Usage Breakdown” view offers a detailed analysis of GKE costs, showcasing both resource and namespace-level breakdowns.

This granular view allows users to pinpoint specific areas within their GKE environment that are responsible for higher costs, enabling targeted optimization efforts.

The “Namespace Spending Trends” line chart illustrates the total cost incurred by different namespaces over time.

The “Usage Breakdown with Unallocated Resources” report provides a similar analysis to the standard usage breakdown, but it takes into account resources that aren’t specifically assigned to any particular namespace. These unallocated resources are then distributed proportionally across all existing namespaces to provide a more comprehensive picture of resource utilization.

“Consumption Based Billing” illustrates the contrast between requested and consumed resources for both CPU and memory within a GKE environment.

Customization and Flexibility:

In addition to these pre-built dashboards, Looker’s flexibility shines through its customization options. One can easily modify existing dashboards or create entirely new ones tailored to our specific needs. One can add custom filters, adjust visualizations, and even incorporate data from other sources to gain a holistic view of your cloud spending.

Conclusion:

If one is looking to gain a deeper understanding of your Google Kubernetes Engine (GKE) costs, we highly recommend leveraging the power of Looker. This robust platform enables us to access real-time insights, visualize spending patterns, and identify areas for potential optimization.

With Looker, one can create tailored dashboards that specifically cater to your GKE environment, providing a clear picture of cost allocation across clusters, namespaces, and resource types. The interactive visualizations make it easy to explore trends, anomalies, and areas where costs can be reduced.

Looker’s data exploration tools empower one to delve into the granular details of our GKE billing data, uncovering hidden patterns and insights that may not be immediately apparent. Armed with this knowledge, one can make informed decisions to optimize our GKE resource utilization, improve efficiency, and ultimately reduce costs.

Overall, Looker offers an invaluable solution for understanding and controlling your GKE expenses, enabling you to maximize the value of your investment in this powerful container orchestration platform.

Related Links:

Understanding cluster resource usage | Google Kubernetes Engine (GKE)

Looker introduction | Google Cloud

--

--