Skip to main content

Quickstart Guide

Estimated time: ~10 minutes

Get a working Heir cluster running in minutes using Kind as the management cluster.

note

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:

  1. An operator workstation install: your own laptop or workstation, used to run commands like heir provision runtimeCluster and heir get. This works on Debian/Ubuntu and macOS.
  2. 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.

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

Verify it worked​

heir version
Worker nodes currently only run on Linux

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
  • kubectl installed and available in your PATH
  • Helm installed
  • heir installed, 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.

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

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.

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)"

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.