View Kubernetes costs

This article helps you view Azure Kubernetes Service (AKS) cost in Microsoft Cost management. You use the following views to analyze your Kubernetes costs, which are available at the subscription scope.

  • Kubernetes clusters – Shows aggregated costs of clusters in a subscription.
  • Kubernetes namespaces – Shows aggregated costs of namespaces for all clusters in a subscription.
  • Kubernetes assets – Shows costs of assets running within a cluster.

Visibility into a Kubernetes cluster cost helps you identify opportunities for optimization. It also enables cost allocation to different teams running their applications on shared clusters in different namespaces.

Prerequisites

  • You must enable AKS cost analysis on the cluster to view its costs. If you have multiple clusters running in a subscription, you must enable AKS cost analysis on every cluster. For more information about how to enable cost analysis for clusters, see Azure Kubernetes Service cost analysis.
  • Kubernetes cost views are available only for the following subscription agreement types:
    • Enterprise Agreement
    • Microsoft Customer Agreement
      Other agreement types aren't supported.
  • You must have one of the following roles on the subscription hosting the cluster.
    • Owner
    • Contributor
    • Reader
    • Cost management reader
    • Cost management contributor

Access Kubernetes cost views

Use any of the following ways to view AKS costs.

View from the Subscription page

To view AKS costs from the Subscription page:

  1. Sign in to Azure portal and navigate to Subscriptions.
  2. Search for the subscription hosting your clusters and select it.
  3. In the left navigation menu under Cost Management, select Cost analysis.
  4. In the View list, select the list drop-down item and then select Kubernetes clusters.
    Screenshot showing the Kubernetes clusters view.

View from the Cost Management page

To view AKS costs from the Cost Management page:

  1. Sign in to Azure portal and search for Cost analysis.
  2. Verify that you are at the correct scope. If necessary, select change to select the correct subscription scope that hosts your Kubernetes clusters.
    Screenshot showing the scope change item.
  3. Select the All views tab, then under Customizable views, select a view under Kubernetes views.
    Screenshot showing the Kubernetes views items.

Kubernetes clusters view

The Kubernetes clusters view shows the costs of all clusters in a subscription. With this view, you can drill down into namespaces or assets for a cluster. Select the ellipsis ( ) to see the other views.

Screenshot showing the ellipsis item to show more views.

Kubernetes namespaces view

The Kubernetes namespaces view shows the costs of namespaces for the cluster along with Idle and System charges. Service charges, which represent the charges for Uptime SLA, are also shown.

Screenshot showing the Kubernetes namespaces view.

Kubernetes assets view

The Kubernetes assets view shows the costs of assets in a cluster categorized under one of the service categories: Compute, Networking, and Storage. The uptime SLA charges are under the Service category.

Screenshot showing the Kubernetes assets view.

View amortized costs

By default, all Kubernetes views show actual costs. You can view amortized costs by selecting Customize at the top of the view and then select Amortize reservation and savings plan purchases.

Screenshot showing the amortize display option.

Next steps

For more information about splitting shared costs with cost allocation rules, see Create and manage Azure cost allocation rules.