You can use pod tags to filter the cost details of pods in an ACK Serverless cluster by cluster, namespace, workload type, and workload name.
Introduction
Pods that run in ACK Serverless clusters are deployed on elastic container instances. Pods in ACK Serverless clusters have fixed tags. You can enable one or more cost allocation tags on the Cost allocation tags tab of the Alibaba Cloud User Center page. After you enable the cost allocation tags, you can select instance tags and cost tags to filter the costs.
Use the console to view cost details
Log on to the Billing Management console.
In the left-side navigation pane, choose
.On the Cost allocation tags page, select cost tags based on your requirements and click Batch Enable in the lower part of the page.
Cost allocation tag
Description
ClusterId
The cluster ID.
NameSpace
The namespace name.
OwnerReferenceKind
The workload type, such as Deployment and Job.
OwnerReferenceName
The workload name, such as the Deployment name and Job name.
In the left-side navigation pane, choose
.NoteIf this is the first time you enable Cost Analysis, click Activate Now.
On the Cost Analysis page, select Instance Tag from the Category drop-down list. Then, select a tag and the corresponding filters to view the cost details about the elastic container instances that match the tag and filters.
Parameter
Description
Example
Instance tag
You can select the following tags:
Instance Tag > ClusterId
Instance Tag > NameSpace
Instance Tag > OwnerReferenceKind
Instance Tag > OwnerReferenceName
Instance Tag > ClusterId
Filter
If you select multiple tags, the union of all pods that match the tags is displayed. For example, if you select ClusterID=A and NameSpace=default and the pod collection that matches ClusterID=A is {Pod_A, Pod_B, Pod_C} and the pod collection that matches NameSpace=default is {Pod_A, Pod_D, Pod_E}, the pod union that matches the two tags is {Pod_A, Pod_B, Pod_C,Pod_D, Pod_E}.
None
Use scenarios
The following table describes the use scenarios in which you need to view cost details on the Cost Analysis page. You must first complete the following operations:
Enable cost allocation tags and cost analysis. For more information, see Use the console to view cost details.
Obtain the ID of the cluster that you want to manage. For more information, see View cluster information.
Scenario description | Prerequisite | Configuration method | Example |
View the costs of all pods in a cluster | The ClusterId tag is enabled. | a. Category: Choose Instance Tag > ClusterId. b. Filters: Choose Tag > ClusterId and select the cluster ID. | |
View the costs of all pods in a namespace of a cluster | The ClusterId and NameSpace tags are enabled. | a. Category: Choose Instance Tag > NameSpace. b. Filters: Choose Tag > ClusterId and select the cluster ID. | |
View the costs of all pods created by workloads of the specified type in a cluster | The ClusterId and OwnerReferenceKind tags are enabled. | a. Category: Choose Instance Tag > OwnerReferenceKind. b. Filters: Choose Tag > ClusterId and select the cluster ID. | |
View the costs of all pods created by a workload with the specified name in a cluster | The ClusterId and OwnerReferenceName tags are enabled. | a. Category: Choose Instance Tag > OwnerReferenceName. b. Filters: Choose Tag > ClusterId and select the cluster ID. |
References
If you want to allocate costs by resource group, see Allocate costs by resource group.
For more information about the billing of ACK Serverless, see Billing of ACK Serverless clusters.