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:
- Sign in to Azure portal and navigate to Subscriptions.
- Search for the subscription hosting your clusters and select it.
- In the left navigation menu under Cost Management, select Cost analysis.
- In the View list, select the list drop-down item and then select Kubernetes clusters.
View from the Cost Management page
To view AKS costs from the Cost Management page:
- Sign in to Azure portal and search for Cost analysis.
- Verify that you are at the correct scope. If necessary, select change to select the correct subscription scope that hosts your Kubernetes clusters.
- Select the All views tab, then under Customizable views, select a view under Kubernetes views.
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.
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.
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.
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.
Next steps
For more information about splitting shared costs with cost allocation rules, see Create and manage Azure cost allocation rules.