takt

command module
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

takt

A single-node workload orchestrator.

You describe a workload in a YAML file and submit it. takt stores that as the desired state and reconciles the machine against it continuously. It starts what should be running, replaces what runs an outdated specification, restarts what died, and stops what nothing asked for.

A workload runs either as a Docker container or as a command on the host.

Quick start

On Debian or Ubuntu, install from the apt repository and start the service:

curl -fsSL https://apt.dsb.dev/key.asc | sudo tee /usr/share/keyrings/takt.asc >/dev/null
echo "deb [signed-by=/usr/share/keyrings/takt.asc] https://apt.dsb.dev stable main" \
  | sudo tee /etc/apt/sources.list.d/takt.list
sudo apt-get update && sudo apt-get install takt
sudo usermod -aG docker takt && sudo systemctl enable --now takt

Anywhere else, download an archive for your platform from the releases page, put takt on your PATH, and start the server yourself:

takt serve          # listens on 127.0.0.1:7373

Installing covers both paths in full, including what the docker group grant hands over and where a deployment keeps its data.

Write a manifest and apply it:

cat > example.yaml <<'EOF'
version: v1
name: example
ports:
  - to: 80
container:
  image: nginx:1.27-alpine
EOF

takt workload apply example.yaml
takt workload get example

get reports the host port takt allocated, which is how the workload is reached.

A workload

version: v1
name: example

labels:
  some-key: some-value

ports:
  - name: http
    to: 80

env:
  EXAMPLE: EXAMPLE

volumes:
  - name: example-data
    to: /var/lib/example

restart:
  policy: always

health:
  http: /healthz

container:
  image: nginx:1.27-alpine

A workload names exactly one runtime block. container: runs an image and exec: runs a command on the host. Everything else applies to either. resources: applies to either too, though the exec runtime needs the host to delegate a cgroup subtree and refuses the limits when it does not. logs: caps what a workload's output may grow to, on either runtime.

A volumes entry names a volume, a secret, a variable, a token or a host path. A volume is storage. A secret, a variable or a token is a file holding the value takt stores or mints under that name. A host path is a file or directory on the host that takt does not manage, and the server has to allow it.

A volume is created before the workload that mounts it and outlives that workload, so deleting a workload never destroys what it stored. Its manifest is a name and nothing else:

version: v1
name: example-data
takt volume apply volume.yaml
takt workload apply example.yaml

An env value can read a secret rather than holding one. The value is stored encrypted, and only a workload starting ever sees it:

printf %s hunter2 | takt secret set db-password
env:
  DSN: postgres://app:${secret:db-password}@localhost:5432/app

Changing a secret's value replaces the workloads reading it, so a rotation does not have to be followed by an apply.

A secret that is a file — a certificate, a key — can be mounted instead of read from the environment:

volumes:
  - secret: tls-cert
    to: /etc/tls/cert.pem
    signal: SIGHUP

signal asks takt to rewrite the file and signal the workload when the value changes, rather than replacing the workload. Leave it out to have the workload replaced. Mounting a secret writes it to the host filesystem, which Secrets covers.

A variable is the same thing for a value worth reading back — a hostname, a log level, a feature flag:

takt variable set db-host db.internal
env:
  DSN: postgres://app@${var:db-host}:5432/app

An env value can also read the address of another workload, so one workload can be pointed at another without either of them naming a port takt chose:

version: v1
name: postgres
ports:
  - name: pg
    to: 5432
container:
  image: postgres:17-alpine
env:
  DSN: postgres://app:${secret:db-password}@${workload:postgres:pg}/app

${workload:postgres:pg} becomes the address that port is reached at. If takt ever moves the port, the workloads reading it are redeployed with the new address, so the dependency keeps working without being re-applied.

Documentation

  • Installing — from nothing to a running server, packaged or by hand.
  • Manifest reference — every field a workload can name.
  • Command line — every command and flag.
  • Moving from docker compose — what each piece of a compose file becomes.
  • Scores — bundling manifests, rendered from values and applied as one.
  • Services — reporting the addresses of a labelled set of instances for a load balancer.
  • Volumes — directories that outlive the workloads mounting them.
  • Secrets — storing a value a workload can read and you cannot.
  • Variables — storing a value both you and a workload can read.
  • Configuration — the server's TOML file.
  • Access control — authenticating callers, roles, the policy document and tokens.
  • Operating takt — exposure, the web UI, state on disk, backups, and reading logs.
  • Upgrading — replacing the binary, and what survives it.
  • Design — how reconciliation works and why it is built this way.
  • Reconciliation — the reconciler's mechanics, with diagrams.
  • Troubleshooting — what the common failures look like, and what to do.

CONTRIBUTING.md covers building and testing takt.

Requirements

  • Linux, on the host rather than in a container. The exec: runtime starts processes on the machine takt runs on, and reads /proc to identify them. See Not in a container.
  • Linux 6.2 or later with Landlock enabled, for workloads that name exec:. Every exec workload is confined by the kernel, and a host that cannot do that refuses to run one. See Confinement.
  • A Docker daemon, for workloads that name container:. The exec: runtime needs nothing beyond the host.

Licence

MIT. See LICENSE.md.

Documentation

Overview

Package main provides the entrypoint to the takt binary.

Directories

Path Synopsis
cmd
acl
Package acl provides the CLI endpoint to the "acl" command, which groups the commands that act on the access-control policy.
Package acl provides the CLI endpoint to the "acl" command, which groups the commands that act on the access-control policy.
acl/apply
Package apply provides the CLI endpoint to the "acl apply" command.
Package apply provides the CLI endpoint to the "acl apply" command.
acl/get
Package get provides the CLI endpoint to the "acl get" command.
Package get provides the CLI endpoint to the "acl get" command.
acl/init
Package init provides the CLI endpoint to the "acl init" command.
Package init provides the CLI endpoint to the "acl init" command.
admin
Package admin provides the CLI endpoint to the "admin" command, which groups the commands that act on the node itself.
Package admin provides the CLI endpoint to the "admin" command, which groups the commands that act on the node itself.
admin/backup
Package backup provides the CLI endpoint to the "admin backup" command.
Package backup provides the CLI endpoint to the "admin backup" command.
admin/health
Package health provides the CLI endpoint to the "admin health" command.
Package health provides the CLI endpoint to the "admin health" command.
admin/rekey
Package rekey provides the CLI endpoint to the "admin rekey" command.
Package rekey provides the CLI endpoint to the "admin rekey" command.
admin/restore
Package restore provides the CLI endpoint to the "admin restore" command.
Package restore provides the CLI endpoint to the "admin restore" command.
auth
Package auth provides the CLI endpoint to the "auth" command, which groups the commands that act on the caller's own authentication.
Package auth provides the CLI endpoint to the "auth" command, which groups the commands that act on the caller's own authentication.
auth/login
Package login provides the CLI endpoint to the "auth login" command.
Package login provides the CLI endpoint to the "auth login" command.
auth/logout
Package logout provides the CLI endpoint to the "auth logout" command.
Package logout provides the CLI endpoint to the "auth logout" command.
auth/whoami
Package whoami provides the CLI endpoint to the "auth whoami" command.
Package whoami provides the CLI endpoint to the "auth whoami" command.
dev
Package dev provides the CLI endpoint to the "dev" command, which groups the commands used to develop takt rather than to operate it.
Package dev provides the CLI endpoint to the "dev" command, which groups the commands used to develop takt rather than to operate it.
dev/loadtest
Package loadtest provides the CLI endpoint to the "dev loadtest" command.
Package loadtest provides the CLI endpoint to the "dev loadtest" command.
node
Package node provides the CLI endpoint to the "node" command, which groups the commands that act on the machine the server runs on.
Package node provides the CLI endpoint to the "node" command, which groups the commands that act on the machine the server runs on.
node/get
Package get provides the CLI endpoint to the "node get" command.
Package get provides the CLI endpoint to the "node get" command.
score
Package score provides the CLI endpoint to the "score" command, which groups the commands that act on scores.
Package score provides the CLI endpoint to the "score" command, which groups the commands that act on scores.
score/apply
Package apply provides the CLI endpoint to the "score apply" command.
Package apply provides the CLI endpoint to the "score apply" command.
score/delete
Package delete provides the CLI endpoint to the "score delete" command.
Package delete provides the CLI endpoint to the "score delete" command.
score/list
Package list provides the CLI endpoint to the "score list" command.
Package list provides the CLI endpoint to the "score list" command.
score/render
Package render provides the CLI endpoint to the "score render" command.
Package render provides the CLI endpoint to the "score render" command.
score/show
Package show provides the CLI endpoint to the "score show" command.
Package show provides the CLI endpoint to the "score show" command.
secret
Package secret provides the CLI endpoint to the "secret" command, which groups the commands that act on secrets.
Package secret provides the CLI endpoint to the "secret" command, which groups the commands that act on secrets.
secret/delete
Package delete provides the CLI endpoint to the "secret delete" command.
Package delete provides the CLI endpoint to the "secret delete" command.
secret/get
Package get provides the CLI endpoint to the "secret get" command.
Package get provides the CLI endpoint to the "secret get" command.
secret/list
Package list provides the CLI endpoint to the "secret list" command.
Package list provides the CLI endpoint to the "secret list" command.
secret/set
Package set provides the CLI endpoint to the "secret set" command.
Package set provides the CLI endpoint to the "secret set" command.
serve
Package serve provides the CLI endpoint to the "serve" command.
Package serve provides the CLI endpoint to the "serve" command.
service
Package service provides the CLI endpoint to the "service" command, which groups the commands that act on services.
Package service provides the CLI endpoint to the "service" command, which groups the commands that act on services.
service/apply
Package apply provides the CLI endpoint to the "service apply" command.
Package apply provides the CLI endpoint to the "service apply" command.
service/delete
Package delete provides the CLI endpoint to the "service delete" command.
Package delete provides the CLI endpoint to the "service delete" command.
service/get
Package get provides the CLI endpoint to the "service get" command.
Package get provides the CLI endpoint to the "service get" command.
service/list
Package list provides the CLI endpoint to the "service list" command.
Package list provides the CLI endpoint to the "service list" command.
token
Package token provides the CLI endpoint to the "token" command, which groups the commands that act on tokens.
Package token provides the CLI endpoint to the "token" command, which groups the commands that act on tokens.
token/create
Package create provides the CLI endpoint to the "token create" command.
Package create provides the CLI endpoint to the "token create" command.
token/delete
Package delete provides the CLI endpoint to the "token delete" command.
Package delete provides the CLI endpoint to the "token delete" command.
token/list
Package list provides the CLI endpoint to the "token list" command.
Package list provides the CLI endpoint to the "token list" command.
variable
Package variable provides the CLI endpoint to the "variable" command, which groups the commands that act on variables.
Package variable provides the CLI endpoint to the "variable" command, which groups the commands that act on variables.
variable/delete
Package delete provides the CLI endpoint to the "variable delete" command.
Package delete provides the CLI endpoint to the "variable delete" command.
variable/get
Package get provides the CLI endpoint to the "variable get" command.
Package get provides the CLI endpoint to the "variable get" command.
variable/list
Package list provides the CLI endpoint to the "variable list" command.
Package list provides the CLI endpoint to the "variable list" command.
variable/set
Package set provides the CLI endpoint to the "variable set" command.
Package set provides the CLI endpoint to the "variable set" command.
volume
Package volume provides the CLI endpoint to the "volume" command, which groups the commands that act on volumes.
Package volume provides the CLI endpoint to the "volume" command, which groups the commands that act on volumes.
volume/apply
Package apply provides the CLI endpoint to the "volume apply" command.
Package apply provides the CLI endpoint to the "volume apply" command.
volume/delete
Package delete provides the CLI endpoint to the "volume delete" command.
Package delete provides the CLI endpoint to the "volume delete" command.
volume/get
Package get provides the CLI endpoint to the "volume get" command.
Package get provides the CLI endpoint to the "volume get" command.
volume/list
Package list provides the CLI endpoint to the "volume list" command.
Package list provides the CLI endpoint to the "volume list" command.
workload
Package workload provides the CLI endpoint to the "workload" command, which groups the commands that act on workloads.
Package workload provides the CLI endpoint to the "workload" command, which groups the commands that act on workloads.
workload/apply
Package apply provides the CLI endpoint to the "workload apply" command.
Package apply provides the CLI endpoint to the "workload apply" command.
workload/delete
Package delete provides the CLI endpoint to the "workload delete" command.
Package delete provides the CLI endpoint to the "workload delete" command.
workload/events
Package events provides the CLI endpoint to the "workload events" command.
Package events provides the CLI endpoint to the "workload events" command.
workload/get
Package get provides the CLI endpoint to the "workload get" command.
Package get provides the CLI endpoint to the "workload get" command.
workload/list
Package list provides the CLI endpoint to the "workload list" command.
Package list provides the CLI endpoint to the "workload list" command.
workload/logs
Package logs provides the CLI endpoint to the "workload logs" command.
Package logs provides the CLI endpoint to the "workload logs" command.
workload/restart
Package restart provides the CLI endpoint to the "workload restart" command.
Package restart provides the CLI endpoint to the "workload restart" command.
workload/start
Package start provides the CLI endpoint to the "workload start" command.
Package start provides the CLI endpoint to the "workload start" command.
workload/stop
Package stop provides the CLI endpoint to the "workload stop" command.
Package stop provides the CLI endpoint to the "workload stop" command.
internal
generated/api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
loadtest
Package loadtest drives a running takt server hard enough to find out what breaks.
Package loadtest drives a running takt server hard enough to find out what breaks.
restore
Package restore puts a node back from a backup archive.
Package restore puts a node back from a backup archive.
server
Package server provides the takt server and its configuration.
Package server provides the takt server and its configuration.
server/api
Package api provides the HTTP API surface of the takt server.
Package api provides the HTTP API surface of the takt server.
server/auth
Package auth provides the identity a request carries and the tokens that prove it.
Package auth provides the identity a request carries and the tokens that prove it.
server/certificate
Package certificate holds the TLS certificate the server presents and rereads it from disk when the certificate file changes, so a renewal does not need a restart.
Package certificate holds the TLS certificate the server presents and rereads it from disk when the certificate file changes, so a renewal does not need a restart.
server/database
Package database provides the SQLite-backed persistence layer for the takt server.
Package database provides the SQLite-backed persistence layer for the takt server.
server/driver
Package driver defines the vocabulary shared between the takt server and the runtimes it can run workloads on.
Package driver defines the vocabulary shared between the takt server and the runtimes it can run workloads on.
server/driver/docker
Package docker provides the driver that runs takt workloads as Docker containers.
Package docker provides the driver that runs takt workloads as Docker containers.
server/driver/exec
Package exec provides the driver that runs workloads as processes on the host.
Package exec provides the driver that runs workloads as processes on the host.
server/event
Package event names the things the server records about a workload while converging it.
Package event names the things the server records about a workload while converging it.
server/health
Package health provides checking of whether a workload is working, as distinct from whether its runtime reports it started.
Package health provides checking of whether a workload is working, as distinct from whether its runtime reports it started.
server/job
Package job provides running of the work the server does on its own schedule, as distinct from the work it does in answer to a request or a change.
Package job provides running of the work the server does on its own schedule, as distinct from the work it does in answer to a request or a change.
server/middleware
Package middleware provides the HTTP middleware the server puts in front of its API and web UI.
Package middleware provides the HTTP middleware the server puts in front of its API and web UI.
server/mount
Package mount materialises the secrets, variables and tokens a workload mounts as files on the host, and owns the directories holding them.
Package mount materialises the secrets, variables and tokens a workload mounts as files on the host, and owns the directories holding them.
server/port
Package port provides allocation of host ports to workloads, and settles a workload's ports on the ones it is reached at.
Package port provides allocation of host ports to workloads, and settles a workload's ports on the ones it is reached at.
server/reconciler
Package reconciler provides the control loop that drives the running state of the node towards the desired state held in the database.
Package reconciler provides the control loop that drives the running state of the node towards the desired state held in the database.
server/resolve
Package resolve turns the references in a workload's specification into the values they name: a secret's plaintext, a variable's value, or the address another workload is reached at.
Package resolve turns the references in a workload's specification into the values they name: a secret's plaintext, a variable's value, or the address another workload is reached at.
server/secret
Package secret provides the encryption takt stores a secret's value under.
Package secret provides the encryption takt stores a secret's value under.
server/service
Package service provides the domain orchestration layer for the takt server.
Package service provides the domain orchestration layer for the takt server.
server/specdiff
Package specdiff provides the comparison of two workload specifications that tells an operator what an apply would change.
Package specdiff provides the comparison of two workload specifications that tells an operator what an apply would change.
server/spechash
Package spechash provides the hash takt computes over a workload's specification.
Package spechash provides the hash takt computes over a workload's specification.
server/state
Package state derives what a workload is doing overall from the instances the driver reports for it.
Package state derives what a workload is doing overall from the instances the driver reports for it.
server/telemetry
Package telemetry provides the OpenTelemetry providers the server runs with.
Package telemetry provides the OpenTelemetry providers the server runs with.
ui
Package ui serves the web UI embedded in the takt binary.
Package ui serves the web UI embedded in the takt binary.
wire
Package wire maps between the specification the HTTP API speaks and the canonical one the rest of takt reasons about.
Package wire maps between the specification the HTTP API speaks and the canonical one the rest of takt reasons about.
pkg
cli
Package cli provides the connection settings a takt client resolves from flags, the environment and the config file, in that order.
Package cli provides the connection settings a takt client resolves from flags, the environment and the config file, in that order.
client
Package client provides a Go client for the takt server's HTTP API.
Package client provides a Go client for the takt server's HTTP API.
manifest
Package manifest provides parsing and validation of takt resource manifests.
Package manifest provides parsing and validation of takt resource manifests.
score
Package score provides parsing and rendering of a score: a file naming the manifests, variables and secrets that make up one deployment, with Go templating over a values file.
Package score provides parsing and rendering of a score: a file naming the manifests, variables and secrets that make up one deployment, with Go templating over a values file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL