Today Vantage announced support for OpenCost as a source of Kubernetes pod level costs for customers running Kubernetes clusters on AWS, GCP, Azure or on-prem. OpenCost is a vendor-neutral open source CNCF project for measuring and allocating infrastructure and container costs in real time. Vantage can now retrieve and display OpenCost data directly from customers’ own Prometheus endpoints. This enables users to view pod level costs for Kubernetes clusters by clicking into costs by resource, on a Cost Report, for a specific cluster and then grouping by namespace, container, or label for that cluster.
Previously, Vantage only supported Kubernetes costs through AWS Container Insights. This provided a limited set of cost data and was restricted to costs calculated per hour. Along with limited support, Container Insights can be prohibitively expensive to store and query all of the pod level metrics in CloudWatch.
Now, Vantage gives customers additional choice for viewing Kubernetes costs through support for querying OpenCost metrics via Prometheus. These costs include CPU, RAM, GPU and storage and support for both EKS and self-managed Kubernetes clusters. Just as with AWS Container Insights, customers can filter and group these costs by Kubernetes dimensions such as namespace, service, container, and label — all of which are automatically ingested by Vantage by default.
To integrate Kubernetes costs, login to the Vantage console and head to the integrations page. From there you can click “Add” next to the Kubernetes section. You will be given instructions for deploying relevant infrastructure and permissions via CloudFormation. Vantage can also integrate with any existing Prometheus endpoint as well. After the endpoint is integrated and the metrics are imported Kubernetes will be available as a filterable provider on Cost Reports. You can also read more about the technical integration in our docs.
Frequently Asked Questions
1. What is being launched today?
Today, Vantage is launching support for OpenCost giving customers the ability to see pod level costs for all Kubernetes clusters, grouped by service, namespace label and container. This enables customers to see which specific containers are driving the costs of their multi-tenant Kubernetes clusters. Kubernetes costs can be combined with other provider costs on cost reports to give team’s a full view of their costs.
2. Who is the customer?
Any Vantage user who has a Kubernetes cluster deployed.
3. What is OpenCost?
OpenCost is an open source and Cloud Native Computing Foundation project. It runs as a daemon in your Kubernetes cluster and calculates the cost of individual pods.
“OpenCost provides visibility into current and historical Kubernetes spend and resource allocation.”
You can read more on the CNCF project page.
4. What is required to enable this feature?
There are three things a customer must do in order to complete the OpenCost integration:
- Deploy the CloudFormation stack on the integrations page. This Stack deploys an AWS Managed Prometheus workspace and gives the Vantage IAM Role access to query this instance. This instance is required in order for Vantage to have access to the data. The stack also deploys an IAM user which will be used to authenticate between the OpenCost deployed Prometheus and the Managed Prometheus Workspace.
- Generate credentials for the IAM User to be used in the OpenCost configuration.
- Deploy and configure OpenCost on your Kubernetes cluster. You can follow these instructions on this step. If you already have OpenCost deployed you can update your configuration to have the OpenCost Prometheus servers remote_write to the Vantage deployed Managed Prometheus workspace.
When the CloudFormation stack finishes deploying it will automatically be configured in Vantage and costs will begin to be imported.
If you would like to customize this setup within your account you can reach out to email@example.com for additional support.
5. How does OpenCost calculate the cost of running Kubernetes pods?
OpenCost calculates the cost of a running pod by looking at the CPU, RAM, GPU and storage usage and calculates the cost of each based on the cost of the underlying infrastructure. There is a formula for dividing the cost of a compute instance into CPU, RAM and GPU which then computes the cost per hour of each type of resource.
6. How does OpenCost differ from AWS Container Insights?
OpenCost does all of the cost allocation calculations locally to your cluster and makes this data available for querying. Container Insights on the other hand stores all pod level system metrics such as CPU and RAM. From there Vantage would query CloudWatch for these metrics and do the cost allocation calculation. Container Insights is more expensive for users to run as they have to pay to store the system metrics and pay for the cost of Vantage querying these costs.
7. How much does this cost?
OpenCost is free to run and the resource usage on your Kubernetes cluster is very low. You will have to pay for the deployed Managed Prometheus instance and the data being written and queried. The cost of this depends on the scale of Kubernetes data, but for most customers this is less than 1% of their total EKS Cluster cost.
8. How long does it take for Kubernetes costs to be available?
Vantage will query your Prometheus instance on a daily basis to pull in the latest cost data. However, there is an initial two day delay before the cost data will be available on a cost report. If you are integrating a Prometheus endpoint which has data prior to two days ago that will be available on a cost report immediately after the data is imported. The initial import varies depending on the size of your cluster, but usually takes less than an hour.
9. Is Container Insights still supported as an integration path?
Yes. Customers with existing Container Insights integrations will continue to function as before. However, OpenCost is now the suggested integration path for Kubernetes costs.
10. Are Kubernetes costs available through the Cost Reports API?
Yes, after you create a Cost Report with Kubernetes as a provider the costs will be available for this report via the API.
11. Does this work for ECS on EC2 or Fargate?
No, OpenCost only has support for Kubernetes. Service level costs are already available for ECS via active resources.
12. Why can’t Vantage query my OpenCost data directly from my Kubernetes cluster?
In most cases Prometheus running on a Kubernetes cluster will not be exposed with a public endpoint. To get around this a second centralized Prometheus instance is deployed into your account to be used as an aggregation point which Vantage has both network and IAM access to query.
You can read more about AWS Managed Prometheus here.
13. How do I add costs for multiple Kubernetes clusters?
You can use the same AWS Managed Prometheus Workspace for multiple clusters. You have to ensure the CLUSTER_ID is set when deploying OpenCost on your Kubernetes cluster in order for Vantage to differentiate between the multiple clusters.
14. What additional permissions are added to my AWS account?
The CloudFormation stack adds the ability to query the AWS Managed Prometheus Workspace with the following permissions:
"aps:GetLabels", "aps:GetMetricMetadata", "aps:GetSeries", "aps:QueryMetrics"
The created IAM User only has access to write to the Prometheus Workspace with the following:
Both sets of permissions are scoped specifically to the ARN of the deployed Prometheus workspace.
15. Can I use Vantage with Kubernetes clusters outside of AWS?
If you have Kubernetes clusters outside of AWS and would like to import those costs to Vantage please contact firstname.lastname@example.org to learn more.
16. Do Kubernetes costs increase my accounted for spend on Vantage?
No, currently Kubernetes costs are not included in monthly tracked infrastructure costs as they’re already captured from underlying EC2, and optionally EKS, costs.
17. Can Vantage integrate If I have already have a hosted Prometheus with OpenCost data?
As long as the Prometheus endpoint is publicly available it can be integrated. Please contact email@example.com to get started.
18. I’m using Grafana to visualize Kubernetes monitoring. Can I make use of this?
Vantage can integrate with any publicly accessible Prometheus endpoint - including Grafana cloud.