FinOps EKS: Top tips to cost cutting for AWS managed Kubernetes clusters

FinOps EKS: Top Tips to Cost Cutting for AWS Managed Kubernetes Clusters

Kubernetes is a powerful orchestration tool for managing containerized applications, and is the most popular container-orchestration platform in use today. Amazon Web Services (AWS) offers managed Kubernetes clusters through its Elastic Kubernetes Service (EKS) product. With EKS, AWS provides a complete Kubernetes cluster management solution, allowing users to quickly and easily deploy and manage their container workloads.


However, while AWS EKS provides a powerful and convenient way to manage containerized applications, it can also be a costly endeavor. In this blog, we will discuss the top tips for cost-cutting on AWS EKS managed Kubernetes clusters. We will discuss how to optimize the cost of running your EKS cluster, and how to take advantage of AWS cost-saving features to maximize your cost savings.

Understand Your Application Requirements

The first step to cost-cutting for AWS EKS managed Kubernetes clusters is to understand the requirements of your application. Knowing your application’s compute and storage needs, along with its availability requirements, will help you determine the best way to configure your cluster.

For example, if your application requires a certain level of compute power, you may be able to save money by configuring your cluster to use fewer but more powerful nodes. Similarly, if your application requires high availability, you may be able to save money by configuring your cluster to use multiple availability zones. By understanding your application’s requirements, you can configure your cluster to meet those requirements in the most cost-effective manner.

Take Advantage of Spot Instances

One of the best ways to save money on AWS EKS managed Kubernetes clusters is to take advantage of spot instances.  Spot Instances are a cost-effective way to utilize AWS VMs (EC2s). They are typically cheaper than on-demand resources, sometimes up to 90%. Spot Instances are created when AWS has excess capacity that it is unable to sell on demand. While this is a great way to save money, the downside is that these instances are preemptible, meaning that they can be taken away if AWS needs the resources for on-demand customers. This can be mitigated by creating a Launch Template, which allows AWS to order EC2s by price. If an inexpensive type is unavailable, AWS will automatically provision a slightly more expensive type. 

To take advantage of spot instances, you must configure your cluster to use spot instances as its compute nodes. This is relatively simple to do in EKS, and can result in significant cost savings. 

Kubernetes clusters are a great way to take advantage of Spot Instances, as they are designed to handle errors and self-repair by provisioning other VMs for its nodes. If your applications follow cloud patterns such as the 12-Factor App methodology, you can safely use Spot Instances. While the risk of losing EC2s is low, it is still a risk. Over a four-month period in eu-west-1 (Ireland), two days of unavailability of this type were observed in a zone. 


Right-Size Your Instances

Another way to reduce your costs for AWS EKS managed Kubernetes clusters is to right-size your instances. Right-sizing your instances means configuring your cluster to use the most cost-effective instance type for the workloads it will be running.

For example, if your cluster is running CPU-intensive workloads, you may be able to save money by configuring it to use compute-optimized instances instead of general-purpose instances. Similarly, if your cluster is running memory-intensive workloads, you may be able to save money by configuring it to use memory-optimized instances instead of general-purpose instances.

By right-sizing your instances, you can ensure that you are getting the most cost-effective compute resources for your workloads.

Utilize Reserved Instances

Another way to save money on AWS EKS managed Kubernetes clusters is to utilize reserved instances. Reserved instances are Amazon EC2 instances that can be purchased in advance for a discounted rate. Reserved instances can be a great way to reduce your compute costs, as they allow you to pay a fraction of the normal cost for compute power.

To take advantage of reserved instances, you must configure your cluster to use reserved instances as its compute nodes. This is relatively simple to do in EKS, and can result in significant cost savings.

Automate Your Cluster Scaling

One of the best ways to save money on AWS EKS managed Kubernetes clusters is to automate your cluster scaling. By automating your cluster scaling, you can ensure that your cluster is using the most cost-effective compute resources for your workloads.

For example, you can configure your cluster to scale up when the load on the cluster increases, and to scale down when the load on the cluster decreases. This can help you ensure that your cluster is only using the compute resources it needs, and can help you save money by avoiding wasted compute resources.

Automatically switch off outside working hours

Installing the kube-downscaler in the cluster can help reduce the number of nodes used during non-working hours. This tool works by automatically reducing deployments and statefulsets to 0 pods at designated times, with the exception of certain configurable namespaces. As a result, the Cluster Autoscaler will delete unused nodes, which can help drastically reduce the cost of running the production environment. Additionally, reducing the reserved disk space  can provide a slight additional cost saving.

Conclusion

AWS EKS managed Kubernetes clusters can be a great way to manage containerized applications, but they can also be a costly endeavor. In this blog, we have discussed the top tips for cost-cutting on AWS EKS managed Kubernetes clusters. 


How nOps can help with EKS Cost Management

By following these tips, you can ensure that you are getting the most cost-effective compute resources for your workloads, and that you are minimizing your costs for AWS EKS managed Kubernetes clusters. Want sharper visibility into the cost of your Kubernetes deployment on AWS and see how much you can save? You can explore more at nOps.io