https://rancher.com/ logo
Title
f

flat-florist-77376

05/11/2022, 3:58 PM
Hey all--anyone know why when I create a cluster with one node with the
--host-alias
flag, that works… unless I restart the node, in which case the alias I configured earlier goes missing?
w

wide-garage-9465

05/11/2022, 8:58 PM
Hey 👋 Restart = k3d stop/start or docker/host restart?
f

flat-florist-77376

05/11/2022, 9:30 PM
Either.
w

wide-garage-9465

05/12/2022, 5:19 AM
For the latter, it is expected. But k3d start should inject the host-aliases again 🤔 are you using the latest version of k3d? I remember that it was a fairly recent update.
f

flat-florist-77376

05/12/2022, 5:21 PM
Why is it expected for the docker/host restart?
w

wide-garage-9465

05/12/2022, 5:48 PM
Because the host-alias injection is done by k3d on create/start. However those changes are not persistent due to the container nature. But k3d also doesn't know about the host/docker restarts, as it is only external. For v6.0.0 I planned to create an agent process that takes over those continuous tasks.
f

flat-florist-77376

05/12/2022, 5:50 PM
What about on container restart? Like, Docker host is online, but I stop and start the container manually instead of going through
k3d
. Should that preserve the alias?
w

wide-garage-9465

05/12/2022, 5:59 PM
Nope, only k3d actions are known to k3d. When I started k3d, I wanted to make it as independent as possible and as stateless as possible. That's also why all k3d state is stored as labels. But that's planned to change for the next major release.
f

flat-florist-77376

05/12/2022, 6:04 PM
Hmm, ok. Anyway to make that alias more permanent with the current version of
k3d
?
w

wide-garage-9465

05/12/2022, 6:23 PM
Nothing except for using k3d cluster start