By Liusheng
This article introduces cluster cost analysis and describes how to set up cost analysis for a Container Service for Kubernetes (ACK) registered cluster.
(1) The version of the Kubernetes cluster is v1.18.8 or later.
(2) Enable Alibaba Cloud Prometheus Service For more information, see Enable Prometheus Service.
Using onectl CLI to configure a registered cluster, see Use onectl to configure a registered cluster for more information.
After configuring onectl, run the following command to automatically configure and install ack-cost-exporter components.
onectl addon install ack-cost-exporter
Expected output:
Successfully create ram policy 'externalK8sPolicy-ack-cost-exporter'.
Addon ack-cost-exporter installed
(1) Create a RAM user. For more information, see Create a RAM user.
(2) Create a custom permission policy. For more information, see Create a custom permission policy. The following permissions are required for the ack-arms-prometheus component.
{
"Version": "1",
"Statement": [
{
"Action": [
"bssapi:QueryInstanceBill",
"bssapi:DescribeInstanceBill"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ecs:DescribeDisks",
"ecs:DescribeSpotPriceHistory",
"ecs:DescribeInstances",
"ecs:DescribePrice"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": "eci: DescribeContainerGroupPrice",
"Resource": "*",
"Effect": "Allow"
}
]
}
(3) Add permissions to the RAM user. For more information, see Grant permissions to a RAM user.
(4) Create an AccessKey pair for the RAM user. For more information, see Create an AccessKey Pair.
(5) Use the AccessKey pair to create a Secret named alibaba-addon-secret in the registered cluster.
Run the following command to create the Secret for the ack-cost-exporter component:
kubectl -n kube-system create secret generic alibaba-addon-secret --from-literal='access-key-id=<your AccessKey ID>' --from-literal='access-key-secret=<your AccessKey Secret>'
(1) Log on to the ACK console. In the left-side navigation pane, click Clusters.
(2) On the Clusters page, click the name of the target cluster and choose Applications > Helm in the left-side navigation pane. If there are existing ack-cost-exporter installation records on the *Helm page, delete them before following the subsequent steps to reconnect.
(3) In the left-side navigation pane of the details page, select Operations > Components.
(4) On the Components page, click the Logs and Monitoring tab.
(5) Locate the ack-cost-exporter card and click Install in the lower right corner. Then, click OK. After the installation, you can learn more about the capabilities of the cost analysis component. For more information, see Cost Analysis.
Migrating Applications from the Application Center to ACK One GitOps
How to Provide Production-level Stable Diffusion Services Based on Knative
167 posts | 30 followers
FollowAlibaba Container Service - August 10, 2023
Alibaba Cloud Native - October 16, 2023
Alibaba Container Service - November 21, 2024
Alibaba Container Service - October 30, 2024
Alibaba Container Service - April 12, 2024
Alibaba Container Service - August 10, 2023
167 posts | 30 followers
FollowA unified, efficient, and secure platform that provides cloud-based O&M, access control, and operation audit.
Learn MoreManaged Service for Grafana displays a large amount of data in real time to provide an overview of business and O&M monitoring.
Learn MoreProvides a control plane to allow users to manage Kubernetes clusters that run based on different infrastructure resources
Learn MoreAlibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products.
Learn MoreMore Posts by Alibaba Container Service
Kidd Ip August 3, 2023 at 12:41 am
Thank you for sharing, it is good to have cost analysis in K8S!