Skip to content
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

Kubelet startup config flags deprecated - use config file instead #4

Closed
geerlingguy opened this issue May 10, 2018 · 10 comments · Fixed by #97
Closed

Kubelet startup config flags deprecated - use config file instead #4

geerlingguy opened this issue May 10, 2018 · 10 comments · Fixed by #97
Labels
enhancement New feature or request planned

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented May 10, 2018

From Kubelet's startup logs via journalctl -f, when running Kubernetes 1.10+:

Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Flag --resolv-conf has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.

See docs: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/

@geerlingguy
Copy link
Owner Author

(Same thing in 1.11... and 1.12 was just released.)

@geerlingguy geerlingguy changed the title Kubernetes 1.10 deprecates Kubelet startup config flags Kubelet startup config flags deprecated - use config file instead Sep 28, 2018
@strican
Copy link

strican commented Sep 17, 2019

Another point is that a user cannot pass in their own config file currently - you get the error can not mix '--config' with arguments [apiserver-advertise-address kubernetes-version pod-network-cidr]. If we used a config, users can override the config and have a baseline config template to copy from and add to.

@stale
Copy link

stale bot commented Mar 6, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Mar 6, 2020
@geerlingguy geerlingguy added enhancement New feature or request planned labels Mar 19, 2020
@stale
Copy link

stale bot commented Mar 19, 2020

This issue is no longer marked for closure.

1 similar comment
@stale
Copy link

stale bot commented Mar 19, 2020

This issue is no longer marked for closure.

@rdxmb
Copy link
Contributor

rdxmb commented Mar 22, 2021

As I understand it, we need to create a config-file and set --config <FILE> within the kubelet_args_line. Is this correct? Is there an idea to which path we deploy that config-file?

@rdxmb
Copy link
Contributor

rdxmb commented Mar 22, 2021

also: I think it would help to create the config file from the templates in the ansible-role instead of lineinfiles like it is in https://github.com/geerlingguy/ansible-role-kubernetes/blob/master/tasks/kubelet-setup.yml

Are there any plans doing that - or doing it in a completely different way?

@rdxmb
Copy link
Contributor

rdxmb commented Mar 22, 2021

Could we overwrite the line
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
in /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
to something like
Environment="KUBELET_CONFIG_ARGS=--config=/etc/kubernetes/kubelet-config.yaml"

and generate /etc/kubernetes/kubelet-config.yaml from template?

I think this would be the easiest way to parse variables to this file - as we can just parse them as 1:1 with jinja2-templates.

If you think this is a good way I could try to create a PR for that.

@geerlingguy
Copy link
Owner Author

That would be a good idea, yes, but likely it will break existing usage of the role, so it would need to be done in a major version bump or have some backwards compatibility added.

@rdxmb
Copy link
Contributor

rdxmb commented Mar 23, 2021

Ok, I started to create a PR like discussed above and started testing on my local machine.
However, I've just found, that the kubeletConfiguration can (and should?) be passed with using kubeadm init. See
Does anybody know if this is only for the croup driver? Do we want to use --config with kubeadm init or just with kubectl ?

What do you think?

Edit: Here is the link

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#configure-cgroup-driver-used-by-kubelet-on-control-plane-node

Or is this just for the cgroup-driver?

... confused ...

Edit again:

Seems like we need to use that with kubeadm init.

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request planned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants