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
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
What happened?
When i deploy from scratch a cluster i have this error:
When i comment this code, it works:
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
The text was updated successfully, but these errors were encountered: