enable autogenerating token (#375)

* Generate token

If a token is not explicitly provided, let the first server generate a
random one. Such a token is saved on the first server and the playbook
can retrieve it from there and store it a a fact. All other servers and
agents can use that token later to join the cluster. It will be saved
into their environment file as usual.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

* Document that token is (mostly) optional now

The token is still required when using Vagrant.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
This commit is contained in:
anon-software
2024-11-11 13:07:31 -08:00
committed by GitHub
parent 9d7fd7a70b
commit c10b84f0f4
5 changed files with 31 additions and 2 deletions

1
Vagrantfile vendored
View File

@@ -28,6 +28,7 @@ def provision(vm, role, node_num)
ansible.extra_vars = {
k3s_version: "v1.28.14+k3s1",
api_endpoint: "#{NETWORK_PREFIX}.100",
# Required for vagrant ansible provisioner
token: "myvagrant",
# Required to use the private network configured above
extra_server_args: "--node-external-ip #{node_ip} --flannel-iface eth1",