-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
using double quotes instead of single quotes for k3s_exec args #947
Conversation
this enables the use of shell features to dynamically determine for example taints
@aleksasiriski @mysticaltech could you review this tiny change? |
Hey @schlichtanders, thanks for this, will do ASAP tonight. What do you think about upgrade scenarios? Currently, we have a pending feature request to make changing kube.tf values update the k3s config.yaml. Currently this is not done, but we do something similar for k3s_registries.yaml so it's doable in a robust way. It may need to be achieved before we merge this, as to allow for upgradability without having to edit the config.yaml manually in each node. |
Thank you for the comment. That is actually super valuable. I think having a user configurable way to change the k3s config.yaml flexibly is better than this pullrequest.
So apparently, to change a kubelet or label or taint with args is super complicated and error prone because people would need to copy those from the config.yaml anyway. Hence given this new state, I am actually rather for closing this one and go for the configurability of the k3s config.yaml instead. Which other pullrequest is it? |
Just found that k3s actually supports multiple config files which can overwrite each other. |
@schlichtanders What I was reffering to was this issue #850, but yes, it's super interesting that multiple config.yaml files are supported. However, I think this PR is good, but I just need to implement the config.yaml update feature first to make upgrades to the new version possible without requiring manual edits of the file (that will get done automatically, so basically no need to play with many files). To see how that will work, you can take a look at the k3s_registries.yaml logic, it involves some bash scripting to make sure the logic is robust. |
@schlichtanders Just for clarity, will try to merge this on the week-end after I have shipped the pre-required feature as described above. |
I haven't needed this for the restoration. Still I want to check in, because it would be great if this could either be closed with a reason, or merged. |
@schlichtanders Most definitely we will merge it soon. I'm just waiting to have some hours to focus on this, as it's pending a feature request as explained above. This is coming, I hope this week if I can manage. |
@schlichtanders Is this no longer needed, the k3s dynamic update after first launch was just merged. But I see 0 change here. Please add back a new PR if needed. |
This enables the use of shell features inside the
k3s_exec_server_args
andk3s_exec_agent_args
.One example usecase is the automatic tainting of a node if it cannot connect to the standard image registries.
Previous discussions:
k3s agent
args #862Discussion
Advantage:
Downside:
\\\"
in terraform or(a bit complex, but the EOF wayaround seems okay enough)
Alternatives considered
I tried other ways of filling variables with content without using quotes at all, but the edgecase where too numerous and hard to follow. I think it is best to decide for double quotes.
One could also make the quotechar configurable. I tried this, but the resulting terraform code looks hard to understand and only a tiny few will ever use this. Hence I argue for changing to double quotes straight away.