Persist Zerotier address on TrueNAS Scale

This guide is designed for configuring Zerotier on TrueNAS Core using Kubernetes.
- In TrueNAS, navigate to System Settings and then select the Shell option.

-
In the opened shell window, execute the following command:
1k3s kubectl get namespacesThe output should resemble the following:
1 2 3 4 5 6 7 8NAME STATUS AGE default Active 2d11h kube-system Active 2d11h kube-public Active 2d11h kube-node-lease Active 2d11h openebs Active 2d11h ix-zerotier Active 2d11h ix-syncthing Active 2d11hNote the name of the Zerotier namespace; for example, it might be called ix-zerotier.
-
Run the following command using the namespace obtained:
1k3s kubectl get -n ix-zerotier podsThe output should be similar to:
1 2NAME READY STATUS RESTARTS AGE zerotier-6d55584569-8psgm 1/1 Running 0 16m -
With the namespace and pod name information, open a shell inside the pod using:
1k3s kubectl exec -n ix-zerotier --stdin --tty zerotier-6d55584569-8psgm -- /bin/bashNow inside the Zerotier Pod, you can utilize the Zerotier CLI tools.
-
Generate Zerotier identity files using the following command:
1zerotier-idtool generate identity.secret identity.publicThis creates two files, identity.secret and identity.public.
-
Retrieve the values from these files by running:
1cat identity.secretThe output should appear as follows:
1481934b8ea:0:a00714fa214f59196aaa4836c8f3c5984f1b15ff186hc934ff0d5b8154f6910f2f5703560ce3364b9c898e9fe0808e4fbfb56025061085ee08551d091f65bdc2:24cebc7ecb1ea777ea055b29271e2bd82e6023849660cd7fb5d6b1c27f0a186e7c3592a38ab69d3e367ac4fee5e27d96e28f697177d13e46f1c3a6f34b14c00eRemove the root@truenas:/# from the end before pasting.
-
Repeat the same process for the other file:
1cat identity.publicThe output should be similar to:
1481934b8ea:0:ac0714fa214f59196aaa4836c8f5c5984f1b15ff1869c934ff0d5b8158f691032f5703560ce3364b9c898e9fe0808e4fbfb56025061085ee03554d091f65bdc2Remove the root@truenas:/# from the end before pasting.
-
Save these values in a text editor to prevent loss upon closing the shell.
-
From the TrueNAS web UI, go to Apps, choose Zerotier, and click Edit.

- Paste the values into the identity secret and identity public inputs, then click Update.

Now, a new address will be generated, and it will persist even after rebooting the Zerotier application or TrueNAS.