Self-hosting is by agreement. The container images (
ghcr.io/trustivan/*)
and the source repository are private: they are provided to customers who run
TRUSTIVAN on their own infrastructure. To evaluate TRUSTIVAN, use the hosted
service from the quickstart, or contact
us about self-hosting.infra/k8s: a Kustomize base that
describes what the product needs from any cluster, and one short overlay per
environment. Kustomize rather than Helm, so each environment is a readable
patch over a base that is itself valid YAML.
What the base contains
The base sets no namespace, so never apply it directly; always go through an
overlay.
Components
Overlays add these to the base:
The dashboard image must be built with
NHI_WEB_URL=http://trustowl-nhi-web:3100
for /nhi to reach the console.
Choose an overlay
Production deliberately has no in-cluster database:
make k8s-validate fails
if a StatefulSet appears in it. The hetzner overlay is the one exception,
because Hetzner Cloud has no managed PostgreSQL, and validation fails it if any
of its databases is left out of the backup. A fourth overlay, local, is demo on your own
machine; see Try it locally.
Deploy
1
Create the Secret
Create the Secret from your secret manager, following the keys in
base/secret.example.yaml. External Secrets Operator, Vault or a cloud CSI
driver all work, because the application reads plain environment variables.
With NHI Security included, also create trustowl-nhi-secrets: its three
database role passwords and a random CREDENTIAL_ENCRYPTION_KEY. Optional
keys such as ANTHROPIC_API_KEY (Ask AI) and mail credentials are listed in
the example; leaving one out turns that feature off.2
Validate and preview
Terminal
3
Deploy with the migration gated
Terminal
kubectl apply -k for a first deployment. It starts the
migration Job and the Deployments at the same time, so a failed migration
shows up as pods crash-looping against a schema they do not expect. The make
targets run scripts/deploy-k8s.sh, which waits for the migration to finish
before rolling anything out.Production on single-node k3s (Hetzner Cloud)
infra/terraform/providers/hetzner provisions one server (default cpx41, 8
vCPU and 16 GB, amd64 only) with a firewall that opens 80 and 443 and SSH only
from the addresses you list, a private network, a data volume that every
PersistentVolume lands on, and k3s with secrets encrypted at rest. It never
deploys TRUSTIVAN: scripts/deploy-k8s.sh hetzner does that, with the same
migration gate, digest check and typed confirmation as production.
- Backups. The
backupcomponent runs nightly at 02:17 UTC:pg_dumpof both databases and their roles, each read back before upload, encrypted on the way out so the bucket holds only ciphertext, and runs older than 30 days deleted. The encryption password and salt are the backup: keep them in your password manager as well as the cluster Secret. Nothing alerts on a failed run yet;kubectl -n trustivan get jobs -l app.kubernetes.io/component=backuplists the last five. - Restore.
scripts/k8s-restore-db.shrestores one database from a downloaded dump, thenscripts/deploy-k8s.sh hetznerbrings the workloads back. Onto a new cluster, create the same Secrets first: a newTOKEN_ENCRYPTION_KEYorCREDENTIAL_ENCRYPTION_KEYcannot decrypt the stored credentials. - One node. Traefik keeps its certificates on a single volume, so it stays at one replica; an operating-system reboot or a k3s upgrade is a few minutes of downtime. For more than one node, use cert-manager instead.
Which workload gets which secret
No workload receives the whole Secret, andmake k8s-validate fails if that
changes:
The worker handles untrusted images, so it never holds the key that signs
sessions. Key rotation variables reach the API and the worker when present; see
Key rotation.
Try it locally
With Docker installed, one command builds the images, starts a local k3s cluster with k3d, deploys thelocal overlay and runs the
smoke checks: sign-up and sign-in, a scan finished by the worker, the NHI
Security console, and Ask AI refusing cleanly when no key is set.
Terminal
local overlay is demo plus two differences: vulnerability data comes
from the public upstream source, because a workstation has no mirror, and it
includes the monitoring component.
Related
- Deployment topology: the process shapes and what deployment tooling does not exist yet.
- Production Compose: the single-host alternative.
- Dynamic scanning: how the scan engine and its gateway are isolated.
- NHI Security deployment: NHI Security’s own Kubernetes files.