Deploy K3s cluster on AWS with mixed on-demand and spot instances

The main features of this module are:


Related discussions:

Awesome, thanks for sharing!

For Spot I’d recommend you to look into replacing the Cluster Autoscaler with Karpenter.

Curious, why use your own K3S cluster instead of EKS?

EKS is the best solution for containerized workloads. This repo shows the complexity behind a managed infrastructure.
This solution might be useful if you want the full control of your servers whit all the pro and cons.

EKS is really expensive, especially when you only have small workloads or just starting out

Even if you have your own cluster with single master it will be half of that. Also as you scale you would need bigger EC2 for managing the API Server traffic, incase of EKS it will be same even when you scale.

Really? I wanted to set up an EKS for learning k8s but it was like 70 bucks a month. Did it miss something calculating that?

You are right it will be 70 bucks incase you are just going to use for learning. I was talking more from hosting applications on it. With single EC2 master of t3.medium it will be around $18 just for compute and if you add EBS cost it will be approximately half of the eks cost. If you are looking from learning perspective then would be better you setup your own cluster and then you will understand low level components of K8S. With EKS those things will be completely abstracted for you.

As a beginner I’d like to learn all the concepts of deploying to K8s, and it’s handy to have the stuff managed for you. With self managed clusters you quickly run into problems during learning when there is no provider to provide a load balancer and the stuff will never go out of pending status.