You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/cost-analysis.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,37 +6,36 @@ ms.author: nickoman
6
6
ms.service: azure-kubernetes-service
7
7
ms.custom: ignite-2023, devx-track-azurecli
8
8
ms.topic: how-to
9
-
ms.date: 11/06/2023
9
+
ms.date: 03/15/2024
10
10
11
11
#CustomerIntent: As a cluster operator, I want to obtain cost management information, perform cost attribution, and improve my cluster footprint
12
12
---
13
13
14
14
# Azure Kubernetes Service cost analysis
15
15
16
-
An Azure Kubernetes Service (AKS) cluster is reliant on Azure resources like virtual machines, virtual disks, load-balancers, and public IP addresses. These resources can be used by multiple applications, which might be maintained by different teams within your organization. Resource consumption patterns for those applications are often variable, so their contribution towards the total cluster resource cost can also vary. Some applications can also have footprints across multiple clusters, which can pose a challenge when performing cost attribution and cost management.
16
+
An Azure Kubernetes Service (AKS) cluster is reliant on Azure resources like virtual machines, virtual disks, load-balancers, and public IP addresses. Multiple applications can use these resources, which might be maintained by different teams within your organization. Resource consumption patterns for those applications are often variable, so their contribution towards the total cluster resource cost can also vary. Some applications can also have footprints across multiple clusters, which can pose a challenge when performing cost attribution and cost management.
17
17
18
18
Previously, [Microsoft Cost Management (MCM)](../cost-management-billing/cost-management-billing-overview.md) aggregated cluster resource consumption under the cluster resource group. You could use MCM to analyze costs, but there were several challenges:
19
19
20
20
* There was no Azure-native capability to display cluster resource usage at a level more granular than a cluster. There was no breakdown into discrete categories such as compute (including CPU cores and memory), storage, and networking.
21
21
22
-
* There was no Azure-native functionality to distinguish between types of costs. For example, individual application versus shared costs. MCM reported the cost of resources, but there was no insight into how much of the resource cost was used to run individual applications, reserved for system processes required by the cluster, or idle cost associated with the cluster.
22
+
* There was no Azure-native functionality to distinguish between types of costs, for example between individual application costs and shared costs. MCM reported the cost of resources, but there was no insight into how much of the resource cost was used to run individual applications, how much was reserved for system processes required by the cluster, or what were the idle costs associated with the cluster.
23
23
24
24
* There was no Azure-native mechanism to analyze costs across multiple clusters in the same subscription scope.
25
25
26
-
As a result, you might have used third-party solutions to gather and analyze resource consumption and costs by Kubernetes-specific levels of granularity, such as by namespace or pod. Third-party solutions, however, require effort to deploy, fine-tune, and maintain for each AKS cluster. In some cases, you even need to pay for advance features, increasing the cluster's total cost of ownership.
26
+
As a result, you might have used third-party solutions to gather and analyze resource consumption and costs by Kubernetes-specific levels of granularity, such as by namespace or pod. Third-party solutions, however, require effort to deploy, fine-tune, and maintain for each AKS cluster. In some cases, you even need to pay for advanced features, increasing the cluster's total cost of ownership.
27
27
28
-
To address this challenge, AKS has integrated with MCM to offer detailed cost drill down scoped to Kubernetes constructs, such as cluster and namespace, in addition to Azure Compute, Network, and Storage categories.
29
-
30
-
The AKS cost analysis addon is built on top of [OpenCost](https://www.opencost.io/), an open-source Cloud Native Computing Foundation project for usage data collection, which gets reconciled with your Azure invoice data. Post-processed data is visible directly in the [MCM Cost Analysis portal experience](/azure/cost-management-billing/costs/quick-acm-cost-analysis).
28
+
To address this challenge, AKS has integrated with MCM to offer detailed cost drill-down scoped to Kubernetes constructs, such as cluster and namespace, in addition to Azure Compute, Network, and Storage categories.
31
29
30
+
The AKS cost analysis addon is built on top of [OpenCost](https://www.opencost.io/), an open-source Cloud Native Computing Foundation Sandbox project for usage data collection. The cost analysis is reconciled with your Azure invoice data. Post-processed data is visible directly in the [MCM Cost Analysis portal experience](/azure/cost-management-billing/costs/quick-acm-cost-analysis).
32
31
33
32
## Prerequisites and limitations
34
33
35
34
* Your cluster must be either `Standard` or `Premium` tier, not the `Free` tier.
36
35
37
36
* To view cost analysis information, you must have one of the following roles on the subscription hosting the cluster: Owner, Contributor, Reader, Cost management contributor, or Cost management reader.
38
37
39
-
* Once cost analysis has been enabled, you can't downgrade your cluster to the `Free` tier without first disabling cost analysis.
38
+
* Once you have enabled cost analysis, you can't downgrade your cluster to the `Free` tier without first disabling cost analysis.
40
39
41
40
* Your cluster must be deployed with a [Microsoft Entra Workload ID](./workload-identity-overview.md) configured.
42
41
@@ -46,7 +45,7 @@ The AKS cost analysis addon is built on top of [OpenCost](https://www.opencost.i
46
45
* Enterprise Agreement
47
46
* Microsoft Customer Agreement
48
47
49
-
* Virtual nodes are not supported at this time.
48
+
* Virtual nodes aren't supported at this time.
50
49
51
50
52
51
### Install or update the `aks-preview` Azure CLI extension
@@ -67,7 +66,7 @@ az extension update --name aks-preview
67
66
68
67
Cost analysis can be enabled during one of the following operations:
69
68
70
-
* Create a `Standard` or `Premium` tier AKS cluster
69
+
* Create a `Standard` or `Premium` tier AKS cluster.
71
70
72
71
* Update an AKS cluster that is already in `Standard` or `Premium` tier.
73
72
@@ -77,7 +76,7 @@ Cost analysis can be enabled during one of the following operations:
77
76
78
77
* Downgrade a `Premium` cluster to `Standard` tier.
79
78
80
-
To enable the feature, use the flag `--enable-cost-analysis` in combination with one of these operations. For example, the following command will create a new AKS cluster in the `Standard` tier with cost analysis enabled:
79
+
To enable the feature, use the flag `--enable-cost-analysis` in combination with one of these operations. For example, the following command creates a new AKS cluster in the `Standard` tier with cost analysis enabled:
81
80
82
81
```azurecli-interactive
83
82
az aks create --resource-group <resource_group> --name <name> --location <location> --enable-managed-identity --generate-ssh-keys --tier standard --enable-cost-analysis
@@ -102,11 +101,13 @@ az aks update --name myAKSCluster --resource-group myResourceGroup --disable-cos
102
101
You can view cost allocation data in the Azure portal. To learn more about how to navigate the cost analysis UI view, see the [Cost Management documentation](/azure/cost-management-billing/costs/view-kubernetes-costs).
103
102
104
103
### Cost definitions
105
-
In the Kubernetes namespaces and assets views you will see the following charges:
106
-
-**Idle charges**: This represents the cost of available resource capacity that wasn't used by any workloads.
107
-
-**Service charges**: This represents the charges associated with the service like Uptime SLA, Microsoft Defender for Containers etc.
108
-
-**System charges**: This represents the cost of capacity reserved by AKS on each node to run system processes required by the cluster, including the kubelet and container runtime. [Learn more](./concepts-clusters-workloads.md#resource-reservations).
109
-
-**Unallocated charges**: This represents the cost of resources that could not be allocated to namespaces.
104
+
105
+
In the Kubernetes namespaces and assets views you'll see the following charges:
106
+
107
+
-**Idle charges**: Represents the cost of available resource capacity that wasn't used by any workloads.
108
+
-**Service charges**: Represents the charges associated with the service like AKS Uptime SLA, Microsoft Defender for Containers etc.
109
+
-**System charges**: Represents the cost of capacity reserved by AKS on each node to run system processes required by the cluster, including the kubelet and container runtime. [Learn more](./concepts-clusters-workloads.md#resource-reservations).
110
+
-**Unallocated charges**: Represents the cost of resources that couldn't be allocated to namespaces.
110
111
111
112
> [!NOTE]
112
113
> It might take up to one day for data to finalize. After 24 hours, any fluctuations in costs for the previous day will have stabilized.
@@ -117,9 +118,8 @@ See the following guide to troubleshoot [AKS cost analysis add-on issues](/troub
Visbility is one element of cost management. Refer to [Optimize Costs in Azure Kubernetes Service (AKS)](./best-practices-cost.md) for additional best practices on how to gain control over your kubernetes cost.
124
+
125
+
Visibility is one element of cost management. Refer to [Optimize Costs in Azure Kubernetes Service (AKS)](./best-practices-cost.md) for other best practices on how to gain control over your kubernetes cost.
0 commit comments