Cloud Technology Community Question

How can I optimize costs for my Kubernetes workloads on AWS?

Posted on 2024-08-15 • In Cloud Technology • By Michael Brown

Our monthly cloud bill for our Kubernetes clusters has skyrocketed recently. We use managed node groups on AWS EKS, but it feels like we are over-provisioning. Are there specific tools or horizontal pod autoscaling strategies that can help us reduce costs without affecting the performance of our production microservices? I’m specifically interested in spot instances and rightsizing.

3 Answers 12,099 Views

All answers to this question 3 Answers

Barbara Miller Answered on 2024-08-17
Answered

To tackle high costs, I highly recommend looking at Karpenter instead of the standard Cluster Autoscaler. Karpenter is much faster at provisioning the right-sized instances based on the actual pending pods. You should also integrate Spot Instances for non-critical workloads or stateless microservices, which can save up to 90% compared to on-demand pricing. Use a tool like Kubecost to get granular visibility into which namespace or team is driving the spend. Finally, ensure your Horizontal Pod Autoscaler (HPA) is configured with sensible thresholds.

Thomas Wilson Answered on 2024-08-18
Answered

Have you checked your resource requests versus actual usage? Most teams set requests way too high "just in case," which leads to wasted capacity that you're still paying for even if it's not being used.

Michael Brown Commented on 2024-08-19
Commented

Thomas, you're spot on. I used the Vertical Pod Autoscaler in 'recommender' mode and found our dev environment was over-provisioned by 40%. By aligning our YAML requests with the VPA's suggestions, we managed to downsize our instance types from m5.xlarge to t3.medium for the staging clusters, saving a significant amount of money without any downtime.

Susan Taylor Answered on 2024-08-20
Answered

Vertical Pod Autoscaler (VPA) is great for rightsizing. It automatically adjusts your container requests based on historical usage so you don't have to guess.

Barbara Miller Commented on 2024-08-21
Commented

Susan makes a great point. VPA combined with Karpenter creates a very efficient "just-in-time" infrastructure that keeps overhead to an absolute minimum.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.