I'm looking for practical tips on reducing costs in our Kubernetes clusters. Specifically, I'm interested in strategies like automating scale-down for developer namespaces and optimizing resource requests and limits. What small changes have proven most effective for you? Automation or tools that help with these changes would be a bonus!
6 Answers
One of the biggest wins for us has been properly sizing our requests and limits. That, combined with auto-scaling for production environments, really made a difference in resource usage and cost. Also, we make sure to schedule non-production instances to scale down to zero when they're not needed. Just getting the core stuff right is key!
Honestly, if you don’t need Kubernetes, sometimes it's just better not to use it at all if you can find simpler solutions.
Using spot instances has been a game changer for us. We also moved some applications from ECS to EKS, and not using NAT gateways has significantly saved us cash. On Fridays, we clean up dev workloads not just to save costs but to keep everything tidy. Deploying just one instance by default has also helped, as well as avoiding sidecars unless absolutely necessary.
Could you explain how moving from ECS to EKS is cheaper? I'm a bit lost on that.
What’s the benefit of not using sidecars with Istio?
Honestly, sometimes the best advice is to just shut it down when you don't need it! It sounds funny, but it really helps... just make sure to bring them back up when necessary!
Ha! I had to laugh because that's exactly what I was going to say!
Implementing Horizontal Pod Autoscaler (HPA) and utilizing Kubernetes' failover and self-healing capabilities can yield immediate savings of around 60-70%. Coupling that with using preemptible or spot instances is definitely worth considering!
We've actually transitioned to using AWS Lambda for some workloads and it’s turned out to be cost-effective, especially for sporadic tasks!
I can relate! We schedule our test deployments to scale down after hours unless we specifically need them running.