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

Kubernetes 1.11 changes the way KUBELET_EXTRA_ARGS works #15

Closed
geerlingguy opened this issue Sep 7, 2018 · 4 comments
Closed

Kubernetes 1.11 changes the way KUBELET_EXTRA_ARGS works #15

geerlingguy opened this issue Sep 7, 2018 · 4 comments

Comments

@geerlingguy
Copy link
Owner

Apparently in Kubernetes 1.11, the /etc/systemd/system/kubelet.service.d/10-kubeadm.conf file changed slightly; there is now a section:

# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet

And the contents of that file are, by default:

KUBELET_EXTRA_ARGS=

So the configuration in this role needs to be directed at /etc/default/kubelet instead of /etc/systemd/system/kubelet.service.d/10-kubeadm.conf. 🤦‍♂️

@geerlingguy
Copy link
Owner Author

I ran into this because commands like kubectl logs [pod name] and kubectl exec were returning errors like:

root@master:/home/vagrant# kubectl logs a4d-nginx-67594d6bf6-9vfh6
Error from server (NotFound): the server could not find the requested resource ( pods/log a4d-nginx-67594d6bf6-9vfh6)

root@master:/home/vagrant# kubectl exec a4d-nginx-67594d6bf6-9vfh6 date
error: unable to upgrade connection: pod does not exist

@geerlingguy
Copy link
Owner Author

After a ton of fruitless searches, I found this comment: kubernetes/kubeadm#203 (comment) (which led me to reading the systemd unit file more closely). Testing a fix now... this will make the role incompatible with 1.10, at least if the user sets a value for kubernetes_kubelet_extra_args...

@geerlingguy
Copy link
Owner Author

After editing the correct file:

root@master:/home/vagrant# kubectl get nodes -o wide
NAME      STATUS    ROLES     AGE       VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                       KERNEL-VERSION   CONTAINER-RUNTIME
master    Ready     master    19m       v1.11.2   192.168.84.2   <none>        Debian GNU/Linux 9 (stretch)   4.9.0-8-amd64    docker://18.6.1
node1     Ready     <none>    18m       v1.11.2   192.168.84.3   <none>        Debian GNU/Linux 9 (stretch)   4.9.0-8-amd64    docker://18.6.1
node2     Ready     <none>    18m       v1.11.2   192.168.84.4   <none>        Debian GNU/Linux 9 (stretch)   4.9.0-8-amd64    docker://18.6.1

@geerlingguy
Copy link
Owner Author

And now logs and all the other commands work correctly.

vulturm pushed a commit to vulturm/ansible-role-kubernetes that referenced this issue Mar 23, 2020
=============================================
This represents the squashed history as it is not too relevant for us..

Below are all the commit messages:
=============================================

Change a line to trigger a Travis CI build.

A few small fixes for automated test builds.

More updates to make things work better in various situations.

Fix idempotence for web ui enablement.

Fix dashboard UI service.

Fix kube utils installation not working on Debian.

Fix install on CentOS 7.

Fix idempotence for Flannel networking task.

Really fix idempotence for Flannel tasks, and get CentOS mostly working.

Add more variables and docs.

Space in the defaults file. [ci skip]

Issue geerlingguy#3: Allow failures on CentOS 7 Travis CI build for now.

Fixes geerlingguy#2: Make role work with nodes joining master.

Spellcheck.

Reload kubelet unit file if config is changed.

Fixes geerlingguy#3: CentOS builds now passing.

Change order when applying flannel templates.

Issue geerlingguy#5: Add more configuration ability to default Flannel network manifests.

Tick kubernetes stable version up from 1.10 to 1.11

Fixes geerlingguy#10: Set kubernetes_join_command more reliably.

Fixes geerlingguy#15: Add kubelet extra args to the correct file for 1.11 and beyond.

Fixes geerlingguy#16: CentOS 7 configuration of KUBELET_EXTRA_ARGS was broken.

Update master-setup.yml

Add option for additional kubeadm init options

Update main.yml

kubeadm_init_opts default value

Changes for the comments under PR geerlingguy#19

Switch tests to use Molecule.

Issue geerlingguy#17: Attempt to fix installation on CentOS.

Issue geerlingguy#18: Attempt to fix version pinning issues on RedHat and Debian.

Fix boolean on Debian setup, add more tests.

Fixing lint issues

incredibly sloppy day.

fix typo kuberenetes

PR geerlingguy#24 follow-up: Use verbosity instead of debug variable for debug info.

Update tests for optimum efficiency.

Fix YAML error in molecule config.

Fixes failing Ubuntu 18.04 test.

Fix some new ansible-lint issues.

Issue geerlingguy#33: Set default Kubernetes version to 1.13.1.

Bump Kubernetes RHEL package to 1.13.3.

Fix ansible-lint issue - ignore rule 306.

Update kubelet-setup.yml

geerlingguy#42

Use same options for all tests and default to Ansible IP correctly.

Remove unused tests.

Fixes geerlingguy#54: Update to Kubernetes 1.15.

Fixes geerlingguy#55: Support and test Debian 10 Buster.

Fix typo referenced in geerlingguy#49

Update main.yml

Create FUNDING.yml

YAML syntax fix.

Add kubernetes_join_command_extra_opts variable.

calico cni choice

PR geerlingguy#53 follow-up: Requested changes for simplicity.

PR geerlingguy#53 follow-up: Add test for calico networking.

PR geerlingguy#53 follow-up: Remove extra conditional.

Bump to Kubernetes 1.16.

Default to calico 3.10 manifest.

PR geerlingguy#53 follow-up: Remove extra unneccessary loop.

Fix README formatting.

Add a test for CentOS 8.

Update molecule configuration to work with 3.0.

Update molecule configuration to work with 3.0.

Update molecule configuration to work with 3.0.

Make sure molecule lint script has set -e option.

Add probot/stale configuration to repository for stale issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant