1.Architecture
1.1Characteristics
| Characteristic | |
|---|---|
| Symmetric servers | Every 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 tolerance | etcd 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 operation | k3s, container images and the SELinux policy are delivered in the Odin release package. No internet access at any time. |
| Registry-free image distribution | Images 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 storage | Data on local SSD or NVMe on each server. Customer S3-compatible storage is optional and recommended for files and backups. |
| Non-disruptive change | An 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
Server VLAN · same site · under 5 ms round trip
Server 1 k3s server
celery-worker · celery-ingest · celery-beat
Redis + Sentinel
MinIO (distributed) · GoTrue
flannel 8472/udp · Spegel 5001 · CoreDNS
backup destination
Server 2 k3s server
celery-worker · celery-ingest · celery-beat
Redis + Sentinel
MinIO (distributed) · GoTrue
flannel 8472/udp · Spegel 5001 · CoreDNS
backup destination
Server 3 k3s server
celery-worker · celery-ingest · celery-beat
Redis + Sentinel
MinIO (distributed) · GoTrue
flannel 8472/udp · Spegel 5001 · CoreDNS
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
1.3Components
| Layer | Component | Placement | Availability |
|---|---|---|---|
| Entry | Customer load balancer, or kube-vip | In front of the servers | Distributes to healthy servers, or floats the address |
| Ingress | Traefik | Every server, TCP 443 | Serves on the node it runs on |
| Application | web | Replicas spread across servers | Rolling update; tolerates one server loss |
| Application | API (fastapi-backend) | One pod per node, pinned | Rolling update with maxUnavailable: 1 |
| Application | celery-worker | One replica per node | Updated one replica at a time |
| Application | celery-ingest | One replica per node | Updated one replica at a time |
| Application | celery-beat | Two or more | Leader-elected through a PostgreSQL lease; one active scheduler |
| Application | odin-ml | One replica per node | Inference continues on the remaining replicas |
| Data | PostgreSQL (CloudNativePG) | Three instances: one primary, two standbys, and a connection pooler | Streaming replication; automatic failover |
| Data | Redis with Sentinel | Three replicas with three Sentinels behind two HAProxy pods | Sentinel promotes a replica on failure |
| Data | MinIO | Three pods, one per node, erasure coded (EC:1) | Objects available with one server down |
| Data | GoTrue (authentication) | Two replicas | Stateless; state held in PostgreSQL |
| Platform | k3s and etcd | All servers | Quorum 2 of 3 |
| Platform | flannel (VXLAN) | All servers | Pod network across servers |
| Platform | CoreDNS | Cluster DNS | Protected by a disruption budget |
| Platform | Spegel (image sharing) | All servers, TCP 5001 | Images available from any server |
2.High availability
| Event | Service impact | Recovery |
|---|---|---|
| A pod crashes | None; other replicas serve | The pod restarts, under a minute |
| One server powered off | The 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 dies | Writes pause while a standby is promoted | Automatic promotion by CloudNativePG |
| Redis master dies | The queue is unavailable briefly | Sentinel 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 dies | A scheduled run can be missed in the gap | The lease row expires (TTL 30 s, renewed every 10) and the other copy takes over within about 45 seconds |
| A rolling upgrade | None on the data services; one node at a time | upgrade --ha; the release is left in place for an operator if the rollout fails |
| Loss of two of three servers | Service stops: the etcd quorum is lost | Cluster state is restored on the remaining server; replacement servers are joined |
| Loss of the site | Service stops | Rebuild on new servers from a backup set (section 6) |
3.Data flows
| Flow | Path |
|---|---|
| User request | Browser → 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 download | Browser → files name → cluster address TCP 443 → Traefik → MinIO, erasure coded across the servers |
| Document processing | API → Redis queue → celery-ingest → odin-ml inference → results in PostgreSQL and MinIO |
| Database replication | PostgreSQL primary → two standbys, streaming replication across the server VLAN |
| Cluster control | Servers → cluster address TCP 6443; etcd replication between servers on TCP 2379-2380 |
| Backup | The install copies each set to the configured destination, off the machine it protects |
| Image sharing | The 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
upgrade --ha hands the k3s move to the system-upgrade-controllerinstall.sh status exits 0 when healthyProtection — scheduled and off the machine
--backup-schedule hourlys3://Recovery — from a verified set
restore.sh --from <set> into the running installremove-node and join a replacement| Change | How | Service impact | Data and configuration |
|---|---|---|---|
| Release upgrade | sudo ./install.sh upgrade --ha from the new bundle, on one server | Nodes move one at a time | Preserved; a backup is taken first |
| Configuration change | Run install.sh with the flag, for example --domain or --tls-cert | None | Preserved; the cluster's settings Secret is updated |
| More replicas | sudo ./install.sh scale <name>=<count> | None | Preserved |
| Remove a node | sudo ./install.sh remove-node on another server | Drains within the disruption budgets | Preserved |
| Certificate renewal | Run install.sh with the new --tls-cert and --tls-key | None | Preserved |
| Scheduled backups | Timers installed by the installer | None | The backups themselves |
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.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
| Element | Content |
|---|---|
| Database | An online dump of the Odin database from the primary, including roles |
| Files | A mirror of every MinIO bucket |
| Secrets escrow | The generated secrets and the installation settings, in the set's escrow/ |
| Cluster state | The k3s datastore, carried by the daily odin-backup-datastore timer with the etcd snapshot |
| Completion marker | Written last; an incomplete set is never used for a restore |
5.2Schedule
| Job | When | Action |
|---|---|---|
odin-backup.timer | Daily 00:00, or hourly with --backup-schedule hourly | Database, files and secrets |
odin-backup-datastore.timer | Daily | A backup that also carries the k3s datastore and the etcd snapshot |
| etcd snapshots | Every 6 hours, 28 kept on each server | k3s'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
| Objective | Value |
|---|---|
| RPO | 24 hours with the daily schedule; 1 hour with the hourly schedule |
| RTO, data restore | Minutes for the database and files, increasing with data volume |
| RTO, site rebuild | Hours: new servers, a fresh install of the same release, then the datastore and data restore |
| Retention | Governed by the destination; the installer does not prune the destination for you |
| Copies | Off the machine each set protects |
6.Recovery
| You lost | You need | Do |
|---|---|---|
| A single machine | The off-box backup sets, and the same release's tarball | Rebuild from the set's escrowed secrets: restore.sh --extract-secrets, then install.sh, then restore.sh --from, then install.sh status |
| One HA node | The rest of the cluster healthy | Power it back on, or remove-node and join a replacement |
| Two of three servers, permanently | An etcd snapshot, the server token, the same release | Restore the datastore on the remaining server, then rejoin |
| The whole site | The off-box etcd snapshot, the backup set, the server token | New 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
| Area | Control |
|---|---|
| Exposure | TCP 443 to user networks only; TCP 6443 restricted to the servers and the load balancer; internal ports confined to the server VLAN |
| Transport encryption | TLS with the customer certificate, terminated on the Odin servers; the Kubernetes API and etcd use mutual TLS |
| Internet | Not required; may be denied in both directions |
| Operating system | RHEL: SELinux Enforcing, firewalld enabled. Ubuntu: AppArmor and ufw enabled |
| Secrets | Generated at installation; held in the cluster and in the backups' escrow; the configuration directory is mode 0700 |
| Software integrity | Release packages carry a SHA-256 checksum and a signature; verify both before extracting (ODIN-K3S-03 section 2) |
| Administration | SSH key authentication through the customer jump host; elevation through sudo; direct root SSH login disabled |
| Join tokens | The 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 |