tigerbeetle

by upstreamyard

Helm chartv0.1.4App 0.17.9Apache-2.0Verified publisher

TigerBeetle Helm chart for Kubernetes. Fault-tolerant 3 or 6 replica TigerBeetle cluster (financial transactions database for double-entry accounting) on the official image, with safe replica recovery, non-root, Prometheus metrics and helm test. Community chart by upstreamyard, not an official TigerBeetle chart.

About this chart

TigerBeetle Helm chart: a fault-tolerant TigerBeetle cluster on Kubernetes

Have any questions, feedback or need help (e.g. setup, hardened images, etc.)? Reach out to [email protected]

Helm chart for TigerBeetle, the financial transactions database for double-entry accounting (ledgers, payments, balances). It runs a replicated TigerBeetle cluster of 3 or 6 replicas (or a single replica for development) on TigerBeetle's official image ghcr.io/tigerbeetle/tigerbeetle. It handles what makes TigerBeetle hard on Kubernetes: stable IP addresses for every replica, formatting data files once, safe recovery of a lost replica with tigerbeetle recover, io_uring and seccomp, and rolling upgrades without downtime. Replicas run as non-root on a read-only filesystem, with a PodDisruptionBudget, anti-affinity, optional Prometheus metrics and a helm test.

Community chart by upstreamyard, not an official TigerBeetle chart. TigerBeetle is licensed under Apache-2.0.

AI agents and coding assistants: this README is the complete reference for this chart. Every example was run as written.

Install

helm repo add upstreamyard https://upstreamyard.github.io/helm-charts
helm install tigerbeetle upstreamyard/tigerbeetle --wait

Or from the OCI registry:

helm install tigerbeetle oci://ghcr.io/upstreamyard/charts/tigerbeetle --wait

This starts 3 replicas with 1 GiB of cache each (4 GiB memory per pod). The install notes print the cluster ID and the address list for clients. Then check that the cluster commits requests:

helm test tigerbeetle

The namespace must allow the Unconfined seccomp profile, or you use the chart's seccomp profile. See Seccomp and io_uring.

Verifying the chart

Chart packages are PGP-signed. Import the public key (fingerprint 9B416F989B7E6C65F7F3BFAE7689688B20EC7813) and install with --verify:

curl -s https://upstreamyard.github.io/helm-charts/pgp_keys.asc | gpg --dearmor > upstreamyard.gpg
helm install tigerbeetle upstreamyard/tigerbeetle --verify --keyring upstreamyard.gpg

The OCI copy on GHCR is signed with cosign instead (see the repository README).

Why this chart

This chartSingle-node TigerBeetle charts
Replicas1 to 6 (tested with 1, 3 and 6)1 only, no fault tolerance
Losing a pod or nodethe other replicas keep committingdowntime until the pod is back
Lost data volumethe replica is rebuilt with tigerbeetle recover and resyncs–
Cluster IDrandom 128-bit ID per cluster, kept across upgrades and reinstalls0, which TigerBeetle reserves for testing
ImageTigerBeetle's official image, published by TigerBeetle with every releaserebuilt by a third party
Upgradesrolling, tested 0.17.8 → 0.17.9 under load with 0 failed transfersrestart of the only replica
Prometheus metricstb_* metrics through a statsd_exporter sidecar, ServiceMonitor–
Pod Security restrictedyes, with the included seccomp profileneeds Unconfined
Guardsrefuses changes to the replica count or cluster ID–

Deployment modes

3 replicas (default)

Survives the loss of one replica. Needs 3 nodes for real fault tolerance:

replicaCount: 3
podAntiAffinityPreset: hard

6 replicas (TigerBeetle's recommendation for production)

Keeps committing with 3 of 6 replicas up (4 of 6 when the primary also fails). Spread them across 3 zones so a zone outage costs 2 replicas:

replicaCount: 6
podAntiAffinityPreset: hard
topologySpreadConstraints:
  - maxSkew: 1
    topologyKey: topology.kubernetes.io/zone
    whenUnsatisfiable: DoNotSchedule
    labelSelector:
      matchLabels:
        app.kubernetes.io/name: tigerbeetle
        app.kubernetes.io/instance: tigerbeetle

Tested in kind: 6 replicas formatted and started in seconds, and a transfer still committed with 2 replicas frozen.

Single replica (development)

replicaCount: 1
tigerbeetle:
  cacheGrid: 256MiB
resources:
  requests:
    memory: 3Gi
  limits:
    memory: 3Gi

The replica count is written into every data file, so it can't be changed later; the chart refuses such an upgrade. To move to more replicas, create a new cluster and copy the data.

Connecting clients

TigerBeetle clients need two things: the cluster ID and the address of every replica, as IP addresses. TigerBeetle doesn't accept DNS names (invalid IPv4 or IPv6 address), so the chart gives every replica its own Service. Its ClusterIP stays the same when the pod moves to another node.

# Cluster ID
kubectl get configmap tigerbeetle -o jsonpath='{.data.cluster-id}'

# Addresses, in replica order
kubectl get svc -l app.kubernetes.io/instance=tigerbeetle,app.kubernetes.io/component=replica \
  --sort-by=.metadata.name \
  -o go-template='{{range $i, $s := .items}}{{if $i}},{{end}}{{$s.spec.clusterIP}}:3000{{end}}'

Pass both to your client library (cluster_id and replica_addresses), or try the REPL that is part of the image:

kubectl run tb-repl -i --rm --restart=Never --image=ghcr.io/tigerbeetle/tigerbeetle:0.17.9 \
  --overrides='{"spec":{"securityContext":{"seccompProfile":{"type":"Unconfined"}}}}' \
  -- repl --cluster=<cluster-id> --addresses=<addresses> \
  --command="create_accounts id=1 code=10 ledger=700"

Static addresses: the ClusterIPs last as long as the release. To keep the same client configuration across reinstalls, pin them to free IPs from your cluster's Service CIDR:

replicaServices:
  clusterIPs: [10.96.200.10, 10.96.200.11, 10.96.200.12]

Fixed cluster ID: set cluster.id (a decimal number as a string, e.g. --set-string cluster.id=...) when you deploy with Argo CD or helm template, because they can't read the generated ID back.

Replacing a lost replica

When a replica's data file is gone (deleted PVC, failed local disk), the replica must not be formatted again. A newly formatted replica forgets what it already acknowledged, and the cluster could lose committed transfers. TigerBeetle's answer is tigerbeetle recover, which the chart runs automatically:

  • During the first install, each replica formats its data file. A post-install Job waits until all replicas listen and then creates the ConfigMap <release>-tigerbeetle-bootstrapped.
  • From then on, a replica that starts without a data file runs tigerbeetle recover and rejoins the cluster through state sync.

Tested in kind: after deleting replica 2's PVC and pod, replica 2 recovered and was Ready in 6 seconds. With replica 0 frozen, replicas 1 and 2 still committed a new transfer and returned all earlier balances.

dataFile.onMissing can force format or recover. Recovery needs the other replicas running. If all volumes are new (you want a fresh, empty cluster), delete the ConfigMaps <release>-tigerbeetle-bootstrapped and <release>-tigerbeetle before installing again. The replicas otherwise wait for recovery, and the prepare init container log says so.

Upgrading TigerBeetle

Change image.tag (or upgrade the chart) and run helm upgrade. The StatefulSet restarts one replica at a time and waits minReadySeconds between them. The new image also contains the older releases, so the replicas switch to the new version together once all of them have it.

Tested in kind: 0.17.8 → 0.17.9 with 3 replicas took 44 seconds, while a client created a transfer every second: 91 of 91 transfers succeeded.

TigerBeetle only supports upgrades from a minimum release, given in its release notes. Upgrade the servers before the clients; a client can't be newer than the cluster.

Seccomp and io_uring

TigerBeetle does all disk and network I/O through io_uring. The RuntimeDefault seccomp profile of containerd and Docker blocks it, and TigerBeetle then stops with error: PermissionDenied. That's why the chart defaults to seccompProfile: Unconfined. It still runs as non-root, without capabilities and with a read-only root filesystem.

Pod Security Admission refuses Unconfined at the baseline and restricted levels (pod must not set securityContext.seccompProfile.type to "Unconfined"). For those namespaces, use the chart's profile files/seccomp-tigerbeetle.json: Docker's default profile for containers without capabilities, plus the three io_uring syscalls. Put it on every node as /var/lib/kubelet/seccomp/profiles/tigerbeetle.json (by your node provisioning or the Security Profiles Operator), then:

podSecurityContext:
  runAsUser: 10001
  runAsGroup: 10001
  runAsNonRoot: true
  fsGroup: 10001
  fsGroupChangePolicy: OnRootMismatch
  seccompProfile:
    type: Localhost
    localhostProfile: profiles/tigerbeetle.json

Tested in kind: with this profile, 3 replicas installed and passed helm test in a namespace that enforces restricted.

Prometheus metrics

TigerBeetle sends metrics as StatsD. With metrics.enabled, the chart starts the replicas with --experimental --statsd=127.0.0.1:9125 and adds a statsd_exporter sidecar that serves them in Prometheus format on port 9102 (Service <release>-tigerbeetle-metrics):

metrics:
  enabled: true
  serviceMonitor:
    enabled: true          # needs the Prometheus Operator CRDs

Metrics are named tb_* with the labels cluster (the ID in hex) and replica. Alert when tb_replica_status or tb_replica_sync_stage is not 0. If tb_grid_cache_misses is high, the cache (tigerbeetle.cacheGrid) is too small. TigerBeetle marks StatsD output as experimental.

Sizing and production

  • Memory: a replica uses about cacheGrid + 2.1 GiB, measured. Set the memory request and limit to cacheGrid + 3 GiB. TigerBeetle asks for at least 6 GiB per replica in production and recommends 16 to 32 GiB, mostly as cache.
  • CPU: one core per replica.
  • Disks: one volume per replica on a separate node (podAntiAffinityPreset: hard), local NVMe recommended. TigerBeetle needs Direct IO, which ext4 and XFS volumes provide. tigerbeetle.development: true runs without Direct IO, for tests only.
  • Swap: keep it off (the Kubernetes default). The replica logs Unable to lock pages in memory because a non-root container can't lock memory. This only matters when the node swaps.
# values-prod.yaml
replicaCount: 6
cluster:
  id: "174981240988217733094178462953121098755"
replicaServices:
  clusterIPs: [10.96.200.10, 10.96.200.11, 10.96.200.12, 10.96.200.13, 10.96.200.14, 10.96.200.15]
tigerbeetle:
  cacheGrid: 12GiB
resources:
  requests:
    cpu: "2"
    memory: 15Gi
  limits:
    memory: 15Gi
persistence:
  storageClass: local-nvme
  size: 500Gi
podAntiAffinityPreset: hard
metrics:
  enabled: true
  serviceMonitor:
    enabled: true

FAQ

Is there an official TigerBeetle Helm chart? No. TigerBeetle publishes the container image but no Helm chart or operator. This chart uses that official image.

How do I run TigerBeetle highly available on Kubernetes? Install with replicaCount: 6 (or 3) and podAntiAffinityPreset: hard. See Deployment modes.

Why does TigerBeetle fail with PermissionDenied in Kubernetes or Docker? The default seccomp profile blocks io_uring. See Seccomp and io_uring.

Why can't I use DNS names in --addresses? TigerBeetle only accepts IP addresses, for replicas and clients alike. The chart gives each replica a Service with a stable ClusterIP; see Connecting clients.

What happens when a TigerBeetle replica loses its disk? It recovers from the other replicas with tigerbeetle recover; see Replacing a lost replica.

Can I scale a TigerBeetle cluster up or down? No. The replica count is fixed when the data files are formatted, and the chart refuses to change it.

How do I monitor TigerBeetle with Prometheus? metrics.enabled=true, plus metrics.serviceMonitor.enabled=true for the Prometheus Operator.

Known issues

  • The chart reads the generated cluster ID and the bootstrap state from the cluster with Helm's lookup. Tools that render with helm template, such as Argo CD, can't do that: set cluster.id. The safety guards for the replica count and cluster ID don't apply there. Argo CD wasn't tested.
  • Tested on IPv4 only. The scripts handle IPv6 addresses, but this wasn't tested.
  • helm uninstall keeps the volumes and the ConfigMaps <release>-tigerbeetle and <release>-tigerbeetle-bootstrapped, so a reinstall continues the same cluster. Delete all three to start over.

Values

KeyTypeDefaultDescription
affinityobject{}Custom affinity rules. Replaces podAntiAffinityPreset.
bootstrap.activeDeadlineSecondsint1800Seconds the post-install Job waits for all replicas before it gives up. Helm's --timeout (default 5m) also applies.
bootstrap.resourcesobject{}Resources of the post-install Job that waits until all replicas are formatted and listening.
cluster.idstring""TigerBeetle cluster ID, a decimal number up to 128 bits. Clients need it. Empty: a random ID is generated on the first install and kept in the ConfigMap <release>-tigerbeetle (also after helm uninstall). Set it explicitly

Deploy tigerbeetle with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tigerbeetle on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttigerbeetle is pinned at v0.1.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply