Destination /etc/default/kubelet does not exist Destination /etc/default/kubelet does not exist kubernetes kubernetes

Destination /etc/default/kubelet does not exist


The error occurs, because /etc/default/kubelet does not exist on the VMs. Add create: yes to the "Configure node ip" tasks in master-playbook.yml and node-playbook.yml, so that they look like this:

  - name: Configure node ip    lineinfile:      path: /etc/default/kubelet      line: KUBELET_EXTRA_ARGS=--node-ip={{ node_ip }}      create: yes

This way, the file will be created if it does not exist.


I found this generic ansible-playbook I see at git that generally follows the official manual. Initially, it was created (half year ago?) for ubuntu 16.04. I tried to run (instructions from official manual) against ubuntu 18 (as you using bionic), but I should say, there is no /etc/default/kubelet installed (after apt install ...).

Update:

And here is why...

P.S.I would suggest using Kubespray as local vagrant/kubernetes setup, but it's because it just works from the box.


You are following the tutorial on kubernetes.io.

I got the same error as you:

"Destination /etc/default/kubelet does not exist".

Just look at the instructions here.You need to adjust the playbook slightly to the other instructions:

  • Change the line: kubeadm init --apiserver-advertise-address="192.168.50.10" --apiserver-cert-extra-sans="192.168.50.10" --node-name k8s-master --pod-network-cidr=192.168.0.0/16" according to the other instruction to kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address="192.168.50.10"

The result will be a join command that you need to register and re-use to join the two worker nodes.