Add machines to a cluster
You add one declared machine at a time. Describe the new machine, build the install stick again, and boot the machine from it. This procedure makes no changes to the running machines.
1. Describe the new machine
Add a manifest file to your deployment directory, with the manifests
that liken new wrote. Copy an existing machine’s file and change the
name, the addresses, and the storage for the new hardware. The comments
in the file explain each field.
2. If the new machine is a leader
If the new machine will run a control plane, add its name to
spec.leaders in two places:
- On the live cluster, with
kubectl edit cluster. The machines read this document, and each machine gets its role from it. - In your
mycluster/cluster.yaml. The file applies only to a new cluster. But if you keep it correct, a new build gives the cluster that you run.
Make the live edit before you install the machine. Keep an odd number of leaders, so that the datastore can always make a majority.
3. Rebuild the install stick
A change to the deployment layer needs new install media. Use the
release that your fleet runs. kubectl get clusters shows it in the
VERSION column. Pack the layer and the stick again with
liken layer and
liken stick:
./liken layer mycluster mycluster/identity mycluster/deployment.cpio
./liken stick channel/<version> mycluster/deployment.cpio mycluster/install.img
Check the device name before the next command. The command overwrites the device.
sudo dd if=mycluster/install.img of=/dev/YOUR-STICK bs=4M oflag=direct status=progress
4. Boot the new machine from the stick
The stick’s menu now lists the new machine, with an install as <name> entry and a wipe and reinstall as <name> entry. If you do not
know this hardware, boot liken hardware report first. It writes
hardware-report.yaml to the stick, so you can correct the machine’s
disks, interfaces, and drivers before you install. Install a
cluster
describes the report and the held console messages fully.
Select install as <name>. The machine installs itself and holds the
console:
liken: installed to slot A; remove the stick, then press Enter to power off; the next power-on boots from the disk.
Remove the stick, then press Enter. The machine powers off. Power it on again, and it boots from its own disk.
5. Watch it join
kubectl get machines
The new machine appears, then it becomes Ready. It also appears in
kubectl get nodes. The rows of the other machines do not change.