Brume · Docs
Installation

Low-cost HA

Absorb the loss of one server without losing the service: a K3s cluster on three dedicated machines, servers to order, hardening, bootstrap, Traefik, upstream routing, budget.

In brief

Three dedicated servers in three datacenters, a K3s cluster with 2/3 quorum, Traefik on ports 80/443 of every node: losing one server leaves the service standing, for the price of three machines. This is how Brume Cloud runs, and a deliberate hosting choice; the Helm chart installs on any Kubernetes.

A supervised deployment

Plan for an operator comfortable with Kubernetes and Linux administration. Upstream routing and access control are given as an example: any equivalent works.

The goal: absorb the loss of one server

Three machines, none indispensable. One server goes down, and the service carries on the others:

What goes downWhat takes over
A control-plane nodeetcd keeps quorum at 2 members out of 3; the cluster keeps deciding
Entry routingTraefik runs on every node; the upstream load balancer stops sending traffic to the lost node
The PostgreSQL primaryCloudNativePG promotes the replica of the second instance
An application replicaAnti-affinity placed the second copy of the frontend, backend, and relay on another node

Failover time is dominated by upstream detection. With the Cloudflare monitor of the example (30 s interval, 2 retries, 5 s timeout), HTTP traffic reroutes in tens of seconds, up to a minute and a half in the worst case; PostgreSQL promotion takes seconds. A shorter monitor interval shortens the failover.

A figure to measure

These orders of magnitude are derived from the configuration; they do not replace a measurement. Cut a node on your own setup, time how long curl https://api.<your-domain>/health takes to come back, and record the observed value in your operations file.

Who this path is for

This is the setup that carries Brume Cloud: the redundancy of an online service for the price of three machines. Inside an organization, high availability usually goes through the Kubernetes cluster already in place or through the managed-service provider, and the Helm chart is then enough. In that case this path serves as inspiration: the choices it documents (2/3 quorum, Traefik on every node, two PostgreSQL instances, anti-affinity) transpose onto any cluster.

The OVHcloud RISE-S carries all three roles at once (database, application, control plane) with memory headroom, on DDR5 ECC.

ItemSpec
CPUAMD Ryzen 7 9700X, 8 c / 16 t, 3.8 GHz (5.5 GHz boost)
CPU score37,308
RAM64 GB DDR5 ECC On-Die
Storage2 × 512 GB SSD NVMe, Soft RAID
Bandwidth1 Gbit/s public
Price64.99 € excl. tax/month (77.99 € incl. tax), 64.99 € setup fee
OS to installUbuntu 24.04 LTS, SSH key added during installation

Price and configuration observed at the time of writing: check the OVHcloud catalog before ordering. Take the three machines in three distinct European datacenters (for example Gravelines, Strasbourg, Roubaix) to survive the loss of one site.

Cluster topology

The K3s control plane keeps quorum at 2 nodes out of 3 (embedded etcd).

TopologyNodesControl planeApplication load
3 dedicated (recommended)3 dedicated servers3 members (quorum 2/3)The 3 dedicated servers
2 workers + arbiter2 dedicated servers + 1 VPS3 members (quorum 2/3)The 2 dedicated servers (the VPS carries a NoSchedule taint)

The two-worker variant cuts the bill by a third: a Starter-range VPS, in a different datacenter from the two dedicated servers, joins the etcd vote without receiving application pods (taint k3s-controlplane=true:NoSchedule). It does concentrate the whole load on two machines.

Budget

Item3 dedicated2 dedicated + arbiter
RISE-S dedicated servers194.97 €129.98 €
Arbiter VPSnone~3 to 5 €
Upstream access control and routing~0.10 $~0.10 $
Object Storage (PostgreSQL backups)~1 to 2 €~1 to 2 €
Monthly total~196 to 197 € excl. tax~134 to 137 € excl. tax

Setup fees come on top, once: 64.99 € per dedicated server. The estimate covers infrastructure. Model calls go through BYOK: you keep your direct contract with the provider, outside this budget.

Build the cluster

Prepare and secure the servers

Each server follows the server-setup.md procedure: SSH hardening (root denied, password disabled, MaxAuthTries 3), fail2ban, automatic security updates, kernel hardening (sysctl), auditd (sudo, SSH/passwd/sudoers/UFW/K3s), logs kept for 90 days, sudo logging, legal banner. The detail is in Secure your instance.

The UFW firewall opens the ports the cluster needs:

PortProtocolUse
22tcpSSH
80 / 443tcpTraefik (HTTP / HTTPS)
6443tcpK3s API server
8472udpFlannel VXLAN
10250tcpkubelet metrics
2379 / 2380tcpetcd (clients / peers)

These ports close down to the peer IPs only in the last step.

Bootstrap the K3s cluster

The following flags are mandatory on every node. Omitting --disable=servicelb breaks the Traefik DaemonSet hostNetwork model of the next step.

FlagReason
--disable=servicelbServiceLB is replaced by Traefik in hostNetwork
--flannel-external-ipinter-datacenter Flannel routing
--node-external-ip=<IP>the node's public IP (internal IP is not routable between DCs)

Initialize the first node (srv1):

ssh ubuntu@<srv1-ip> << 'EOF'
curl -sfL https://get.k3s.io | sh -s - server \
  --cluster-init \
  --tls-san <srv1-ip> \
  --tls-san <srv2-ip> \
  --disable=servicelb \
  --flannel-external-ip \
  --node-external-ip=<srv1-ip>
EOF

Retrieve the join token:

K3S_TOKEN=$(ssh ubuntu@<srv1-ip> "sudo cat /var/lib/rancher/k3s/server/node-token")

Join the next nodes (srv2, then srv3):

ssh ubuntu@<srv2-ip> << EOF
curl -sfL https://get.k3s.io | K3S_URL=https://<srv1-ip>:6443 \
  K3S_TOKEN=$K3S_TOKEN sh -s - server \
  --disable=servicelb \
  --flannel-external-ip \
  --node-external-ip=<srv2-ip>
EOF

In the two-worker variant, the arbiter VPS joins as control plane only, with a taint: no workload is scheduled on it.

ssh ubuntu@<vps-ip> << EOF
curl -sfL https://get.k3s.io | K3S_URL=https://<srv1-ip>:6443 \
  K3S_TOKEN=$K3S_TOKEN sh -s - server \
  --node-taint k3s-controlplane=true:NoSchedule \
  --disable=servicelb \
  --flannel-external-ip \
  --node-external-ip=<vps-ip>
EOF

Retrieve the kubeconfig on the operator workstation:

ssh ubuntu@<srv1-ip> "sudo cat /etc/rancher/k3s/k3s.yaml" | \
  sed "s/127.0.0.1/<srv1-ip>/g" > /tmp/<instance>-kubeconfig
export KUBECONFIG=/tmp/<instance>-kubeconfig
kubectl get nodes   # expected: 3 nodes, all Ready

Configure Traefik as a hostNetwork DaemonSet

K3s ships Traefik as a ServiceLB Deployment by default. With ServiceLB disabled, Traefik runs as a hostNetwork DaemonSet on ports 80/443 of every node — otherwise losing one node partially breaks routing. Through a HelmChartConfig:

kubectl apply -f - <<EOF
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |
    hostNetwork: true
    deployment:
      kind: DaemonSet
    updateStrategy:
      rollingUpdate:
        maxUnavailable: 1
        maxSurge: 0
    ports:
      traefik:
        port: 9080
      web:
        port: 80
      websecure:
        port: 443
    securityContext:
      capabilities:
        add: [NET_BIND_SERVICE]
        drop: [ALL]
      runAsUser: 0
      runAsGroup: 0
EOF

CoreDNS at two replicas, for internal resolution resilience:

kubectl scale deployment coredns -n kube-system --replicas=2

Expose the cluster behind your upstream routing

Path not imposed by the product: any equivalent upstream routing/TLS works.

Example: Cloudflare Tunnel. Traffic enters through this tunnel; without cloudflared, the node stays invisible to the load balancer. On every node:

curl -L --output /usr/local/bin/cloudflared \
  https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x /usr/local/bin/cloudflared

cat > /etc/systemd/system/cloudflared.service << EOF
[Unit]
Description=cloudflared
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/cloudflared --no-autoupdate tunnel run --token <tunnel-token>
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload && systemctl enable cloudflared && systemctl start cloudflared

Install Brume

The cluster is ready: continue with the Helm chart, which installs the operators, creates the secrets, and deploys the release. On this cluster, pg.storageClass is local-path (the node's local disk, provided by K3s).

Then come back here for the last two steps.

Configure DNS and upstream load balancing

Example: Cloudflare DNS and load balancing. Create proxied A records (orange cloud) to each node, SSL mode Full. Every domain must be proxied: a DNS-only domain exposes the Traefik certificate and causes an SSL error.

Create the load balancing pool with a health monitor on /api/health (Cloudflare credentials read through 1Password op from the <your-vault> vault):

CF_ACCOUNT=$(op read "op://<your-vault>/Cloudflare/account-id")
CF_TOKEN=$(op read "op://<your-vault>/Cloudflare/api-token")

curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT/load_balancers/pools" \
  -H "Authorization: Bearer $CF_TOKEN" -H "Content-Type: application/json" \
  --data '{
    "name": "<instance>-pool",
    "origins": [
      {"name": "srv1", "address": "<srv1-ip>", "enabled": true},
      {"name": "srv2", "address": "<srv2-ip>", "enabled": true},
      {"name": "srv3", "address": "<srv3-ip>", "enabled": true}
    ],
    "monitor": {
      "type": "http",
      "http_config": {"method": "GET", "path": "/api/health"},
      "timeout": 5, "retries": 2, "interval": 30
    }
  }'

Restrict K3s ports by source IP

With every node known, lock the K3s ports to the cluster peers only. Run on each server:

for HOST in <srv1-ip> <srv2-ip> <srv3-ip>; do
  ssh ubuntu@$HOST << EOF
    sudo ufw delete allow 6443/tcp
    sudo ufw delete allow 8472/udp
    sudo ufw delete allow 10250/tcp
    sudo ufw delete allow 2379/tcp
    sudo ufw delete allow 2380/tcp
    for PEER_IP in <srv1-ip> <srv2-ip> <srv3-ip>; do
      sudo ufw allow from \$PEER_IP to any port 6443 proto tcp
      sudo ufw allow from \$PEER_IP to any port 8472 proto udp
      sudo ufw allow from \$PEER_IP to any port 10250 proto tcp
      sudo ufw allow from \$PEER_IP to any port 2379 proto tcp
      sudo ufw allow from \$PEER_IP to any port 2380 proto tcp
    done
EOF
done

Path checklist

  • Three servers ordered in three distinct datacenters, Ubuntu 24.04 LTS.
  • Hardening and UFW applied on each server.
  • kubectl get nodes: three Ready nodes.
  • Traefik present on every node carrying load (kubectl get pods -n kube-system -l app.kubernetes.io/name=traefik -o wide).
  • If you follow the Cloudflare Tunnel example: cloudflared active on each node (systemctl status cloudflared).
  • Brume release deployed and health check OK (see the Helm chart).
  • K3s ports restricted by IP on each server.

On this page