k3s-io / k3s-ansible

Apache License 2.0
2.09k stars 824 forks source link

Add token to agents on existing clusters #360

Closed james-otten closed 2 months ago

james-otten commented 2 months ago

Changes

356 introduced a subtle issue for existing clusters where the token is removed from the service unit but not added to the .env file unless a version update happens at the same time. By moving the task Add the token for joining the cluster to the environment outside of the block: it makes sure it is executed in all cases (a very subtle spacing issue).

Issue occurring: https://github.com/nycmeshnet/k8s-infra/actions/runs/10756493721/job/29829415464#step:14:569 Testing fix: https://github.com/nycmeshnet/k8s-infra/actions/runs/10805984455/job/29973976530#step:14:570 - I confirmed the value is now in the .env file and our nodes remained active.

Thank you for maintaining k3s-ansible, it is nice and easy to use. Also, #356 is good for security, thank you for this.