Link

K3S Cluster

Three Dell OptiPlex 7010 uSFF machines are repurposed for the K3S cluster. The DVD drives are replaced with a caddy that holds a 320GB HDD.

Table of contents

  1. Hardware
  2. UniFi Static Host Mapping
  3. Ignition Files
  4. Traefik
  5. Rook - Ceph

Hardware

K3S is a minimal, opinionated Kubernetes distro that doesn’t require a lot of resources.

  server-0 agent-0 agent-1
CPU i5-3470s i5-3470s i5-3470s
RAM 5GB 10GB 12GB
SSD 120GB 120GB 120GB
HDD 320GB 320GB 320GB

This cluster provides no redundancy, but is good enough for a Home Lab.

UniFi Static Host Mapping

On the UniFi Controller:

  1. Create a dedicated VLAN with its own IP range.
  2. Set a static IP address for each cluster node.
  3. Create a host entry for each k3s node, using the static IP set above.

/var/lib/unifi/sites/${SITE_ID}/config.gateway.json:

{
    "system": {
        "static-host-mapping": {
            "host-name": {
                "server-0.stellirin.com": {
                    "alias": [
                        "server-0"
                    ],
                    "inet": [
                        "192.168.111.201"
                    ]
                },
                "agent-0.stellirin.com": {
                    "alias": [
                        "agent-0"
                    ],
                    "inet": [
                        "192.168.111.202"
                    ]
                },
                "agent-1.stellirin.com": {
                    "alias": [
                        "agent-1"
                    ],
                    "inet": [
                        "192.168.111.203"
                    ]
                }
            }
        }
    }
}

Ignition Files

Two ignition files are required, one for K3S servers, and one for K3S agents. The difference is in the K3S service file. Check the K3S install.sh file for the latest requirements.

Traefik

K3S is bundled with the latest traefik v1.x but this is disabled to allow Traefik v2.x to be installed.

Rook - Ceph

Storage for the cluster is provided by Ceph, installed via Rook. The three 320GB HDDs on each node are used to create a redundant and distributed storage provider.