0

We are running a multi tenant Kubernetes cluster running on EKS (in AWS) and I need to come up with an appropriate way of charging all the teams that use the cluster. We have the costs of the EC2 worker nodes but I don't know how to split these costs up given metrics from prometheus. To make it trickier I also need to give the cost per team (or pod/namespace) for the past week and the past month.

Each team uses a different namespace but this will change soon so that each pod will have a label with the team name.

From looking around I can see that I'll need to use container_spec_cpu_shares and container_memory_working_set_bytes metrics but how can these two metrics be combined to used so that we get a percentage of the worker node cost?

Also, I don't know promql well enough to know how to get the stats for the past week and the past month for the range vector metrics.

If anyone can share a solution if they're done this already or maybe even point me in the right direction i would appreciate it.

Thanks

Steve
  • 175
  • 1
  • 3
  • 13
  • Did you take a look at kubecost? https://kubecost.com – Hang Du Jun 08 '20 at 10:37
  • I did but my company won't pay for it :/ If I can figure out the right way to split out CPU and RAM costs from the single EC2 cost and how to get the above metrics for a time frame then I can do everything I need to – Steve Jun 08 '20 at 11:21

0 Answers0