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

Node-based upgrade fails with: "Failed to template loop_control.label: 'None' has no attribute 'item'" #9703

Closed
renesepp opened this issue Jan 24, 2023 · 12 comments · Fixed by #10347
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@renesepp
Copy link

Environment:

  • Cloud provider or hardware configuration:
    Onprem VMware ESX
  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
Linux 4.18.0-372.19.1.el8_6.x86_64 x86_64
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
  • Version of Ansible (ansible --version):
    ansible [core 2.11.11]
  • Version of Python (python --version):
    Python 3.6.8

Kubespray version (commit) (git rev-parse --short HEAD):
c4346e590
Network plugin used:
Calico

Command used to invoke ansible:
ansible-playbook -i inventory/mycluster/hosts.yaml -b -e kube_version=v1.25.6 --become --become-user=root --ask-pass --ask become-pass upgrade-cluster.yml --limit "testk8-n3"
Output of ansible run:

TASK [kubernetes-apps/network_plugin/multus : Multus | Start resources] ************************************************************************************************************************************** failed: [testk8-n3 -> {{ groups['kube_control_plane'][0] }}] (item=None) => {"ansible_loop_var": "item", "changed": false, "item": null, "msg": "Failed to template loop_control.label: 'None' has no attribute 'item'", "skip_reason": "Conditional result was False"}
Anything else do we need to know:

Only happens when issuing --limit pattern(fine without --limit)
https://github.com/kubernetes-sigs/kubespray/blob/master/docs/upgrades.md#node-based-upgrade

@renesepp renesepp added the kind/bug Categorizes issue or PR as related to a bug. label Jan 24, 2023
@mvilche
Copy link

mvilche commented Feb 1, 2023

I have the same problem when updating a single node of the cluster.

TASK [kubernetes-apps/network_plugin/multus : Multus | Start resources] ********
failed: [kube-noprod-worker05 -> {{ groups['kube_control_plane'][0] }}] (item=None) => {"ansible_loop_var": "item", "changed": false, "item": null, "msg": "Failed to template loop_control.label: 'None' has no attribute 'item'", "skip_reason": "Conditional result was False"}

@splix
Copy link

splix commented Feb 2, 2023

I have the same issue when running with --limit. But seems to be working when I manually disable the plugin by running ansible with --skip-tags=multus

@splix
Copy link

splix commented Feb 2, 2023

It seems that with --limit it doesn't use the correct networking model. In my case it also had added the kube-proxy pods, and other things for a default model though I tried to setup with Cilium. When I run without a --limit it doesn't create such pods.

@ksyblast
Copy link

ksyblast commented Feb 22, 2023

I have the same issue when trying to setup a multi-node cluster with calico, kube_network_plugin_multus: false , I do not use --limit.

ansible-playbook  -i inventory/myinv/hosts.yml   cluster.yml    -D  --become --extra-vars'=ansible_ssh_timeout=50'

Installed from kubespray tag v2.21.0

@xinnj
Copy link

xinnj commented Feb 25, 2023

Met the same problem. Have to use '--skip-tags=multus' to skip it for now.

@vyom-soft
Copy link

I have the same issue when trying to setup a multi-node cluster with calico, kube_network_plugin_multus: false , I do not use --limit.

ansible-playbook  -i inventory/myinv/hosts.yml   cluster.yml    -D  --become --extra-vars'=ansible_ssh_timeout=50'

Installed from kubespray tag v2.21.0

Were you able to execute the ansible-playbook successfully for multi-node cluster. Or you also used that flag --skip-tags=multus

@ksyblast
Copy link

I have the same issue when trying to setup a multi-node cluster with calico, kube_network_plugin_multus: false , I do not use --limit.

ansible-playbook  -i inventory/myinv/hosts.yml   cluster.yml    -D  --become --extra-vars'=ansible_ssh_timeout=50'

Installed from kubespray tag v2.21.0

Were you able to execute the ansible-playbook successfully for multi-node cluster. Or you also used that flag --skip-tags=multus

I also used --skip-tags=multus

@yankay
Copy link
Member

yankay commented May 18, 2023

HI @maxime1907

Would you please provide a PR to resolve it :-)

@behdadkh
Copy link

I am on branch 2.22 and still do get this issue!

TASK [kubernetes-apps/network_plugin/multus : Multus | Start resources] ************************************************************************************************************************************** failed: [de-small-2 -> {{ groups['kube_control_plane'][0] }}] (item=None) => {"ansible_loop_var": "item", "changed": false, "item": null, "msg": "Failed to template loop_control.label: 'None' has no attribute 'item'", "skip_reason": "Conditional result was False"}

@ayoubeddafali
Copy link
Contributor

I can confirm that it still happens when upgrading only one node ( for some reason )

@MatthiasLohr
Copy link

Also still affected. No solution in sight?

@nicolas-goudry
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.