- Shell 69.4%
- HCL 20.6%
- Jinja 7.4%
- PowerShell 2.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| ansible | ||
| cloud-init | ||
| local | ||
| scripts | ||
| terraform | ||
| .ansible-lint | ||
| .checkov.yml | ||
| .gitignore | ||
| .tflint.hcl | ||
| .yamllint.yml | ||
| install.sh | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
Orbital Setup
Customer-facing Infrastructure-As-Code (IaC) for Call Theory's Orbital AX and Call Center platform.
Handle first-time deployments and version updates using opinionated defaults.
Requirements
tofu(OpenTofu ≥ 1.7),kubectl,helm,git,curl,jq,openssl— plusansiblefor on-prem../install.shchecks for all of them first and tells you how to install anything missing.- An SSH public key, and for Vultr an API key.
No registry account is needed: the chart and images come from Call
Theory's public registry, cr.calltheory.com/orbital.
Install
git clone https://git.calltheory.com/calltheory/orbital-setup.git
cd orbital-setup
git checkout "$(curl -fsS https://git.calltheory.com/api/v1/repos/calltheory/orbital-setup/releases/latest | jq -r .tag_name)"
./install.sh
./install.sh deploys to Vultr Kubernetes Engine (VKE), the supported
target for now; the K3s targets (Vultr VMs, your own VMs) are behind
ORBITAL_EXPERIMENTAL_TARGETS=1 until they get an ingress controller.
It asks for your domain and Vultr account, then offers the regions and
server plans Vultr actually has (with prices and a monthly estimate). It
checks what it can as you go (the release's chart is published, Vultr
API key, available Kubernetes versions), shows a summary, and writes:
| File | Holds |
|---|---|
terraform/<target>/terraform.tfvars |
OpenTofu inputs for that target |
.orbital/settings.env |
Everything else the install needs, including secrets (git-ignored, mode 0600) |
.orbital/values.yaml |
Your own helm overrides — empty to start |
Then it can preview the infrastructure (tofu plan), run the install, or
stop so you can run it later. The install creates the infrastructure,
installs Traefik and cert-manager with a Let's Encrypt issuer,
creates the app secrets, and installs the Orbital chart. At the end it
prints the DNS records to create and how to make your admin login.
Re-run ./install.sh any time: saved answers are the defaults, so
pressing Enter through it keeps everything. Secrets already in the cluster
(APP_KEY, database passwords) are never regenerated.
./install.sh --configure-only writes the files without installing.
Workers under 4 vCPUs make a small cluster: fine for demos and evaluation, with one Asterisk instead of two and no room to absorb a failed worker. Use three 4-vCPU workers for production.
Using your own registry
To pull from a mirror instead (for example after copying a release's
images and chart into your own registry), answer yes to "Pull from your
own registry" in ./install.sh, or set these when running the install
scripts directly:
| Variable | Default | Meaning |
|---|---|---|
HARBOR_REGISTRY |
cr.calltheory.com |
Registry host |
HARBOR_PROJECT |
orbital |
Path holding <image>:<version> and charts/orbital |
HARBOR_USERNAME, HARBOR_TOKEN |
unset | Only if the registry needs a login; then a pull secret is created |
Telephony on VKE is new and not yet proven on a live cluster. Carrier calls route edge → Asterisk over the private network, operator softphones register over
wss://<SIP domain>:7443through the edges, and LiveKit is reachable atlivekit.<domain>(TURN atturn.<domain>).
Releases and upgrades
Every release of Orbital tags this repo with the matching version: tag
v1.2.3 deploys chart and images 1.2.3 and installs that release's
rtpengine .debs. The installer reads the version from the checked-out
tag. Releases are listed at
https://git.calltheory.com/calltheory/orbital-setup/releases.
To upgrade: git fetch --tags, check out the newer tag, run ./install.sh
again.
One commit can carry several tags when this repo didn't change between Orbital releases. The scripts then deploy the highest of them; set
ORBITAL_CHART_VERSION=1.2.3to deploy an older one.
Optional features
./install.sh has a Features step. On a first install it asks about
each optional feature; on an upgrade it shows what's on, asks about any
feature that's new in that release, and offers to change the rest. Your
answers are saved in .orbital/settings.env (FEATURE_*) and written to
.orbital/features.values.yaml on every deploy. Anything in
.orbital/values.yaml still wins over them.
| Feature | Default | What it does |
|---|---|---|
| Inbound email | on | Haraka receives mail for inbound.<your domain> on port 25, so clients can reply to Orbital's email and the Inbound Email channel works. The installer opens port 25 on the ingress load balancer and creates the MX record (Cloudflare or Vultr DNS), or prints it for you to add. |
| Metrics & alerts | off | In the cluster: Prometheus, Alertmanager (Orbital's alert rules; alerts by email and/or webhook) and Grafana with Orbital's dashboards, opened from the admin panel. Or your own service: Grafana Alloy remote-writes the app's metrics to any Prometheus-compatible endpoint. |
| Logs | off | In the cluster: Loki (14 days), shown in Grafana. Or your own service: Alloy pushes pod logs to any Loki-compatible endpoint. |
| Traces | off | In the cluster: Tempo (7 days), shown in Grafana. Or your own service: the app exports traces over OTLP to your endpoint. |
| Local transcription | off | whisper.cpp in the cluster for voicemail transcription that never leaves it. Reserves half a vCPU and 1 GiB; the image is about 1.5 GB. |
| Self-hosted AI (Ollama) | on | Runs Ollama in the cluster and pulls nomic-embed-text, so knowledge stores embed without sending documents to a hosted provider. Reserves 0.25 vCPU and 1.5 GiB (up to 2 vCPU / 4 GiB), plus a volume for models. Off means knowledge stores need an OpenAI API key. |
Monitoring runs in its own monitoring namespace, with the alert rules
and dashboards of the Orbital release you install. Grafana, Prometheus,
Loki and Tempo are reachable only from Orbital's namespace (Grafana signs
operators in through the admin panel), and turning a component off
removes it but keeps its volume. Every site's monitoring is its own:
nothing is sent anywhere you didn't name.
The system status page grays out cards for features a site has turned off, so a gray card means "this site doesn't run it", never "broken".
Inbound email's port 25 goes through the Traefik ingress the Vultr targets install. On-prem K3s doesn't install an ingress controller yet, so there you route port 25 to the
harakaService yourself.
On-prem: two hosts and a witness (experimental)
ORBITAL_EXPERIMENTAL_TARGETS=1 ./install.sh offers two on-prem targets
until they've run on real hardware:
- Two Proxmox hosts — the installer clones an Ubuntu 24.04 cloud-init
template into the VMs (
terraform/onprem/proxmox,bpg/proxmox). - Your own VMs — Hyper-V, bare metal, anything reachable over SSH.
On Hyper-V,
scripts/hyperv/New-OrbitalVM.ps1creates each VM from the cloud image with nothing but Hyper-V's own cmdlets (see its help).
The layout, either way:
| Host 1 | Host 2 | Witness (third, small box) | |
|---|---|---|---|
| Edge VM (Kamailio, rtpengine) | edge 1 | edge 2 | — |
| K3s VM (runs Orbital) | server 1 | server 2 | control-plane vote only |
- Control plane: three K3s servers, so the cluster keeps running with either host down. The witness is tainted so nothing else runs on it.
- App address: keepalived floats one IP between the two K3s VMs; the web app, inbound mail and the Kubernetes API answer on it, through Traefik on K3s's ServiceLB.
- Storage: Longhorn keeps a copy of every volume on each host, so Postgres and the rest restart on the other host when one fails.
- Calls: two of every call-path component, one per host; the edges poll the app for the live Asterisk list, as on Vultr.
- Edges need their public address on a NIC — from a routed public block, for example — with a second NIC on the site network facing the K3s VMs. Edges behind 1:1 NAT aren't supported yet. Point the SIP name at both edges (one A record each) and give carriers both addresses.
Calls in progress on a host that fails are dropped; new calls go to the other host. Losing a host also means a few minutes before Postgres is back (the node has to be declared down first).
Capacity check
Just before deploying, the installer renders the chart with this site's values and checks every pod will find room: it adds up each pod's CPU and memory requests and places them on the workers' free room (after system and monitoring pods), biggest first, plus one extra copy of the biggest pod for the rolling update. Totals alone aren't enough: a cluster can have plenty free overall and still no single worker with room for one big pod.
If something won't fit it says what's short and, on managed VKE, offers to
add workers on the current plan (an in-place change; running pods don't
move). Elsewhere it suggests features to switch off. With --yes it adds
the workers without asking. If the check itself can't run (no cluster
access yet, say) it warns and steps aside; ORBITAL_SKIP_CAPACITY_CHECK=1
turns it off.
Resizing VKE workers
Vultr can't change the server plan of a running node pool, so a new worker size isn't a matter of editing it and re-running the installer (the installer refuses that plan). Instead:
./scripts/resize-vke-workers.sh --plan=vc2-4c-8gb --count=3
./scripts/install-vultr.sh --skip-tofu # on the release tag you run
The script adds a node pool on the new plan, drains the old nodes onto it
one at a time, then shrinks the cluster's built-in pool to one cordoned
node, which VKE won't let go of. Each stateful tier restarts once, and calls
on an Asterisk that moves are dropped, so pick a quiet hour. It asks before
each OpenTofu change, saves the new sizes for ./install.sh, and can be
re-run with the same arguments if it's interrupted. A count change on the
same plan is made in place. The install-vultr.sh run applies the new size
to the app; moving off 2-vCPU workers leaves small-cluster mode.
Running the steps yourself
The installer writes the files and then calls one script. You can run
that script directly (it reads .orbital/settings.env; environment
variables override it):
- Vultr:
./scripts/install-vultr.sh --variant=managed-vke(orself-hosted-k3s) - On-prem:
./scripts/install-onprem.sh
Add --skip-tofu to only redo the cluster and helm steps.
ORBITAL_VALUES_FILES=a.yaml:b.yaml swaps in your own values files in
place of .orbital/values.yaml. Each target's terraform.tfvars.example
documents every OpenTofu input if you'd rather write tfvars by hand.
Testing
CI runs on every PR (.forgejo/workflows/):
lint.yml—tofu fmt/validate,tflint,yamllint,ansible-lint, playbook syntax-checksecurity.yml—checkovoverterraform/molecule.yml— full role test forrtpengineon Ubuntu 24.04 in Docker
To test edge-deployment using multipass locally:
./local/multipass-edge.sh
Run lint locally before pushing:
tofu fmt -check -recursive terraform/
yamllint .
cd ansible
ansible-lint
cd ..
Security
Report vulnerabilities privately to security@calltheory.com. Do not open public issues for security findings.
Contributing
Have an environment IaC you'd like to contribute? Open a pull-request!
License
This project is covered under the Apache 2.0 license. You can read the license here.