-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Cannot apply KubeSchedulerConfiguration using config file on k3s startup #6301
Comments
You're using K3s 1.24 but trying to follow the Kubernetes 1.25 docs. Either upgrade to K3s 1.25, or reference the correct documentation version: |
Good catch, thanks! However, I don't understand why I'm running 1.24: this cluster was installed today with the commands and config file above, how come it didn't install k3s 1.25 then? Any specific config I need to set to get the latest version? |
We haven't released 1.25 to the |
Mmm, just nuked my cluster and tried to start with clean slate. Installed k3s with
Then k3s just tries to restart indefinitely... If I comment out the kube-scheduler-arg portion of the config file, then k3s starts successfully EDIT: Same thing is happening on a fresh install in the stable channel, with my scheduler-config.yaml file pointing to v1beta3 struct to make it 1.24 compatible. |
From reading the docs you linked to, it appears that the profiles value is supposed to be a list of profiles. This is also made clear by the error saying that it can't unmarshal your value to If you're having a hard time constructing yaml from the docs alone, you might want to find a working example config somewhere, and start from that. |
Agreed, this is indeed still new to me. So really appreciate your input already on this :). Uninstalled k3s on all nodes using the uninstall script. Testing for now only on 1 node. Allright so starting over:
I change topologyKey to kubernetes.io/hostname, since that is the maxSkew default value I want to overwrite (current default is 3 as mentioned here in the kubernetes docs) I place this file in /var/lib/scheduler/scheduler-config.yaml I define my config file, where I load in the scheduler-config.yaml:
Place that config file in /etc/rancher/k3s/config.yaml. I install k3s with k3s gets in a reboot loop with following error (retrieved from
If I comment out the following in my config file:
Then k3s starts successfully. So unable to change the defaults using an example config file in the kubernetes docs. Let me know if I need to provide anything more of config or logs. |
According to https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/, using |
Yeah I saw that in the docs, but all the parameters that mention it say DEPRECATED in front of them, so thought that k3s weren't using them. Allright so then a potential feature request to move from using options to run kube-scheduler to move over to a config file setup that users can modify if needed I presume? |
The CLI flags have been deprecated for several years and upstream has made no actual moves to remove them. They have declined to add any new flags though; use of new features usually requires a config file but migrating wholesale to config files instead of CLI flags is a ways out on our radar. For example, the current support we have for configuring components via |
Allright understood. Potential compromise to mention somewhere in the docs which flags you are using with kube-scheduler so that if people want to, can create their own config files out of them? I could deduce it from the logs, but would be difficult to do if flag usage (and especially the default values) would change between k3s releases. |
We don't change them very frequently, but the values will depend on your configuration. Pulling them out of the logs is probably the best way to go, to ensure that the values are correct for your specific cluster. It shouldn't be too hard since they are printed out during startup. |
Closing this as it appears the issue has been resolved. |
Environmental Info:
K3s Version:
k3s version v1.24.6+k3s1 (a8e0c66)
go version go1.18.6
Node(s) CPU architecture, OS, and Version:
Running 3 nodes in Ubuntu server VMs (1 physical machine, ryzen 5 3600, each VM has 6 gb of ram)
Linux demoa 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
3 master nodes which can also act as worker nodes.
Describe the bug:
Trying to apply the following configuration file for the kubescheduler, which is stored in /var/lib/scheduler/scheduler-config.yaml (as defined here: https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1/)
Booting k3s using a config file that has the following:
However, when starting up, the k3s service unit goes to a failed status and the following shows up in the logs:
Error: no kind "KubeSchedulerConfiguration" is registered for version "kubescheduler.config.k8s.io/v1" in scheme "k8s.io/apimachinery@v1.24.6-k3s1/pkg/r>
Steps To Reproduce:
curl -sfL https://get.k3s.io | sh -
Expected behavior:
K3s server starts up and kube-scheduler configuration is applied
Actual behavior:
k3s server fails to start with error
Error: no kind "KubeSchedulerConfiguration" is registered for version "kubescheduler.config.k8s.io/v1" in scheme "k8s.io/apimachinery@v1.24.6-k3s1/pkg
Additional context / logs:
Let me know if I need to provide anything further, but it either seems a bug or a configuration error on my end, but wouldn't know what then :s
The text was updated successfully, but these errors were encountered: