AWS EKS service provides the Kubernetes control plane. Price for EKS Service is $0.20 per hour / cluster.
Three clusters with four worker nodes.
-
EKS Service
- ((0.20 * 24 * 365)/12) = $146/month per cluseter
- 3 clusters = $438/month
-
Kubernetes Node costs
- On-demand Cost
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- ((0.192 *24 *365)/12) = $140.16/mo per node
- Total = $560.64 4 nodes
- Clusters x 3 = $560.64 x3 = $1681.92
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- Spot Instances (Example uses us-west-2 spot instance prices)
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- ((0.068 * 24 * 365)/12 = $49.64/mo
- Total = $198.56 4 nodes
- Clusters x 3 = $198.56 x3 = $595.68
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- On-demand Cost
The cost of EC2 is reflected in the Node costs. The control plane distributed across an odd number of node instances(odd number for quorum).
- Kubernetes Node costs
- On-demand Cost
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- ((0.192 *24 *365)/12) = $140.16/mo per node
- Total = $560.64 4 nodes
- Clusters x 3 = $560.64 x3 = $1681.92
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- Spot Instances (Example uses us-west-2 spot instance prices)
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- ((0.068 * 24 * 365)/12 = $49.64/mo
- Total = $198.56 4 nodes
- Clusters x 3 = $198.56 x3 = $595.68
- m5.xlarge 4 cpu 16 GiB x4 = 16 cpu 64 GB
- On-demand Cost
The main difference in cost is the set costs of the EKS cluster. In our use case above we have three clusters which is an additional $438/month.
- EKS Use Case Summary
- On-demand: 3 cluster = $438 + $1681.92 = $2119.92 ($706.64/cluster)
- Spot: 3 clusters = $438 + $595.68 = $1033.68 ($344.56/cluster)
- EC2
- On-demand: 3 clusters = $1681.92 ($560.64/cluster)
- Spot: 3 clusters = $595.68 ($198.56/cluster)
The initial cluster setup through Rancher can be accomplished quickly. Additional time for cluster setup is dependent on what cluster operation is needed. EC2 requires the setup of a node template. The template consists of instance type, Spot/On-demand, IAM role that has the appropriate policies. The AWS Load balancer needs to be setup with target group pointing to appropriate cluster node instances.
Spot instances require nodes have the ability to terminate without losing stateful set storage. Create external EC2 EBS volumes which is a persistant storage volume. This will be important if DB stateful storage is need vs AWS RDS Service. The IAM role should include a policy that grants nodes the ability to attach/detach external volumes.
Great write up. One call out:
In the EC2 case, wouldn't this mean there are less resources for the worker nodes/pods if you do not have dedicated control planes? In the EKS instance, the control plane is offloaded to AWS's infrastructure and not your nodes/pools. This means there are no resources used in the cluster pool for control plane, and you do not have to worry about worker nodes going down impacting any control plane services.
I'm only calling this out because I have a standalone Kubernetes cluster on EC2 and have seen some stability issues when I have run the control plane on worker nodes, and have since moved to dedicated control plane nodes, increasing my cost. I'm now looking at EKS to potentially compensate for that cost and stability.