Odin on-premises · k3s multi-server

Architecture and Operational Flows

Multi-server high availability on k3s

Document
ODIN-K3S-02
Version
1.0
Classification
Customer-facing
Date
November 2026

1.Architecture

1.1Characteristics

Table 1. Platform characteristics
Characteristic
Symmetric serversEvery server runs the k3s control plane with embedded etcd, the Odin application and the data services. No server has a special role after installation.
Single-server fault toleranceetcd quorum is 2 of 3; PostgreSQL, Redis and file storage are replicated across the servers; the load balancer or the floating address removes an unavailable server.
Air-gapped operationk3s, container images and the SELinux policy are delivered in the Odin release package. No internet access at any time.
Registry-free image distributionImages are imported from the package on the machine you install from; the other nodes fetch from each other through k3s's embedded registry (Spegel).
Local storageData on local SSD or NVMe on each server. Customer S3-compatible storage is optional and recommended for files and backups.
Non-disruptive changeAn HA upgrade moves the nodes one at a time under the system-upgrade-controller; data services are not restarted by it.

1.2Architecture overview

Client and corporate networks

Customer usersBrowser · HTTPS only
Customer internal DNSweb · api · files names
Admin jump hostSSH 22 to every server
Customer load balancerL4 pass-through · SNAT on · health check 5 s

Server VLAN · same site · under 5 ms round trip

Server 1 k3s server

IngressTraefik :443 · customer certificate · web / api / files
Applicationweb · fastapi-backend · odin-ml
celery-worker · celery-ingest · celery-beat
Data servicesPostgreSQL (CloudNativePG) primary
Redis + Sentinel
MinIO (distributed) · GoTrue
KubernetesAPI 6443 · etcd 2379-2380 · kubelet 10250
flannel 8472/udp · Spegel 5001 · CoreDNS
Disks/var/lib/rancher — k3s, images, database, files
backup destination

Server 2 k3s server

IngressTraefik :443 · customer certificate · web / api / files
Applicationweb · fastapi-backend · odin-ml
celery-worker · celery-ingest · celery-beat
Data servicesPostgreSQL standby
Redis + Sentinel
MinIO (distributed) · GoTrue
KubernetesAPI 6443 · etcd 2379-2380 · kubelet 10250
flannel 8472/udp · Spegel 5001 · CoreDNS
Disks/var/lib/rancher — k3s, images, database, files
backup destination

Server 3 k3s server

IngressTraefik :443 · customer certificate · web / api / files
Applicationweb · fastapi-backend · odin-ml
celery-worker · celery-ingest · celery-beat
Data servicesPostgreSQL standby
Redis + Sentinel
MinIO (distributed) · GoTrue
KubernetesAPI 6443 · etcd 2379-2380 · kubelet 10250
flannel 8472/udp · Spegel 5001 · CoreDNS
Disks/var/lib/rancher — k3s, images, database, files
backup destination

Between the servers: etcd Raft quorum 2 of 3 · PostgreSQL streaming replication · MinIO erasure coding · Redis replication with Sentinel · backup sets copied over SSH

Figure 1. Odin on three identical servers behind the customer load balancer, or behind the kube-vip address. Port detail: ODIN-K3S-01 section 4.

1.3Components

Table 2. Components and placement
LayerComponentPlacementAvailability
EntryCustomer load balancer, or kube-vipIn front of the serversDistributes to healthy servers, or floats the address
IngressTraefikEvery server, TCP 443Serves on the node it runs on
ApplicationwebReplicas spread across serversRolling update; tolerates one server loss
ApplicationAPI (fastapi-backend)One pod per node, pinnedRolling update with maxUnavailable: 1
Applicationcelery-workerOne replica per nodeUpdated one replica at a time
Applicationcelery-ingestOne replica per nodeUpdated one replica at a time
Applicationcelery-beatTwo or moreLeader-elected through a PostgreSQL lease; one active scheduler
Applicationodin-mlOne replica per nodeInference continues on the remaining replicas
DataPostgreSQL (CloudNativePG)Three instances: one primary, two standbys, and a connection poolerStreaming replication; automatic failover
DataRedis with SentinelThree replicas with three Sentinels behind two HAProxy podsSentinel promotes a replica on failure
DataMinIOThree pods, one per node, erasure coded (EC:1)Objects available with one server down
DataGoTrue (authentication)Two replicasStateless; state held in PostgreSQL
Platformk3s and etcdAll serversQuorum 2 of 3
Platformflannel (VXLAN)All serversPod network across servers
PlatformCoreDNSCluster DNSProtected by a disruption budget
PlatformSpegel (image sharing)All servers, TCP 5001Images available from any server

2.High availability

Targets, not measurementsThe behaviour below is the design. Kubernetes defaults are named as such because the installer does not tune them. Failover timings for this platform have not yet been measured on customer hardware, and a validation report is issued separately once they are.
Table 3. Failure behaviour
EventService impactRecovery
A pod crashesNone; other replicas serveThe pod restarts, under a minute
One server powered offThe application keeps serving. The cluster address moves in about 15 seconds if the lost server held it. Kubernetes marks the node NotReady after its default grace period (40 to 50 seconds) and evicts pods after 5 minutes; replicas on the other nodes serve meanwhile.Automatic. The server rejoins on return. remove-node and a replacement join if it does not.
PostgreSQL primary diesWrites pause while a standby is promotedAutomatic promotion by CloudNativePG
Redis master diesThe queue is unavailable brieflySentinel promotes a replica and HAProxy follows. Queued jobs survive: AOF is on every copy. min-replicas-to-write makes an isolated old master refuse writes.
celery-beat leader diesA scheduled run can be missed in the gapThe lease row expires (TTL 30 s, renewed every 10) and the other copy takes over within about 45 seconds
A rolling upgradeNone on the data services; one node at a timeupgrade --ha; the release is left in place for an operator if the rollout fails
Loss of two of three serversService stops: the etcd quorum is lostCluster state is restored on the remaining server; replacement servers are joined
Loss of the siteService stopsRebuild on new servers from a backup set (section 6)

3.Data flows

Table 4. Operational data flows
FlowPath
User requestBrowser → customer DNS → cluster address TCP 443 → Traefik on any server (TLS termination) → web or API service → PostgreSQL primary through the connection pooler, Redis
File upload and downloadBrowser → files name → cluster address TCP 443 → Traefik → MinIO, erasure coded across the servers
Document processingAPI → Redis queue → celery-ingest → odin-ml inference → results in PostgreSQL and MinIO
Database replicationPostgreSQL primary → two standbys, streaming replication across the server VLAN
Cluster controlServers → cluster address TCP 6443; etcd replication between servers on TCP 2379-2380
BackupThe install copies each set to the configured destination, off the machine it protects
Image sharingThe machine you install from imports the package's images; other nodes pull them from a peer over TCP 5001

4.Change management

Every change starts with a backup and finishes with a health check. A change starts only on a healthy cluster.

Change — every change starts with a backup

1 · Backup firstDatabase, files and secrets to the configured destination
2 · CheckHost checks and bundle integrity before anything changes
3 · Roll outupgrade --ha hands the k3s move to the system-upgrade-controller
4 · One at a timeNodes drain and rejoin in turn; data services are untouched
5 · Verifyinstall.sh status exits 0 when healthy

Protection — scheduled and off the machine

odin-backup.timerDaily 00:00, or hourly with --backup-schedule hourly
odin-backup-datastore.timerDaily, with the k3s etcd snapshot
etcd snapshotsEvery 6 hours on each server, 28 kept
Off-box copyAnother disk, NFS, or s3://

Recovery — from a verified set

Data problemrestore.sh --from <set> into the running install
One node lostPower it back on, or remove-node and join a replacement
Site lostNew servers, same release, etcd restore, then database and files
Figure 2. Change, protection and recovery flows. Command detail: ODIN-K3S-03 section 7.
Table 5. Change types
ChangeHowService impactData and configuration
Release upgradesudo ./install.sh upgrade --ha from the new bundle, on one serverNodes move one at a timePreserved; a backup is taken first
Configuration changeRun install.sh with the flag, for example --domain or --tls-certNonePreserved; the cluster's settings Secret is updated
More replicassudo ./install.sh scale <name>=<count>NonePreserved
Remove a nodesudo ./install.sh remove-node on another serverDrains within the disruption budgetsPreserved
Certificate renewalRun install.sh with the new --tls-cert and --tls-keyNonePreserved
Scheduled backupsTimers installed by the installerNoneThe backups themselves
Settings live in the clusterA cluster's settings — the domain, the certificate, the S3 and database settings, the backup and monitoring flags — live in kube-system/odin-cluster-settings. Because the cluster's copy is what a server follows, a certificate is renewed by giving --tls-cert and --tls-key again; replacing the file in place and re-running changes nothing. A joining node takes every cluster setting from the cluster, so no such flag goes with --join.
There is no rollback commandGoing back means upgrade --force from the older release's tarball, when it needs the same Kubernetes minor, or a rebuild on the older release from the pre-upgrade backup. Back up before every change.

5.Data protection

5.1Backup content

Table 6. What a backup set holds
ElementContent
DatabaseAn online dump of the Odin database from the primary, including roles
FilesA mirror of every MinIO bucket
Secrets escrowThe generated secrets and the installation settings, in the set's escrow/
Cluster stateThe k3s datastore, carried by the daily odin-backup-datastore timer with the etcd snapshot
Completion markerWritten last; an incomplete set is never used for a restore

5.2Schedule

Table 7. Scheduled jobs
JobWhenAction
odin-backup.timerDaily 00:00, or hourly with --backup-schedule hourlyDatabase, files and secrets
odin-backup-datastore.timerDailyA backup that also carries the k3s datastore and the etcd snapshot
etcd snapshotsEvery 6 hours, 28 kept on each serverk3s's own etcd snapshot schedule

Both timers run on every server. install.sh status reports the age of the newest set and turns unhealthy when the destination has been unreachable for 26 hours daily, or 2 hours hourly.

5.3Recovery objectives

Table 8. Recovery objectives
ObjectiveValue
RPO24 hours with the daily schedule; 1 hour with the hourly schedule
RTO, data restoreMinutes for the database and files, increasing with data volume
RTO, site rebuildHours: new servers, a fresh install of the same release, then the datastore and data restore
RetentionGoverned by the destination; the installer does not prune the destination for you
CopiesOff the machine each set protects
These objectives describe the mechanism, not a measured drillRestore and disaster-recovery paths are implemented and unit-tested, but a full end-to-end drill on customer hardware is scheduled with the acceptance plan, not assumed.

6.Recovery

Table 9. Recovery paths
You lostYou needDo
A single machineThe off-box backup sets, and the same release's tarballRebuild from the set's escrowed secrets: restore.sh --extract-secrets, then install.sh, then restore.sh --from, then install.sh status
One HA nodeThe rest of the cluster healthyPower it back on, or remove-node and join a replacement
Two of three servers, permanentlyAn etcd snapshot, the server token, the same releaseRestore the datastore on the remaining server, then rejoin
The whole siteThe off-box etcd snapshot, the backup set, the server tokenNew hardware, a new install of the same release, the datastore restore, then the database and file restore

6.1Restoring data into a running install

restore.sh is destructive: it overwrites the application database and writes every file in the set over the file of the same name. It asks before it changes anything.

sudo ./restore.sh --from /mnt/odin-backups                  # the newest complete set
sudo ./restore.sh --from /mnt/odin-backups/odin-backup-<timestamp>
sudo ./restore.sh --from s3://bucket/prefix --s3-creds /root/backup-s3.env \
  --s3-endpoint https://s3.corp.example
sudo ./restore.sh --minio=skip --from /mnt/odin-backups     # database only

Before it changes anything, restore.sh checks that this install's generated secrets are the ones the set was taken under, key by key. A key the set does not hold is accepted and reported; a key the set holds that differs, or that is missing in the install, is refused, and the refusal names the keys — never the values.

7.Security controls

Table 10. Security controls
AreaControl
ExposureTCP 443 to user networks only; TCP 6443 restricted to the servers and the load balancer; internal ports confined to the server VLAN
Transport encryptionTLS with the customer certificate, terminated on the Odin servers; the Kubernetes API and etcd use mutual TLS
InternetNot required; may be denied in both directions
Operating systemRHEL: SELinux Enforcing, firewalld enabled. Ubuntu: AppArmor and ufw enabled
SecretsGenerated at installation; held in the cluster and in the backups' escrow; the configuration directory is mode 0700
Software integrityRelease packages carry a SHA-256 checksum and a signature; verify both before extracting (ODIN-K3S-03 section 2)
AdministrationSSH key authentication through the customer jump host; elevation through sudo; direct root SSH login disabled
Join tokensThe server token in the join file also decrypts the cluster's stored Secrets: treat it as a secret and delete the copies on machines that have joined