[Study Case] Cost Optimization for AWS EKS at Hukumonline.com with Spot Instance and AWS EKS
This articles is created on my experience when i am done with core system migration at Hukumonline. And in the end of the process of migration is optimizing cost.
When we finish migration, this is our total cost which is USD 15.091 at December.

At February, we successfully decrease the cost to USD 10.599

For theory of cost optimization, you can refer to this article that i write before.
[Theory] Cost Optimization in AWS
For this articles, i will talk about Spot Instance that we used to our development and production AWS EKS environment a.k.a Kubernetes.
In our case when we already optimize and reducing number of server we used at EKS, so we want to optimize more with the same spec but with lower cost.
Our previous state is like this →

Our current (when this articles created) is like this →

Before you use spot instance in your eks, you need to check the requirements:
- You use managed group with minimal 2 server per managed group.
- You enable minimal 2 pod for each system.
- Your docker images startup time is fast or less than 2 minutes.
- You already to able the system to do something when AWS send 2 minute termination notice.
- You understand your system SLA and understand your system lifecycle. (the very important one)
- You enable the AWS EKS cluster to have minimal 2 AZ.
If you already meet this requirements, you can start to migrate your system to spot instance. This is example from one of our managed group.

A little tips:
- You can use multiple class ec2 instance as long same spec (in this image is 2 core of vCpu and 8 GB of RAM)
- Separate the server to multiple AZ to make sure more spot availability.
Last question, can we optimize more at the current state ?
My answer is yes but i prefer to have more resources with cost not so much different.
I think thats all for today article. I will share more new article about EKS in later time. See ya 😃
References:
Working on something similar? Fastest over WhatsApp.
Message me on WhatsApp →