How much do my Amazon EKS nodes cost?

Photo by Towfiqu barbhuiya / Unsplash

If you want to know the cost of running Amazon EKS nodes, AWS Cost Explorer is your friend.

AWS Cost Explorer helps you analyze your AWS bill. Cost Explorer has an easy-to-use interface that lets you visualize, understand, and manage your AWS costs and usage over time.

Cost Explorer supports breaking down costs using tags. A tag is a label that you assign to an AWS resource. Tags enable you to categorize your AWS resources by, for example, purpose, owner, or environment.

Kubernetes cluster deployment tools like eksctl automatically add default tags to EC2 instances that are part of a managed node group. Customer can view tags attached to their nodes in the AWS Management Console.

To view the tags attached to your EKS nodes, go to the AWS Management Console and inspect the tags. You can also use the DescribeTags API to query tags using AWS CLI or SDK.

Image.jpeg

Pick an EC2 instance that's part of your EKS cluster, note its tags, select a tag, like eks:cluster-name, and verify that all nodes have that label. You will later use this tag to separate the costs of Kubernetes nodes from the rest of EC2 usage in your account(s).

Activate tags in billing

Once you have identified the tag using which you are going to identify EKS EC2 nodes, you’ll have to activate that tag in the AWS Billing and Cost Management console. You’ll need privileges to make changes.

To activate your tags using the AWS Management Console:

  1. Sign in to the AWS Management Console and open the AWS Billing console at https://console.aws.amazon.com/billing/.
  2. In the navigation pane, choose Cost Allocation Tags.
  3. Select the tags that you want to activate.
  4. Choose Activate.

Image.jpeg

After you select your tags for activation, it can take up to 24 hours for tags to activate.

Billing has AWS-generated cost allocation tags that customers can use to identify costs.

Image.jpeg

View charges in AWS Cost Explorer

Navigate to AWS Cost Explorer and create a new report

Image.jpeg

In the next screen, choose Cost and usage. Then scroll to the bottom of page and choose create report.

Image.jpeg

In the next screen, configure a Service filter, select EC2-Instances, and apply filter.

Image.jpeg

Create a Tag filter, select the tag you activated in billing, and apply. Be sure to select only true.

In my case, my nodes had the eks:cluster-name tag.

Image

Now Cost Explorer shows just the charges for my cluster.

Image.jpeg

Now I know that in Feb ’22, I paid roughly $3000 for the nodes that are part of the cluster named “Socrates.”