-
Notifications
You must be signed in to change notification settings - Fork 370
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
k0s kubeconfig
ignores config value for the external address
#1202
Comments
This issue stems from an old problem that the dynamic configuration feature was supposed to fix, but with the current implementation still needs to be addressed. Background
Since dynamic configuration is disabled by default, the configuration is then fed to k0s using the 1st method, and since this configuration is not persistent, the Default ValuesIf a configuration file is not provided, Root CauseThis problem above is not directly related to dynamic configuration at all. It is caused by starting the cluster with a custom externalAddress configuration (I.E. custom config file) and not running the Config ParsingCurrently, for almost every k0s command we run, the following logic applies:
This logic is flawed, since it still requires the user to feed in the custom configuration file for each k0s command line option. If the user forgets, the outcome is unpredictable. I would like to suggest that we:
Mitigation OptionsThe requirement to feed in a config-file for each command is problematic, and is prone to user mistakes. Runtime Config file
System-wide Config file
|
The idea with system-wide config is to change the docs to say something like:
Which basically means that the docs provides an opinion to where the config file should be instead of saying Then we change the logic in
This will not solve the problem for current installs which have the config file in custom location (eg However it will solve the issue for new and future installs, using the doc. We could optionally also modify |
As an option to this we could use |
Wouldn't that mean that a user would only be able to update the configuration by editing |
correct. yes, this may be confusing. I'm just throwing out ideas here, including bad ideas 😄 We could overwrite this file every time k0s starts, similar to what we'd need to do with |
On a discussion with @jnummelin, we've come up with sort of a merge of the two approaches listed above:
|
k0s kubeconifg
ignores config value for the external addressk0s kubeconfig
ignores config value for the external address
The issue is marked as stale since no activity has been recorded in 30 days |
Add a test to verify that the server address is set to externalAddress when it is set, and that the custom ports are included in the kubeconfig. This is a test for issue k0sproject#1202 Signed-off-by: Natanael Copa <[email protected]>
The issue is marked as stale since no activity has been recorded in 30 days |
Add a test to verify that the server address is set to externalAddress when it is set, and that the custom ports are included in the kubeconfig. This is a test for issue k0sproject#1202 Signed-off-by: Natanael Copa <[email protected]>
Add a test to verify that the server address is set to externalAddress when it is set, and that the custom ports are included in the kubeconfig. This is a test for issue k0sproject#1202 Signed-off-by: Natanael Copa <[email protected]>
Add a test to verify that the server address is set to externalAddress when it is set, and that the custom ports are included in the kubeconfig. This is a test for issue k0sproject#1202 Signed-off-by: Natanael Copa <[email protected]>
Version
Current main head
Platform
Which platform did you run k0s on?
What happened?
I use following cluster configuration with set up external address:
Whenever I use
k0s kubeconfig
command to have kubeclient config, either for admin or by usingk0s kubeconfig create username
, I expect to see external address in the returned kubeconfig, but I get the internal address (10.0.0.24).The text was updated successfully, but these errors were encountered: