Talos extensions & Longhorn (Day 34)

Talos extensions & Longhorn (Day 34)
Photo by james chan / Unsplash

I wanted to install Longhorn on my Talos cluster and found out how involved it can be, especially if you are not used to the whole immutable OS's.

Longhorn needs iscsi-tools and util-linux-tools . This is how I ended up installing them

Extensions

  1. First create an extensions.yaml (can be any name)
customization:
  systemExtensions:
    officialExtensions:
      - siderolabs/iscsi-tools
      - siderolabs/util-linux-tools
      - siderolabs/qemu-guest-agent

I also added qemu-guest-agent Makes the nics and other info available on Proxmox.

  1. Get an image ID
curl -X POST --data-binary @extensions.yaml https://factory.talos.dev/schematics
{"id":"613e1592b2da41ae5e265e8789429f22e121aab91cb4deb6bc3c0b6262961245"}
  1. Apply the image

Using the ID from the previous response, run the following Talos upgrade command.

 talosctl upgrade --preserve --nodes <your nodes IP> --image factory.talos.dev/installer/e187c9b90f773cd8c84e5a3265c5554ee787b2fe67b508d9f955e90e7ae8c96c:v1.10.0
  1. Check extensions were applied
 talosctl get extensions --nodes 10.30.30.141
NODE           NAMESPACE   TYPE              ID   VERSION   NAME               VERSION
10.30.30.141   runtime     ExtensionStatus   0    1         iscsi-tools        v0.2.0
10.30.30.141   runtime     ExtensionStatus   1    1         util-linux-tools   2.40.4
10.30.30.141   runtime     ExtensionStatus   2    1         qemu-guest-agent   9.2.3

Here, checking one of my nodes, it shows the extensions were added okay.

Mounts

Next, create a patch file, e.g, longhorn.patch.yaml with the following:

machine:
  kubelet:
    extraMounts:
      - destination: /var/lib/longhorn
        type: bind
        source: /var/lib/longhorn
        options:
          - bind
          - rshared
          - rw

And apply the patch to your Talos nodes using:

talosctl -n 10.30.30.143 patch machineconfig -m reboot -p @longhorn.patch.yaml

Once the reboot is done, you can proceed with the Longhorn installation (either through Argo or helm, or installation of your choice).