Install BeaconTower locally
Bring up a BeaconTower tenant on your own machine, seeded and answering a device. About an hour, most of it Azure provisioning Cosmos DB.
Prerequisites
-
k3s, without traefik and with a readable kubeconfig. BeaconTower brings its own ingress-nginx.
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable traefik" K3S_KUBECONFIG_MODE=644 sh -On an existing install, put
write-kubeconfig-mode: "0644"anddisable: [traefik]in/etc/rancher/k3s/config.yamland restart k3s. -
docker. btk3s runs kubectl, helm, flux, terraform and az in its own toolchain container, which it builds on your first command.
-
The Azure CLI on your PATH, for
btk3s loginin step 4. -
An Azure subscription, with Contributor on the subscription or the resource group.
-
Your container registry token, issued to you as a name and a password.
-
25 GB of free disk, 16 GB of memory, 4 CPUs.
-
On WSL2: 24 GB, 8 CPUs and
networkingMode=mirroredin%UserProfile%\.wslconfig, systemd enabled in/etc/wsl.conf, and the domainbtk3s.127.0.0.1.nip.io. Mirrored networking lets a device on your LAN reach the tenant. -
On macOS: work inside a Linux VM.
brew install lima
limactl start --name btk3s --vm-type=vz --cpus 8 --memory 24 --disk 100 template://ubuntu
limactl shell btk3s
Steps
1. Install the binary
Take the newest btk3s-* release from
beacontower/tools and
substitute its tag for VERSION:
mkdir -p ~/.local/bin
arch=$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')
curl -fLo ~/.local/bin/btk3s \
"https://github.com/beacontower/tools/releases/download/VERSION/btk3s-linux-$arch"
chmod +x ~/.local/bin/btk3s
btk3s version
Install it in a directory you own, not /usr/local/bin: btk3s update
replaces the binary where it is, and cannot write to a root-owned directory.
If btk3s is not found, add ~/.local/bin to your PATH
(echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc, then open a new
shell). The arch line picks the arm64 build on arm64, including a Lima VM on
an Apple silicon Mac; arm64 needs v0.5.3 or later. Verify the download against
checksums.txt on the same release.
Installed it in /usr/local/bin earlier? Move it once:
sudo mv /usr/local/bin/btk3s ~/.local/bin/ && sudo chown "$USER" ~/.local/bin/btk3s.
2. Configure the tenant
Configuration is per directory, so one machine can hold several tenants. Run every later command from this directory.
mkdir ~/btk3s && cd ~/btk3s
az login
btk3s init
init asks three things: the domain, your subscription ID, and a short name
that makes the Azure names unique — lowercase letters and digits, at most 6
characters with the defaults, because Azure caps storage account names at 24.
It derives the rest from the short name and prints them: resource group
rg-btk3s-dev-<name>, Key Vault kvbtbtk3sdev<name>, and the storage
accounts. Then it writes btk3s.yaml and azure/terraform/terraform.tfvars.
To run it without prompts, pass --domain, --subscription and --suffix
(the short name). --resource-group and --keyvault override the derived
names — see btk3s init --help.
The domain defaults to btk3s.<your IP>.nip.io, which public DNS resolves to
that address, so a device on your LAN can reach the tenant. It is baked into
the certificates and the Keycloak authority. To change it later, edit
domain in btk3s.yaml, re-run btk3s up, which re-issues the certificates
and re-derives every setting that carries the domain, then repeat step 6 for
the new certificates. The comment in btk3s.yaml suggests btk3s up certs
and btk3s up secrets instead; up certs does re-issue the certificates, but
up secrets only lists what it would mint and leaves the old authority in
place.
3. Create the Azure resources
btk3s cloud up
The resource group, the Key Vault, and the terraform module. 15-25 minutes.
Wait for the last line, ==> azure up: the next step stores your token in
that Key Vault, and fails with Failed to resolve 'kv….vault.azure.net' until
it exists.
4. Store your registry token
btk3s login TOKEN_NAME TOKEN
This puts the credential in your Key Vault, where External Secrets turns it into the cluster's image-pull secret, and logs this host's docker in for the device CLI. It verifies the token can pull before storing it. It needs step 3 to have finished.
5. Bring up the tenant
btk3s up
About 20 minutes on a first run: Flux, the environment layer, Vault, the PKI, the tenant manifests and the seed data. Re-running after a failure resumes. In a Linux VM on macOS or Windows it also starts the port relay.
6. Trust the tenant's certificates
btk3s hosts trust
A tenant serves three hosts from three chains, and you need all three:
| Host | Serves | Root |
|---|---|---|
https://<domain>/ | web client, API, Keycloak | btk3s-local-ca |
https://device.<domain>/ | onboarding and EST | btk3s Onboarding Root |
mqtt.<domain>:8883 | the broker | tenant-device-ca |
Trust all three and every host verifies. With the first alone, the console works while a device cannot onboard; the third is what the broker presents.
hosts trust writes one file per root under ~/.local/state/btk3s/ and prints
the command for the OS you browse from. Firefox everywhere, and
Chrome/Chromium on Linux, keep their own certificate store — the output says
how to import there. Anything taking a --cacert wants
~/.local/state/btk3s/ca-bundle.pem.
Verify it worked
btk3s doctor # every precondition, now that everything exists
btk3s hosts # the tenant's URLs
btk3s creds # the credentials to sign in with
doctor changes nothing. After step 5 it should show no FAIL. Two WARNs
are expected: btpy image until you first run btk3s btpy, which pulls it,
and a missing helm, flux, jq or step on your machine, which only the
provider commands in Develop a provider need.
Its checks are grouped by step — machine, cloud, login, tenant — and a step you
have not run yet is one line naming the command that does it, so it is safe to
run at any point. btk3s doctor <stage> runs one stage.
Open the web client and sign in. The seeded organization, models and enrollment
groups are already there, and btk3s up has driven a device activation through
to a bound asset.
If it doesn't work
btk3s doctor
It changes nothing and names the probe behind each verdict. UNKNOWN means the
check could not run, which is different from passing.
- Pods stuck pending on an image. Re-run step 4;
doctorreports the credential. - A browser warns on
device.<domain>or the broker refuses. One of the three roots in step 6 is missing.
When something is wrong takes the symptoms one by one.
Next
- Day 1 — logging in, calling the API, what is already seeded.
- Drive devices — tiers, and the rest of the device CLI.
- Upgrade — move to a newer release.
- Your Azure — what
cloud upcreated and what it costs.