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

Make server's data-dir configurable for getting node token in join command #388

Merged
merged 4 commits into from
Aug 26, 2022

Conversation

alexellis
Copy link
Owner

Signed-off-by: Alex Ellis (OpenFaaS Ltd) [email protected]

Description

Make data-dir configurable for getting node token

Why do you need this?

Three users, none of them are sponsors requested this feature in #373

When using a different data-dir for K3s on a server, the hard-coded node-token path fails to match a valid token file.

So this change allows the join command to override the value for the path.

Closes: #373

How Has This Been Tested?

I created two multipass VMs, running sudo mkdir -p /mnt/ssd/k3s on both.

On the server:

./k3sup install --local --ip 127.0.0.1 --k3s-extra-args "--data-dir /mnt/ssd/k3s"

On the agent:

./k3sup join --ip 127.0.0.1 \
  --user ubuntu \
  --server-ip 10.143.143.215 \
  --server-user ubuntu  \
  --k3s-extra-args "--data-dir /mnt/ssd/k3s" \
  --server-data-dir /mnt/ssd/k3s/

Originally, the command above failed with the error seen in the user's report.

Afterwards, it connected and worked as expected.

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:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

For future work, adding --data-dir as a first-class flag would mean less typing i.e. no need for --k3s-extra-args "--data-dir /mnt/ssd/k3s", instead it'd be --data-dir /mnt/ssd/k3s and then translated into the k3s extra args automatically, like other flags are today.

When using a different data-dir for K3s on a server, the
hard-coded node-token path fails to match a valid token file.

So this change allows the join command to override the value
for the path.

Closes: #373

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
@alexellis alexellis changed the title Make data-dir configurable for getting node token Make server's data-dir configurable for getting node token in join command Aug 26, 2022
K3sup used to have an app installation feature, which moved
into arkade a long time ago. These packages are no longer
used or required and can be removed.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
Change maintainers

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
@alexellis alexellis merged commit ab154f7 into master Aug 26, 2022
@alexellis alexellis deleted the server-data-dir-for-tokens branch August 26, 2022 11:15
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.

[Feature request] Configurable node token path for custom --data-dir installations of K3s
1 participant