Quickstart Guide
Estimated time: ~10 minutes
Get a working Heir cluster running in minutes using Kind as the management cluster.
This guide assumes Kind and the worker node run on the same machine.
This guide covers two ways to manage Heir: the heir command-line tool, or applying Kubernetes manifests
directly with kubectl.
Installing heir
There are really two different things you might be installing heir for:
- An operator workstation install: your own laptop or workstation, used to run commands like
heir provision runtimeClusterandheir get. This works on Debian/Ubuntu and macOS. - A worker node install: the machine you're joining to a tenant cluster as a worker, using
heir provision worker. This currently only works on Debian and Ubuntu, see the note below before you try it on anything else.
If you're just getting started, you want the operator workstation install below, on whichever machine you normally run commands from.
- Debian / Ubuntu
- macOS
arch=$(uname -m); case "$arch" in x86_64) arch=amd64 ;; aarch64) arch=arm64 ;; esac
curl -sL $(curl -s https://api.github.com/repos/tardigradeproj/heir/releases/latest \
| grep browser_download_url | grep "linux_${arch}.deb" | cut -d '"' -f 4) -o heir.deb
sudo apt install ./heir.deb
Homebrew (recommended)
brew tap tardigradeproj/tap
brew install --cask heir
That's it. heir will be on your PATH immediately, and brew upgrade heir will pick up future releases.
Manual tarball install
If you'd rather not use Homebrew, download the tarball directly and install it yourself:
arch=$(uname -m)
curl -sL $(curl -s https://api.github.com/repos/tardigradeproj/heir/releases/latest \
| grep browser_download_url | grep "tardigrade_heir_Darwin_${arch}.tar.gz" | cut -d '"' -f 4) -o heir.tar.gz
tar -xzf heir.tar.gz
sudo mv heir /usr/local/bin/heir
sudo chmod +x /usr/local/bin/heir
One extra step with this path: because the binary didn't come through Homebrew, macOS marks it as quarantined, and Gatekeeper refuses to run it the first time, with a dialog like "heir" cannot be opened because the developer cannot be verified. Clear the quarantine flag before running it:
xattr -d com.apple.quarantine /usr/local/bin/heir
(The Homebrew cask does this for you automatically, which is why it's the easier option.)
Verify it worked
heir version
heir provision worker, the command you run on a machine to join it to a tenant cluster, currently only works Linux. Install heir on your own machine using whichever section above fits, but for any machine that
will join a tenant cluster as a worker node, use the Debian / Ubuntu tab specifically. See Requirements for further specifics.
Overview
This guide covers the full setup: creating a management cluster, installing the Heir Operator, deploying the Heir control plane, and joining a worker node. By the end you will have a functioning Heir cluster you can start scheduling workloads on.
To keep things simple, this guide uses mostly default options, a single control plane replica, NodePort exposure, and kine as the
storage backend. Once you have a working cluster, visit Configuration Options to see everything you can
customize, including the Helm chart values used to install the Operator. If you are planning a production
deployment, check the Requirements page first. For the full set of heir commands and flags used in the CLI tabs below,
see the Heir CLI manual.
Kind is used here for convenience, but any conformant Kubernetes distribution works as the management cluster.
Prerequisites
- Kind installed
kubectlinstalled and available in your PATH- Helm installed
heirinstalled, see Installing heir above
1. Create the Management Cluster
Create a Kind cluster with two NodePort mappings, one for the Kubernetes API server and one for the plane tunnel, which handles communication between the control plane and worker nodes:
cat <<EOF | kind create cluster --name heir-quickstart --kubeconfig="./management-cluster.yaml" --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 30080
- containerPort: 30081
hostPort: 30081
EOF
2. Install the Heir Operator
The Heir Operator is the controller-manager that watches Runtime resources and reconciles them into running tenant clusters. Install it into the management cluster with Helm:
helm install heir oci://ghcr.io/tardigradeproj/charts/heir --version 1.36.5-heirv0.3.1 \
--kubeconfig ./management-cluster.yaml \
-n heir-system --create-namespace \
--set manager.image.repository=ghcr.io/tardigradeproj/heir-controller-manager \
--set manager.image.tag=v1.36.5-heirv0.3.1
Verify the operator is running before continuing:
kubectl --kubeconfig ./management-cluster.yaml get pods -n heir-system
See Helm Chart for the full set of values the chart accepts.
3. Deploy the Control Plane
First, create the Runtime resource. This tells Heir how the cluster should be deployed, scaled, configured and exposed. See Configuration Options for a full reference.
- CLI
- Manifest
heir provision cluster creates the Runtime for you and, with --wait (the default), blocks until the control
plane is up, no need for a separate kubectl get pods -w step:
heir provision runtimeCluster heir-quickstart \
--kubeconfig ./management-cluster.yaml \
--set cluster.controlPlaneExternalEndpoint.apiServer.host=127.0.0.1 \
--set cluster.controlPlaneExternalEndpoint.apiServer.port=30080 \
--set cluster.controlPlaneExternalEndpoint.planeTunnel.host=127.0.0.1 \
--set cluster.controlPlaneExternalEndpoint.planeTunnel.port=30081
Then fetch the tenant cluster's kubeconfig with heir get cluster --save-kubeconfig:
heir get runtimeCluster heir-quickstart \
--kubeconfig ./management-cluster.yaml \
--save-kubeconfig ./heir-quickstart-kubeconfig.yaml
cat <<\EOF > ./heir.yaml
apiVersion: controlplane.tardigrade.runtime.io/v1alpha1
kind: Runtime
metadata:
name: heir-quickstart
namespace: default
spec:
controlPlane:
heir:
image: ghcr.io/tardigradeproj/heir:latest
clusterAgent:
image: ghcr.io/tardigradeproj/clusteragent:latest
deployment:
replicas: 1
service:
serviceType: NodePort
planeTunnel:
server:
image: ghcr.io/tardigradeproj/heir-tunnel:latest
cluster:
controlPlaneExternalEndpoint:
apiServer:
host: "127.0.0.1" #assuming that the worker node is being configured on the machine where the kind is running
port: 30080
planeTunnel:
host: "127.0.0.1"
port: 30081
storage:
type: kine
EOF
Apply it against the management cluster:
kubectl --kubeconfig ./management-cluster.yaml apply -f ./heir.yaml
Wait for the control plane pod to come up:
kubectl --kubeconfig ./management-cluster.yaml get pods -w
The Runtime controller also publishes its own admin kubeconfig as a <name>-kubeconfig Secret. Fetching, decoding, and saving it lets you query the tenant cluster directly:
kubectl --kubeconfig ./management-cluster.yaml get secret heir-quickstart-kubeconfig -o jsonpath='{.data.kubeconfig}' | base64 -d > ./heir-quickstart-kubeconfig.yaml
Once the command completes, verify the cluster is up:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml get pods
4. Join a Worker Node
A worker can't register with the tenant cluster until it presents a bootstrap credential. Creating a WorkerJoinToken tells the cluster
agent to generate that credential and publish it for the worker to use. See WorkerJoinToken
for the full reference.
- CLI
- Manifest
heir provision token talks to the tenant cluster directly, so point it at the tenant kubeconfig you
fetched in step 3 (heir-quickstart-kubeconfig.yaml), not the management cluster's. With --wait (the default), it blocks until the
token is ready:
heir provision workerJoinToken new-node --kubeconfig ./heir-quickstart-kubeconfig.yaml
Save its bootstrap kubeconfig to a file with heir get token:
heir get workerJoinToken new-node --kubeconfig ./heir-quickstart-kubeconfig.yaml --save-token new-node-token.yaml
Then join the worker node with it:
sudo heir provision worker --token "$(cat new-node-token.yaml)"
WorkerJoinToken is reconciled against the tenant cluster itself, so apply it using the tenant kubeconfig you fetched in step 3
(heir-quickstart-kubeconfig.yaml), not the management cluster's:
cat <<EOF | kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml apply -f -
apiVersion: clusteragent.tardigrade.runtime.io/v1alpha1
kind: WorkerJoinToken
metadata:
name: new-node
spec:
ttl: 3h
EOF
Wait until it's ready:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml wait workerjointoken/new-node --for=condition=Ready --timeout=60s
You can check on it at any point with kubectl get workerjointoken, which reports readiness and expiry:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml get workerjointoken
NAME READY REASON EXPIRES AGE
new-node True TokenIssued 20XX-XX-XXT23:25:34Z 9s
The controller publishes the generated bootstrap token as the jointoken key of a <name>-jointoken Secret in the tenant cluster's
kube-system namespace. Fetch it and join the worker node in one step:
JOIN_TOKEN=$(kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml get secret new-node-jointoken -n kube-system -o jsonpath='{.data.jointoken}')
sudo heir provision worker --token="$JOIN_TOKEN"
5. Verify
From your local machine, confirm the worker node has joined:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml get nodes
NAME STATUS ROLES AGE VERSION
<hostname> NotReady <none> 9s v1.36.5
Right after joining, the node may briefly show NotReady while the CNI finishes coming up. Give it a few minutes and re-run the
command, it should flip to Ready.
6. Run a Workload
With a Ready node in place, schedule something on it:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml run nginx --image=nginx
Watch it come up:
kubectl --kubeconfig ./heir-quickstart-kubeconfig.yaml get pods -w
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 14s
Next Steps
Requirements — Read this before moving to production. It covers hardware, networking, and OS prerequisites that are not enforced in the quickstart.
Configuration Options — Once your cluster is running, use this reference to tune the control plane, switch storage backends, configure networking, or add extra resources at bootstrap time.
Helm Chart — Reference for every value the Operator's Helm chart accepts.
Heir CLI manual — Reference for every heir command used in the CLI tabs above, including flags not covered here.