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

00040-verify failed when kube_node is empty #11245

Closed
lenglet-k opened this issue May 29, 2024 · 0 comments · Fixed by #11248
Closed

00040-verify failed when kube_node is empty #11245

lenglet-k opened this issue May 29, 2024 · 0 comments · Fixed by #11248
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@lenglet-k
Copy link

lenglet-k commented May 29, 2024

What happened?

When i deploy from scratch a cluster i have this error:

TASK [kubernetes_sigs.kubespray.kubernetes/preinstall : Stop if either kube_control_plane or kube_node group is empty] **********************************************************************************************
ok: [control-plane-recette-1.x.z] => (item=kube_control_plane) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": "kube_control_plane",
    "msg": "All assertions passed"
}
failed: [control-plane-recette-1.x.z] (item=kube_node) => {
    "ansible_loop_var": "item",
    "assertion": "groups.get( item )",
    "changed": false,
    "evaluated_to": false,
    "item": "kube_node",
    "msg": "Assertion failed"
}

When i comment this code, it works:

 - name: Stop if either kube_control_plane or kube_node group is empty
   assert:
     that: "groups.get( item )"
   with_items:
     - kube_control_plane
     - kube_node
   run_once: true
   when: not ignore_assert_errors

What did you expect to happen?

it seems to be because my “kube_node” group is empty. Except that I start by installing my control-plane nodes first

How can we reproduce it (as minimally and precisely as possible)?

Deploy an environment with an inventory where kube_node group is empty

OS

printf "$(uname -srm)\n$(cat /etc/os-release)\n"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.9"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"

Version of Ansible

ansible [core 2.16.7]
config file = /home/user/Documents/localLabs/kubespray/ansible.cfg
configured module search path = ['/home/user/Documents/localLabs/kubespray/library']
ansible python module location = /home/user/miniconda3/lib/python3.11/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /home/user/miniconda3/bin/ansible
python version = 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0] (/home/user/miniconda3/bin/python)
jinja version = 3.1.4
libyaml = True

Version of Python

Python 3.11.5

Version of Kubespray (commit)

7e0a407

Network plugin used

calico

Full inventory with variables

control-plane-recette-1.x.z | SUCCESS => {
"hostvars[inventory_hostname]": {
"ansible_check_mode": false,
"ansible_config_file": null,
"ansible_diff_mode": false,
"ansible_facts": {},
"ansible_forks": 5,
"ansible_host": "192.12.13.4",
"ansible_inventory_sources": [
"myDir/hosts.ini"
],
"ansible_playbook_python": "myUser/miniconda3/bin/python",
"ansible_user": "rocky",
"ansible_verbosity": 0,
"ansible_version": {
"full": "2.16.7",
"major": 2,
"minor": 16,
"revision": 7,
"string": "2.16.7"
},
"envId": "recette-1",
"etcd_member_name": "etcd1",
"group_names": [
"etcd",
"k8s_cluster",
"kube_control_plane"
],
"groups": {
"all": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"calico_rr": [],
"etcd": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"k8s_cluster": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_control_plane": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_node": [],
"ungrouped": []
},
"inventory_dir": "myDir",
"inventory_file": "myDir/hosts.ini",
"inventory_hostname": "control-plane-recette-1.x.z",
"inventory_hostname_short": "control-plane-recette-1",
"ip": "192.12.13.4",
"omit": "__omit_place_holder__fc79e47029e71440816155bcad70394ce84c036d",
"playbook_dir": "myDir",
"projectId": "control-plane"
}
}
control-plane-recette-2.x.z | SUCCESS => {
"hostvars[inventory_hostname]": {
"ansible_check_mode": false,
"ansible_config_file": null,
"ansible_diff_mode": false,
"ansible_facts": {},
"ansible_forks": 5,
"ansible_host": "192.12.13.5",
"ansible_inventory_sources": [
"myDir/hosts.ini"
],
"ansible_playbook_python": "myUser/miniconda3/bin/python",
"ansible_user": "rocky",
"ansible_verbosity": 0,
"ansible_version": {
"full": "2.16.7",
"major": 2,
"minor": 16,
"revision": 7,
"string": "2.16.7"
},
"envId": "recette-2",
"etcd_member_name": "etcd2",
"group_names": [
"etcd",
"k8s_cluster",
"kube_control_plane"
],
"groups": {
"all": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"calico_rr": [],
"etcd": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"k8s_cluster": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_control_plane": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_node": [],
"ungrouped": []
},
"inventory_dir": "myDir",
"inventory_file": "myDir/hosts.ini",
"inventory_hostname": "control-plane-recette-2.x.z",
"inventory_hostname_short": "control-plane-recette-2",
"ip": "192.12.13.5",
"omit": "__omit_place_holder__fc79e47029e71440816155bcad70394ce84c036d",
"playbook_dir": "myDir",
"projectId": "control-plane"
}
}
control-plane-recette-3.x.z | SUCCESS => {
"hostvars[inventory_hostname]": {
"ansible_check_mode": false,
"ansible_config_file": null,
"ansible_diff_mode": false,
"ansible_facts": {},
"ansible_forks": 5,
"ansible_host": "192.23.13.6",
"ansible_inventory_sources": [
"myDir/hosts.ini"
],
"ansible_playbook_python": "myUser/miniconda3/bin/python",
"ansible_user": "rocky",
"ansible_verbosity": 0,
"ansible_version": {
"full": "2.16.7",
"major": 2,
"minor": 16,
"revision": 7,
"string": "2.16.7"
},
"envId": "recette-3",
"etcd_member_name": "etcd3",
"group_names": [
"etcd",
"k8s_cluster",
"kube_control_plane"
],
"groups": {
"all": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"calico_rr": [],
"etcd": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"k8s_cluster": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_control_plane": [
"control-plane-recette-1.x.z",
"control-plane-recette-2.x.z",
"control-plane-recette-3.x.z"
],
"kube_node": [],
"ungrouped": []
},
"inventory_dir": "myDir",
"inventory_file": "myDir/hosts.ini",
"inventory_hostname": "control-plane-recette-3.x.z",
"inventory_hostname_short": "control-plane-recette-3",
"ip": "192.12.13.6",
"omit": "__omit_place_holder__fc79e47029e71440816155bcad70394ce84c036d",
"playbook_dir": "myDir",
"projectId": "control-plane"
}
}

Command used to invoke ansible

ansible-playbook -i recette/hosts.ini --become --become-user=root recette/control-plane/install_control_plane.yaml

Output of ansible run

TASK [kubernetes_sigs.kubespray.kubernetes/preinstall : Stop if either kube_control_plane or kube_node group is empty] **********************************************************************************************
ok: [control-plane-recette-1.x.z] => (item=kube_control_plane) => {
"ansible_loop_var": "item",
"changed": false,
"item": "kube_control_plane",
"msg": "All assertions passed"
}
failed: [control-plane-recette-1.x.z] (item=kube_node) => {
"ansible_loop_var": "item",
"assertion": "groups.get( item )",
"changed": false,
"evaluated_to": false,
"item": "kube_node",
"msg": "Assertion failed"

Anything else we need to know

No response

@lenglet-k lenglet-k added the kind/bug Categorizes issue or PR as related to a bug. label May 29, 2024
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.

1 participant