Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plan command node-token command #416

Merged
merged 5 commits into from
Oct 27, 2023
Merged

Conversation

alexellis
Copy link
Owner

@alexellis alexellis commented Oct 27, 2023

Add plan command node-token command

Description

  • k3sup plan is used to read in a list of devices and to generate an installation script for a HA cluster.
  • k3sup node-token is used by scripts generated by k3sup plan to avoid too many SSH connections by each joining node back to the server.
  • SSH connection code is moved into a common helper method, instead of getting repeated

How Has This Been Tested?

Usage:

devices.json

[{
        "hostname": "node-1",
        "ip": "192.168.1.128"
}]

Command:

k3sup plan \
  --tls-san $SAN \
  --servers=3 \
  --user ubuntu \
  --background=true/false > bootstrap.sh

chmod +x bootstrap.sh

./bootstrap.sh

See testing below:

https://www.youtube.com/watch?v=o4UxRw-Cc8c&feature=youtu.be

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Additional notes required in README..

Future plans:

  • Additional flags from k3sup install/join should be added to k3sup plan
  • --yaml flag to be added as an option for human-generated inputs to k3sup plan

* plan can be used to generate a bash script to install a HA
cluster - a minimum set of options are included, PRs are welcome
to add anything else you may need
* node-token obtains a node token for k3sup join, which is
required when creating large clusters via automation, so that
there are not too many SSH connections created when it's not
required
* a helper method was added to obtain an SSH connection,
rather than repeating it in each command

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
This is required so that the temporary file, which is
potentially sensitive, gets cleaned up even if the function
exits early.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
This reduces the risk of the resulting file being committed

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
@alexellis alexellis merged commit 48c82b3 into master Oct 27, 2023
2 checks passed
@alexellis alexellis deleted the plan-command-node-token branch October 27, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant