Self-hostingPlatforms
k3s
Short version
Section titled "Short version"One machine with 2 CPU cores, 2 GB of memory at least and 4 GB for a busy instance, and 20 GB of free disk, and a domain that points at it. Installing k3s, cert-manager and the chart takes about 15 minutes from start to finish.
What this changes
Section titled "What this changes"- k3s, with its Traefik ingress controller on ports 80 and 443 and its local-path storage. local-path keeps the data in
/var/lib/rancher/k3s/storageon the node, and deleting the claim deletes the data.helm uninstallleaves the claim in place. - cert-manager in the
cert-managernamespace, with a ClusterIssuer calledletsencryptthat uses Let's Encrypt. - Fluxer in the
fluxernamespace, the same as on any cluster, with voice on host ports 7881 on TCP and 7882 on UDP of the node.
Before you start
Section titled "Before you start"Check the requirements. Open ports 80 and 443 on TCP, 7881 on TCP and 7882 on UDP in any firewall in front of the machine. Install Helm.
Install
Section titled "Install"-
Install k3s.
curl -sfL https://get.k3s.io | sh -mkdir -p ~/.kube && sudo cat /etc/rancher/ > ~/k3s/ k3s. yaml .kube/ && chmod 600 ~/config .kube/ config After a few seconds,
kubectl get nodesshows the node asReady. -
Install cert-manager and a Let's Encrypt issuer that uses Traefik for its challenges.
helm install cert-manager oci://quay.io/jetstack/ charts/ cert-manager \ -n cert-manager --create-namespace --set crds.enabled=true --waitissuer.yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuermetadata:name: letsencryptspec:acme:server: https://acme-v02.api.letsencrypt.org/ directory privateKeySecretRef:name: letsencryptsolvers:- http01:ingress:ingressClassName: traefikApply it with
kubectl apply -f issuer.yaml.kubectl get clusterissuerthen showsTrueunder READY for the issuer. -
Give Traefik ten minutes to receive each request, so large uploads on a slow connection finish. Traefik 3 gives each request 60 seconds by default.
traefik-config.yaml apiVersion: helm.cattle.io/ v1 kind: HelmChartConfigmetadata:name: traefiknamespace: kube-systemspec:valuesContent: |-ports:web:transport:respondingTimeouts:readTimeout: 600swebsecure:transport:respondingTimeouts:readTimeout: 600sApply it with
kubectl apply -f traefik-config., and k3s then restarts Traefik with the longer read timeout on both of its ports.yaml -
Install Fluxer.
helm install fluxer oci://ghcr.io/fluxerapp/ charts/ fluxer \ --namespace fluxer --create-namespace \--set domain=chat.example.com \--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt kubectl -n fluxer rollout status statefulset/fluxer --timeout 15mTraefik in k3s needs no extra annotations on the Ingress, and the Traefik config from step 3 gives slow uploads ten minutes to finish.
The rollout ends with
partitioned roll out complete, andkubectl -n fluxer get certificateshows the certificate as ready about a minute later. -
Print the setup token.
kubectl -n fluxer exec fluxer-0 -- fluxerd setup-tokenOpen your domain and paste the token to create the first admin account.
More than one node
Section titled "More than one node"With more than one node, the voice ports open on whichever node runs the pod. Pin the pod to a node with nodeSelector, or use voice.expose=loadBalancer with ServiceLB.