-
Notifications
You must be signed in to change notification settings - Fork 100
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
📖 k3s node name is different from hostname #576
Comments
We don't seem to pass any default value for I'm wondering if nodeID is important in this case and if we should keep it. Let's see what |
What we do by default is: https://github.com/kairos-io/provider-kairos/blob/0d636d2b2cd424eee5961b6fc14c4842ef74073d/internal/role/p2p/worker.go#L71 which causes this - it is by default in order to avoid collisions if the same hostname is given to multiple nodes. To override the default logic you can set |
@Ognian the default behavior targets less experienced users that shouldn't have to configure too many things. For the experienced ones, there is We will document the use of that flag. Are you ok with this plan? |
@jimmykarily yes, sounds reasonable |
@jimmykarily after power cut off I was not able to get the worker node up and running in the cluster. There is a chance that this was due to generating a different node name, after getting up again, maybe something in the state got corrupted … #1227 was also the result of this power cut off… Could you tell me how to configure a fixed node name? |
@Ognian with this config:
I got this node:
I used this image: https://github.com/kairos-io/provider-kairos/releases/download/v1.6.1/kairos-opensuse-leap-v1.6.1-k3sv1.21.14+k3s1.iso Is this what you need? I'll see if I can put it somewhere in the docs as a hint. |
Fixes #576 Signed-off-by: Dimitris Karakasilis <[email protected]>
PR: #1244 |
@jimmykarily in my case the raspberry pi is the worker not the master. |
From the same page:
I think it will work similarly for all your nodes. For the rest of the flags, what we do in code seems to complex to achieve manually. I've put the documentation for the "hardcoded" node name in the single-node setup for this reason. I don't think this manual solution works well in multi-node setups where they have to discover each other etc. (thus having to figure out multiple k3s args) If we want to support setting node names manually on multi-node clusters, I think we need to expose a special configuration option for that. cc @mudler |
maybe we could add some templating sugar, as we have already for hostnames and other fields 🤔 |
* Add a note on how to set a hardcoded k3s node name Fixes #576 Signed-off-by: Dimitris Karakasilis <[email protected]> * Convert parenthesis to an "alert" Signed-off-by: Dimitris Karakasilis <[email protected]> --------- Signed-off-by: Dimitris Karakasilis <[email protected]>
Closed by the merged PR automatically. Re-opening until we decide how to move forward. |
OK I finally understood what was really going on:
We want the other needed k3s parameters to be set. Actually the only thing which should be documented is the fact that it works exactly like I described and that it is intentional. |
When you specify k3s args, you are essentially replacing the default one. In other words, if you want to specify one, you are switching to "manual" mode which means you need to pass all the needed args including @mauromorales am I correct? |
just to clarify: |
As far as I can tell, this case would override them: |
Ahh, OK my fault. |
@mudler @jimmykarily do you know which parameters would need to be set? |
No, I'd have to follow the code and collect them all :( . Maybe Ettore's suggestion with the templating (see previous comments in this issue) is the best way to solve this. This needs to be coded of course. As a workaround for now, a fast way to collect them all would be to let the agent spin up the k3s agent with the current config and then check the running process to see what flags were passed. Then change the config to pass the same args with Since we don't have templating for the node name, this means, each node will need to be deployed with a different kairos config. |
Kairos version:
NAME="kairos-opensuse-arm-rpi"
VERSION="v1.3.2-k3sv1.25.4+k3s1"
ID="kairos"
ID_LIKE="kairos-opensuse-arm-rpi"
VERSION_ID="v1.3.2-k3sv1.25.4+k3s1"
PRETTY_NAME="kairos-opensuse-arm-rpi v1.3.2-k3sv1.25.4+k3s1"
ANSI_COLOR="0;32"
BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues/new/choose"
HOME_URL="https://github.com/kairos-io/provider-kairos"
IMAGE_REPO="quay.io/kairos/kairos-opensuse-arm-rpi"
IMAGE_LABEL="latest"
GITHUB_REPO="kairos-io/provider-kairos"
VARIANT="core"
FLAVOR="opensuse"
CPU architecture, OS, and Version:
Linux rpi4node 5.14.21-150400.24.33-default #1 SMP PREEMPT_DYNAMIC Fri Nov 4 13:55:06 UTC 2022 (76cfe60) aarch64 aarch64 aarch64 GNU/Linux
Describe the bug
k3s node name should be the same like the host name
host name is: rpi4node
node name is: rpi4node-ec2407ca
To Reproduce
Expected behavior
Logs
Additional context
The text was updated successfully, but these errors were encountered: