How to Reduce K8s cost with KubeCost & InfraCost

Reading Time: 3 minutes

How much do we spend on other #Cloud resources? Can we break down the price per team, #services, namespaces, and other groups? Are #KubeCost and #InfraCost the answer to those questions?


Kubecost helps you to monitor and manage the cost and also the capacity in Kubernetes environments.It helps you integrate various tools with your infrastructure to help your team track, manage, and reduce the overall cost.

  1. Kubecost Overview
    1. Dashboard Overview will give overall cost insights and Cost optimization monitoring. As you can see in the image it will show you:
      1. Monthly savings: Total estimated cost which you can save on your cloud resources & Kubernetes resources. Additionally, it will also give you recommendations to save your cluster costs.
      2. Monthly Kubernetes Costs: This section will show you the total monthly spent on Kubernetes for the current month. You can also filter at the container level to see cost Allocations.
      3. Cost allocation: It will show combined bars for namespaces’ costs like how much amount cost your namespaces are consuming.
      4. Kubernetes Asset costs: This panel shows us how much amount we are spending on Kubernetes infrastructure. For example Nodes, load balancer, Cluster management, log storage, etc.
      5. Cluster Efficiency: this section tells us how much amount of the cluster’s idle resources is, Allocations, and the usage of resources.
      6. Cloud Costs: Apart from Kubernetes Cost Kubecost dashboard also shows you out of the cluster cost for example bigquery, cloud storage, Or any other cloud services.
  2. Cost allocation
    1. Cost Allocation is one of the main features of Kubecost. It can show you cost breakdown at a very granular level. You can also select a time range as shown in the Diagram and use aggregators to group your result. Aggregators can be used to set on what level you want to see your cost allocation and then you can also generate reports in .csv format on the basis of results.
  3. Assets
    1. Assets allocation will tell you how much amount you are spending on your Kubernetes resources like Nodes, Load balancers, Persistent Disks, Cluster management, etc. It can show you out of the cluster cost like Bigquery, Log storage & other cloud services cost. This is also one of the main features of Kubecost & this also comes with an aggregator to group your results on different levels. Then you can export a .csv format report.
  1. Savings
    1. Savings is a cost optimization feature. It can estimate your monthly savings on your Kubernetes cluster & will give you recommendations on how can you adjust your infrastructure to reduce cost consumption. You can see cost breakdown to review the suggested savings & setup filters for cost-saving recommendations.
    2. For metrics-based usage it will show you graphs or panel how much amount of CPU & Memory you are using for instances.
  2. Health
    1. Kubecost comes with a great feature of health checks or health tests. Basically, it will check your Kubernetes health by running different checks against it. Some of health tests are:
      1. Facing compute pressure
      2. Crash looping pods
      3. Pending pods found
      4. Daily cluster costs increased 10% or more
      5. Network issues detected
      6. Out-of-memory event detected
  1. Reports
    1. You can save your cost allocations & assets allocations reports & kubecost will persist all report that is being created or saved by you. These reports can be used for cost alerts on slack channels.
  2. Alerts
    1. To notify you about your cost consumption kubecost comes with an alerting feature which sends alerts when your cost surpasses the given threshold. Alerts can be configured with emails & slack webhook. 

This is a typical Dashboard for KubeCost

This is how a typical KubeCost allocation Dashboard looks like.

This is how a typica KubeCost Health Status Dashboard looks like


InfraCost brings you the Cloud spend estimates for each Terraform in pull request, So you become aware who much a particular change will cost you and then you can estimate the cost forecast for your Infrastructure.

This is how a typical InfraCost Dashboard looks like

Various Benefits of InfraCost as well as features are as below

Get in touch with to book a Demo for KubeCost and InfraCost.

Written by 

Rahul Miglani is Vice President at Knoldus and heads the DevOps Practice. He is a DevOps evangelist with a keen focus to build deep relationships with senior technical individuals as well as pre-sales from customers all over the globe to enable them to be DevOps and cloud advocates and help them achieve their automation journey. He also acts as a technical liaison between customers, service engineering teams, and the DevOps community as a whole. Rahul works with customers with the goal of making them solid references on the Cloud container services platforms and also participates as a thought leader in the docker, Kubernetes, container, cloud, and DevOps community. His proficiency includes rich experience in highly optimized, highly available architectural decision-making with an inclination towards logging, monitoring, security, governance, and visualization.