PyratLabs / ansible-role-k3s

Ansible role for installing k3s as either a standalone server or HA cluster.
BSD 3-Clause "New" or "Revised" License
627 stars 135 forks source link

k3s_control_token not working #187

Closed niklasweimann closed 2 years ago

niklasweimann commented 2 years ago

Summary

When i set the k3s_control_token variable. The primary node initialises with a generated token and the secondary node tries to join the cluster with the token provided by k3s_control_token which obviously does not work.

Issue Type

Steps to Reproduce

Try to setup the k3s cluster with an external ha database. Set the k3s_control_token with some value. The primary node, which initializes the cluster will not use the token, but the secondary nodes will try to use the token. => Cluster can not be initialized.

k3s_cluster:
      vars:
        k3s_registration_address: 10.0.0.1
        k3s_control_token: <Some random string>

Expected Result

I expect the secondary Nodes to correctly join the cluster initialized by the primary node.

Actual Result

s. above

niklasweimann commented 2 years ago

I have created a PR (#188) which fixed the behavior i described above. My cluster initialized successfully with this fix, so i think the fix should work fine, but please hit me up if i need to provide further information.

crutonjohn commented 2 years ago

Hey 👋🏻

Thanks for the PR, much appreciated. I approved the pipeline. The change seems benign enough to me.