View cost-related optimization metrics


This page shows you how to view cost-related utilization metrics for your Google Kubernetes Engine (GKE) clusters. These metrics describe how effectively your GKE clusters and workloads are utilizing the Compute Engine resources you pay for.

You can use this information to optimize the cost-to-performance ratio of your clusters and workloads.

Cost optimization metrics

In the Cost Optimization tab in the Google Cloud console, you can view the following metrics for your clusters and workloads:

  • CPU utilization: Displays a bar chart that shows the relationship between the following CPU metrics:
    • Used: The amount of CPU used by all containers in the cluster or workload. Calculated from the container/cpu/core_usage_time metric.
    • Requested: The amount of CPU requested by all containers in the cluster or workload. Calculated from the container/cpu/request_cores metric.
    • Allocatable: The amount of CPU allocated to all nodes in the cluster. This metric is shown on the Clusters page. Calculated from the node/cpu/allocatable_cores metric. For Autopilot clusters, there is no allocatable value because Google automatically adjusts CPU allocations.
    • Limit: The CPU limit for all containers in a workload. This metric is shown on the Workloads page. Calculated from the container/cpu/limit_cores metric.
  • CPU hours: The total number of core hours on all nodes in a workload or cluster within the selected timeframe. Calculated from the node/cpu/total_cores metric (for Standard clusters) and the container/cpu/request_cores metric (for Autopilot clusters and workloads).
  • Memory utilization: Displays a bar chart that shows the relationship between the following memory metrics:
    • Used: The amount of memory used by all containers in a cluster or workload. Calculated from the container/memory/used_bytes metric.
    • Requested: The amount of memory requested for all containers in a cluster or workload. Calculated from the container/memory/request_bytes metric.
    • Allocatable: The amount of memory allocated to all nodes in the cluster. This metric is shown on the Clusters page. Calculated from the node/memory/allocatable_bytes metric. For Autopilot clusters, there is no allocatable value because Google automatically adjusts memory allocations.
    • Limit: The memory limit for all containers in a workload. This metric is shown on the Workloads page. Calculated from the container/memory/limit_bytes metric.
  • Memory hours: The total amount of memory on all nodes in a workload or cluster within the selected timeframe. Calculated from the node/memory/total_bytes metric (for clusters) and the container/memory/requested_bytes metric (for Autopilot clusters and workloads).

View the metrics

To view cost-related utilization metrics, perform the following steps in the Google Cloud console :

  1. To see cluster-level metrics, go to the Kubernetes Clusters page.

    Go to Kubernetes Clusters

    To see workload-level metrics, go to the Workloads page.

    Go to Workloads

  2. Select the Cost Optimization tab.

  3. Choose the timeframe over which the metrics are averaged (utilization) or accumulated (total hours). For example, 1 day, 1 month, and more. If the lifetime of the cluster or workload is less than the selected timeframe, metrics accumulated for the lifetime of cluster or workload displays. For example, you choose a timeframe of 1 day but the workload was created only 4 hours ago, so only 4 hours of metrics are displayed.

  4. Hold the pointer over the utilization metric to see further details.

Cost optimization metrics will display for cluster modes as follows:

  • Standard clusters will always have used, requested and allocatable metrics visible at creation time due to the inclusion of managed GKE components in the overall calculation (kube-system namespace).
  • Autopilot clusters only display metrics when you deploy workloads with specified requests to the cluster. This is due to the Autopilot pricing model. Autopilot clusters don't show allocatable metrics because you only pay for resources requested by your running workloads.

Workloads deployed to Standard clusters that don't have requests or limits specified, won't show a ratio on the chart. Instead, the bar chart will represent just the workload usage metric.

Workloads deployed to Autopilot clusters that don't have requests or limits specified, will have default values applied to the containers, and will show the ratios at all times.

What's next