Here's every edge case I found

📰 Reddit r/devops

Learn how to calculate Kubernetes pod costs from scratch using Python and Prometheus metrics

advanced Published 10 Jun 2026
Action Steps
  1. Build a Python script to pull metrics from kube-state-metrics
  2. Configure cAdvisor and node-exporter to collect node-level metrics
  3. Use the AWS pricing APIs to get the latest pricing information
  4. Apply the cost calculation math to the raw Prometheus metrics
  5. Test and validate the cost calculations against Kubecost or OpenCost
Who Needs to Know This

DevOps engineers and developers can benefit from understanding the implementation details of Kubecost to optimize their Kubernetes costs

Key Insight

💡 Understanding the implementation details of Kubecost can help optimize Kubernetes costs

Share This
Calculate Kubernetes pod costs from scratch using Python and Prometheus metrics 💡

Key Takeaways

Learn how to calculate Kubernetes pod costs from scratch using Python and Prometheus metrics

Full Article

Spent the last several months going down a rabbit hole: I wanted to understand how Kubecost actually knows what a pod costs. Not the high-level answer — the actual implementation. So I built it myself from scratch. 1,700 lines of Python pulling directly from kube-state-metrics, cAdvisor, node-exporter, and the AWS pricing APIs. No Kubecost. No OpenCost as a dependency. Just the math applied directly to raw Prometheus metrics. Then I extended OpenCo
Read full article → ← Back to Reads

Related Videos

AWS, Azure, GCP: The One Thing Every Business Gets Wrong
AWS, Azure, GCP: The One Thing Every Business Gets Wrong
AI Daily
Containers on Amazon ECS with Mama J
Containers on Amazon ECS with Mama J
AWS Developers
How to Open QTR Files (QuickTime Movie)
How to Open QTR Files (QuickTime Movie)
File Extension Geeks
Improving DevOps Security and Efficiency at Cathay with AWS ProServe | Amazon Web Services
Improving DevOps Security and Efficiency at Cathay with AWS ProServe | Amazon Web Services
Amazon Web Services
Kubernetes Observability 101: Metrics, Logs, Dashboards, and Traces
Kubernetes Observability 101: Metrics, Logs, Dashboards, and Traces
Kubesimplify
Do Azure and AWS Have Too Much Power? The EU’s Answer: Maybe So. #cloud #aws #azure
Do Azure and AWS Have Too Much Power? The EU’s Answer: Maybe So. #cloud #aws #azure
Digital Transformation with Eric Kimberling