You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playbook cluster.yml crash on Kubeadm | Create kubeadm config when systemd-resolved is not running because /run/systemd/resolve/resolv.conf file is missing.
What did you expect to happen?
Kubespray will configure kubelet to use /etc/resolv.conf instead of missing /run/systemd/resolve/resolv.conf,
How can we reproduce it (as minimally and precisely as possible)?
Run cluster.yml on kube nodes running Ubuntu 24.04 with systemd-resolved masked.
Problem is that in roles/kubernetes/preinstall/tasks/main.yml there is detection if systemd-resolved is running but it is only used to detect if include 0060-resolvconf.yml or 0061-systemd-resolved.yml.
But in roles/kubernetes/node/tasks/facts.yml is included OS specific var file from roles/kubernetes/node/vars and in that file resolvconf path is hardcoded for most distributions to /run/systemd/resolve/resolv.conf.
And it cause kubelet fail to create any container.
On control-plane servers this cause kubelet can not create any container with error:
Dec 17 14:01:15 XXX-prod-master1 kubelet[25126]: E1217 14:01:15.267321 25126 dns.go:284] "Could not open resolv conf file." err="open /run/systemd/resolve/resolv.conf: no such file or directory"
Dec 17 14:01:15 XXX-prod-master1 kubelet[25126]: E1217 14:01:15.267332 25126 kuberuntime_sandbox.go:45] "Failed to generate sandbox config for pod" err="open /run/systemd/resolve/resolv.conf: no such file or directory" pod="kube-system/kube-controller-manager-XXX-prod-master1"
Dec 17 14:01:15 XXX-prod-master1 kubelet[25126]: E1217 14:01:15.267342 25126 kuberuntime_manager.go:1166] "CreatePodSandbox for pod failed" err="open /run/systemd/resolve/resolv.conf: no such file or directory" pod="kube-system/kube-controller-manager-XXX-prod-master1"
Dec 17 14:01:15 XXX-prod-master1 kubelet[25126]: E1217 14:01:15.267361 25126 pod_workers.go:1298] "Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"kube-controller-manager-XXX-prod-master1_kube-system(bce3ce42e0aef110c5773ef4027de42c)\" with CreatePodSandboxError: \"Failed to generate sandbox config for pod \\\"kube-controller-manager-XXX-prod-master1_kube-system(bce3ce42e0aef110c5773ef4027de42c)\\\": open /run/systemd/resolve/resolv.conf: no such file or directory\"" pod="kube-system/kube-controller-manager-XXX-prod-master1" podUID="bce3ce42e0aef110c5773ef4027de42c"
When systemd-resolved is not running on worker nodes, any container is stuck in ContainerCreating state with error:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m52s default-scheduler Successfully assigned kube-system/kube-proxy-6hnnc to XXX-prod-worker2
Warning FailedCreatePodSandBox 44s (x26 over 5m52s) kubelet Failed to create pod sandbox: open /run/systemd/resolve/resolv.conf: no such file or directory
The text was updated successfully, but these errors were encountered:
What happened?
Playbook cluster.yml crash on
Kubeadm | Create kubeadm config
when systemd-resolved is not running because/run/systemd/resolve/resolv.conf
file is missing.What did you expect to happen?
Kubespray will configure kubelet to use
/etc/resolv.conf
instead of missing/run/systemd/resolve/resolv.conf
,How can we reproduce it (as minimally and precisely as possible)?
Run cluster.yml on kube nodes running Ubuntu 24.04 with systemd-resolved masked.
OS
Version of Ansible
Version of Python
Python 3.12.3
Version of Kubespray (commit)
kubespray-2.26.0
Network plugin used
calico
Full inventory with variables
Default kubespray-2.26.0 variables
Command used to invoke ansible
ansible-playbook -i inventory/cluster/inventory.ini cluster.yml
Output of ansible run
Anything else we need to know
Problem is that in
roles/kubernetes/preinstall/tasks/main.yml
there is detection if systemd-resolved is running but it is only used to detect if include0060-resolvconf.yml
or0061-systemd-resolved.yml
.But in
roles/kubernetes/node/tasks/facts.yml
is included OS specific var file fromroles/kubernetes/node/vars
and in that file resolvconf path is hardcoded for most distributions to/run/systemd/resolve/resolv.conf
.And it cause kubelet fail to create any container.
When systemd-resolved is not running on worker nodes, any container is stuck in ContainerCreating state with error:
The text was updated successfully, but these errors were encountered: