rancher / rke2

https://docs.rke2.io/
Apache License 2.0
1.51k stars 264 forks source link

/etc/rancher/rke2/config.yaml is being ignored for disable-kube-proxy #6415

Closed BloodyIron closed 1 month ago

BloodyIron commented 1 month ago

Environmental Info:

Node(s) CPU architecture, OS, and Version:

Cluster Configuration:

I have a daemonset putting the contents into /etc/rancher/rke2/config.yaml on every node, and restarting rke2-server whenever it detects deviation from the contents. The single declaration is:

I also have the daemonset removing the file /var/lib/rancher/rke2/agent/pod-manifests/kube-proxy.yaml\

as per: https://gist.github.com/PhilipSchmid/c15e2c06b32022eaa90ed9b9262968d8

Another thing is after I restart rke2-server, the "true" value for "disable-kube-proxy" isn't being honoured. I know this because a) kube-proxy pods keep spinning back up, and b) the contents of /etc/rancher/rke2/config.yaml.d/50-rancher.yamlm says that "disable-kube-proxy" is set to "false".

I'm following the official documentation to the letter here and I cannot figure out why the results do not match the expectation. What am I missing here? :/

brandond commented 1 month ago

Reference the docs at: https://docs.rke2.io/install/configuration#multiple-config-files

The files in config.yaml.d override the main config.yaml file. If you want to override that value set by Rancher, you should do so in a file that is loaded after Rancher's config file. Although preferably you would do none of this, and manage your config through Rancher, since that is what Rancher is for.

BloodyIron commented 1 month ago

Reference the docs at: https://docs.rke2.io/install/configuration#multiple-config-files

The files in config.yaml.d override the main config.yaml file. If you want to override that value set by Rancher, you should do so in a file that is loaded after Rancher's config file. Although preferably you would do none of this, and manage your config through Rancher, since that is what Rancher is for.

The docs also say that 50-rancher.yaml is generated dynamically each time rke2-server is started and should not be modified at all as a result. I'm following the documentation. Please re-open, this is not working as intended.

brandond commented 1 month ago

The docs also say that 50-rancher.yaml is generated dynamically each time rke2-server is started

No, that file is generated by rancher-system-agent based on the configuration set by Rancher, and loaded by RKE2 on startup. The RKE2 docs do not mention that file at all, I'm not sure what you're talking about.

As I said, put your config in /etc/rancher/rke2/config.yaml.d/99-user.yaml (or any other file that sorts after the rancher-managed file) and it will be loaded after the Rancher-managed config.

BloodyIron commented 1 month ago

The docs also say that 50-rancher.yaml is generated dynamically each time rke2-server is started

No, that file is generated by rancher-system-agent based on the configuration set by Rancher, and loaded by RKE2 on startup. The RKE2 docs do not mention that file at all, I'm not sure what you're talking about.

As I said, put your config in /etc/rancher/rke2/config.yaml.d/99-user.yaml (or any other file that sorts after the rancher-managed file) and it will be loaded after the Rancher-managed config.

Alright well I'll try your recommendations, thanks! :) Maybe that was me getting muddled on that detail, sorry about that.

BloodyIron commented 1 week ago

Oh just so it is said, the method @brandond pointed me to for 99-whatever.yaml in /etc/rancher/rke2/config.yaml.d/ worked just fine for me! Thanks for that @brandond :)