Run a $15/Month K3s Cluster: A Step-by-Step Guide

K3s is a streamlined Kubernetes distribution that boasts effortless installation. As a fully compliant Kubernetes distribution, it leverages an embedded SQLite database as its default datastore, while also supporting external datastores like PostgreSQL, MySQL, and etcd. K3s incorporates a

Streamline your Kubernetes experience with K3s, a lightweight distribution that simplifies installation. As a fully compliant Kubernetes solution, K3s leverages an embedded SQLite database and supports external datastores like PostgreSQL, MySQL, and etcd. This powerful tool automates and manages complex cluster operations, including certificate distribution, with a local storage provider, service load balancer, Helm controller, and Traefik ingress controller. Weighing in at under 100 MB, K3s is remarkably lightweight and easy to use, making it perfect for running highly available, certified Kubernetes distributions designed for production workloads on nanodes. For a more in-depth look at deploying a highly available K3s cluster, check out our step-by-step guide at https://t8tech.com.

To create a highly available K3s cluster with two master nodes, you'll need to utilize an external datastore and an external load balancer to balance TCP traffic on 80/http, 443/https, 3306/mysql, and 6443/Kubernetes API.

K3s Highly Available Architecture

Architecture of a highly available K3s cluster with an external database

Infrastructure Requirements

  • Two Linux nodes, typically virtual machines, are required. You can deploy a K3s cluster on virtually any Linux flavor, although K3s is officially tested on Ubuntu 16.04 and Ubuntu 18.04. These nodes are referred to as master 1 and master 2 in this tutorial, and can be obtained for as little as $5 per month.
  • An external database, such as MySQL, is necessary to store cluster data. For more information, see installing MySQL. In this tutorial, this external database is referred to as mysql.example.com.
  • A load balancer or NodeBalancer is required to direct traffic to the two nodes. Configure it for 80/http, 443/https, 3306/mysql, and 6443/Kubernetes API. For more information, see adding a TCP NodeBalancer. A NodeBalancer costs $10 per month.
  • A DNS record is necessary to map a URL to the NodeBalancer. This is the application server URL, and downstream Kubernetes clusters need to reach it. For more information, see adding a DNS record. In this tutorial, the URL is referred to as k3s.example.com.

Ava Parker

115 Blog posts

Comments