Skip to content
Setup a K3S cluster with one master and two workers on 3 VMs on AWS Lightsail - STATUS: WIP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Setup a K3S cluster with one master and two workers on 3 VMs

My recommendation is to follow this Readme to set up a 3 VMs highly available Kube (using k3s with the default setup) cluster on AWS Lightsail using three VMs and a load balancer

For kube CNI, in this project we follow the k3s recommendation to use the default Traefik which exposes one port for our ingress service (nginx)

As stated, on that port there's Nginx with a reverse proxy to be easily able to access the deployed services

Prerequisite: Setup an AWS cluster where we configure/deploy K3S

K3S uses / provisioner/infra to setup the AWS Lightsail VMs

Provisioning of the infrastructure

git clone
git checkout k3s
cd infra

Run Provisioning

source && rake CMD=provision

K3S Deploy

Run rake to prepare and deploy

rake will run and check if k3s is already provisioned, and will perform a deployment using the docker-compose.yml for pods definition

you can choose to use the raw verison rake KOMPOSE=y (or rake KOMPOSE=1) which instead of stack deploy will use kompose (which actually also builds and automatically pushes the containers)

The default command used internally is: docker stack deploy --orchestrator=kubernetes

As simple as that!



Your deploy will start!


It is recommended to close port 80 on the workers as k3s can (dynamically) assign it as a port

Use dockerhub (using a private docker registry needs extra setup infos)

Firewall Ports

provisioner/infra will set up those for you, but if you're configuring it from scratch, you can open the following ports:

  • Master: 6443 TCP
  • Workers: 8472 UDP


  • implement close port
  • close port 80
  • write troubleshooting guide


  • TODO: write difference between kompose and stack deploy
  • TODO: write readme about what to check when things go wrong

Notes / Tags

#kubernetes, #k3s, #ruby, #ops, #devops, #compose, #docker, #kompose


  • @makevoid
You can’t perform that action at this time.