Container Cost

Understanding the cost of your containerized workloads

The CloudZero Container Cost Solution

CloudZero combines container utilization data with your actual AWS costs to give you accurate allocation of costs within a Kubernetes cluster. Pod, CPU, and memory usage are automatically correlated with costs to give you detailed breakdowns of real cost by cluster, namespace, or pod down to the hour. And CloudZero doesn’t require you to manually define complex rules for allocating Kubernetes costs. We use a proprietary algorithm to calculate it automatically based on industry best practices and our own experience working with customers.

This document will provide you with an overview of how it works and how to get started gaining cost insight in your own Kubernetes environment.

Basic Installation & Configuration Workflow

CloudWatch Container Insights is an AWS service that collects, aggregates, and summarizes metrics and logs from containerized applications and microservices running in AWS. CloudZero uses some of the metrics from Container Insights to determine how to allocate your container costs. The process of configuring CloudZero container cost allocation depends on whether you use or intend to use the complete AWS CloudWatch Container Insights product.


Cost Implications

Container Insights is an additional AWS service with its own monthly cost. You should review the pricing (see “Example 7 - Container Insights for Amazon EKS and Kubernetes (k8s)” at before deciding whether to use the complete service with CloudZero. If you don’t want to use the full Container Insights service, a custom configuration is available which will have a significantly lower monthly AWS cost (see below). Ask your CloudZero success team to help estimate those costs if you’re interested in that option.

  1. Deploy Container Insights: If you are already using AWS Container Insights, you can skip ahead to the next step. If you would like to use the full Container Insights service, follow the Amazon Quick Start Setup - be sure to verify the prerequisites before beginning. If you only want to leverage AWS Container Insights to enable CloudZero container cost allocation, follow the custom configuration instructions . This will deploy the same Container Insights agent, but will disable any metrics or logs that are not necessary for the cost allocation feature.


Alternative Configuration

Remember - The full Container Insights service is not required. The custom configuration option enables the same functionality in CloudZero and will result in a lower AWS cost, but you will not have access to the other Container Insights features such as viewing metrics in the CloudWatch console.

  1. Set AWS Account Permissions - There are two permissions needed for the solution: give the cluster the ability to write to the Cloudwatch log, and a managed role that CloudZero needs to read that data from Cloudwatch. Follow our instructions to configure these permissions.
  2. Wait for container data to flow into CloudZero platform - It could take up to 24 hours for container cost information to show in your CloudZero account, depending on the time of day when you enable data collection.
  3. Explore allocated costs (see below)

Automatic Cost Allocation

CloudZero combines the metrics from the AWS Container Insights service with AWS billing information to automatically allocate costs to the workloads being orchestrated by Kubernetes. We calculate the cost of each pod within the architecture, and then re-aggregate them to attribute costs to other hierarchical kubernetes concepts, like namespaces and clusters.

Cost is calculated based on the cost of the EC2 instance - which represents the cost of a node in the Kubernetes system - combined with pod-level CPU and memory utilization. This allows us to assign a portion of the node’s total cost to the pod. This is handled automatically in the CloudZero platform; there is no need for manual allocation rules.

Generally speaking, this proportional algorithm works across a broad range of EC2 instance types, including those with SSD, NVMe SSD, GPU cores, GPU memory, and networking enhancements.

Exploring Container Cost

You can filter and group the allocated Kubernetes costs in the CloudZero Explorer and view them in the cost graph and cost table. Viewing and filtering is available by pod, namespace, cluster, or by label value.

Once you have grouped by a Kubernetes element, you can set a filter to further narrow the view. Expand the filters drawer and select to filter by pod, namespace, or cluster. To filter by label, first select the label key and then the label value.

NOTE: The Explorer UI currently limits the pods displayed when filtering by pod name to a maximum of 2000 pods.

Supported Platforms

Amazon Elastic Kubernetes Service (Amazon EKS) on Amazon EC2
Self-managed Kubernetes infrastructure on Amazon EC2
Amazon ECS on Fargate can be supported in limited situations
Amazon ECS on EC2 can be supported in limited situations
NOTE: AWS EKS on AWS Fargate is not supported at this time

Did this page help you?