Our AWS bill has skyrocketed since migrating to a production-grade kubernetes environment. We are running multiple microservices, but our resource utilization seems inefficient. What are some proven strategies for rightsizing nodes and implementing autoscaling to ensure we aren't paying for idle compute power?
3 answers
To manage costs in kubernetes, start by implementing the Vertical Pod Autoscaler (VPA) alongside the Horizontal Pod Autoscaler (HPA). VPA helps you understand the actual resource requirements of your containers, preventing "slack" where you request more CPU or RAM than you actually use. We also integrated Karpetner on our EKS clusters late last year. It’s much faster than the standard Cluster Autoscaler and picks the most cost-effective instance types based on the pending pod requirements. By shifting 40% of our non-critical workloads to Spot Instances, we managed to slash our monthly cloud bill by nearly 30% without affecting our uptime.
Are you currently using resource quotas and limits at the namespace level? Without these, one "hungry" service can scale out of control and inflate your kubernetes costs unexpectedly.
Look into Kubecost. It provides real-time visibility into kubernetes spending broken down by deployment and label, which is essential for showback/chargeback models.
Justin is spot on; Kubecost was a game changer for us too. Combining that with Cheryl’s mention of Spot Instances is the gold standard for kubernetes cost saving.
We have some limits set, Gregory, but they were mostly guesses. Based on Cheryl's advice, I think we need to use Prometheus metrics to actually see the "peak vs average" usage. Do you recommend any specific open-source dashboard that makes it easy to visualize which teams are over-provisioning their kubernetes namespaces?