View cost-related optimization metrics

Overview

You can view cost-related utilization metrics in the Google Cloud Console to see how effectively your Google Kubernetes Engine (GKE) clusters and workloads are utilizing the Compute Engine resources you pay for. This information can help you optimize the cost-to-performance ratio of your clusters and workloads.

Cost-related metrics for workloads

Cost optimization metrics

In the Cost Optimization tab in 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 time frame. 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 time frame. 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 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 time frame 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 time frame, metrics accumulated for the lifetime of cluster or workload displays. For example, you choose a time frame 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 will not have any metrics displayed unless workloads with specified requests are deployed to the cluster. This is due to the Autopilot pricing model.

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

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

What's next