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
K8s_info module has wait_condition which works as expected when all nodes are up but when nodes are down and we sould like to wait , it doesn't work as expected.
$ oc get nodes
NAME STATUS ROLES AGE VERSION
master-0 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-1 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-2 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
worker-0-5fpfk NotReady worker 6d3h v1.28.7+f1b5f6c
worker-0-c694j Ready worker 6d3h v1.28.7+f1b5f6c
worker-0-r99dx NotReady worker 6d3h v1.28.7+f1b5f6c
- name: Wait for each node to be ready
kubernetes.core.k8s_info:
kind: Node
wait: yes
wait_condition:
reason: KubeletReady
type: Ready
status: True
wait_timeout: 30
wait_sleep: 10
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 211, in main
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 173, in execute_module
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py", line 304, in find
raise CoreException(
ansible_collections.kubernetes.core.plugins.module_utils.k8s.exceptions.CoreException: Failed to gather information about Node(s) even after waiting for 30 seconds
fatal: [127.0.0.1]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_key": null,
"api_version": "v1",
"ca_cert": null,
"client_cert": null,
"client_key": null,
"context": null,
"field_selectors": [],
"host": null,
"impersonate_groups": null,
"impersonate_user": null,
"kind": "Node",
"kubeconfig": null,
"label_selectors": [],
"name": null,
"namespace": null,
"no_proxy": null,
"password": null,
"persist_config": null,
"proxy": null,
"proxy_headers": null,
"username": null,
"validate_certs": null,
"wait": true,
"wait_condition": {
"reason": "KubeletReady",
"status": true,
"type": "Ready"
},
"wait_sleep": 10,
"wait_timeout": 30
}
},
"msg": "Failed to gather information about Node(s) even after waiting for 30 seconds"
}
Make sure more than two nodes are down
$ oc get nodes
NAME STATUS ROLES AGE VERSION
master-0 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-1 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-2 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
worker-0-5fpfk NotReady worker 6d3h v1.28.7+f1b5f6c
worker-0-c694j Ready worker 6d3h v1.28.7+f1b5f6c
worker-0-r99dx NotReady worker 6d3h v1.28.7+f1b5f6c
- name: Wait for each node to be ready
kubernetes.core.k8s_info:
kind: Node
wait: yes
wait_condition:
reason: KubeletReady
type: Ready
status: True
wait_timeout: 30
wait_sleep: 10
- name: Wait for each node to be ready
kubernetes.core.k8s_info:
kind: Node
wait: yes
wait_condition:
reason: KubeletReady
type: Ready
status: True
wait_timeout: 3
wait_sleep: 1
ignore_errors: True
EXPECTED RESULTS
Expected to work and collect some useful information instead of showing "msg": "Failed to gather information about Node(s) even after waiting for 3 seconds"
ACTUAL RESULTS
I tried with longer wait time but it never collects node information and never populates which node is not ready or any useful data
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 223, in main
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 183, in execute_module
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py", line 326, in find
raise CoreException(
ansible_collections.kubernetes.core.plugins.module_utils.k8s.exceptions.CoreException: Failed to gather information about Node(s) even after waiting for 3 seconds
fatal: [127.0.0.1]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_key": null,
"api_version": "v1",
"ca_cert": null,
"client_cert": null,
"client_key": null,
"context": null,
"field_selectors": [],
"hidden_fields": null,
"host": null,
"impersonate_groups": null,
"impersonate_user": null,
"kind": "Node",
"kubeconfig": null,
"label_selectors": [],
"name": null,
"namespace": null,
"no_proxy": null,
"password": null,
"persist_config": null,
"proxy": null,
"proxy_headers": null,
"username": null,
"validate_certs": null,
"wait": true,
"wait_condition": {
"reason": "KubeletReady",
"status": true,
"type": "Ready"
},
"wait_sleep": 1,
"wait_timeout": 3
}
},
"msg": "Failed to gather information about Node(s) even after waiting for 3 seconds"
}
...ignoring
The text was updated successfully, but these errors were encountered:
SUMMARY
K8s_info module has wait_condition which works as expected when all nodes are up but when nodes are down and we sould like to wait , it doesn't work as expected.
$ oc get nodes
NAME STATUS ROLES AGE VERSION
master-0 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-1 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-2 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
worker-0-5fpfk NotReady worker 6d3h v1.28.7+f1b5f6c
worker-0-c694j Ready worker 6d3h v1.28.7+f1b5f6c
worker-0-r99dx NotReady worker 6d3h v1.28.7+f1b5f6c
- name: Wait for each node to be ready kubernetes.core.k8s_info: kind: Node wait: yes wait_condition: reason: KubeletReady type: Ready status: True wait_timeout: 30 wait_sleep: 10
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 211, in main
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 173, in execute_module
File "/tmp/ansible_kubernetes.core.k8s_info_payload_grhofqoz/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py", line 304, in find
raise CoreException(
ansible_collections.kubernetes.core.plugins.module_utils.k8s.exceptions.CoreException: Failed to gather information about Node(s) even after waiting for 30 seconds
fatal: [127.0.0.1]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_key": null,
"api_version": "v1",
"ca_cert": null,
"client_cert": null,
"client_key": null,
"context": null,
"field_selectors": [],
"host": null,
"impersonate_groups": null,
"impersonate_user": null,
"kind": "Node",
"kubeconfig": null,
"label_selectors": [],
"name": null,
"namespace": null,
"no_proxy": null,
"password": null,
"persist_config": null,
"proxy": null,
"proxy_headers": null,
"username": null,
"validate_certs": null,
"wait": true,
"wait_condition": {
"reason": "KubeletReady",
"status": true,
"type": "Ready"
},
"wait_sleep": 10,
"wait_timeout": 30
}
},
"msg": "Failed to gather information about Node(s) even after waiting for 30 seconds"
}
ISSUE TYPE
COMPONENT NAME
kubernetes.core.k8s_info
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
$ cat /etc/os-release
NAME="CentOS Stream"
VERSION="9"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="9"
PLATFORM_ID="platform:el9"
PRETTY_NAME="CentOS Stream 9"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:centos:centos:9"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
STEPS TO REPRODUCE
$ oc get nodes
NAME STATUS ROLES AGE VERSION
master-0 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-1 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
master-2 Ready control-plane,master 6d4h v1.28.7+f1b5f6c
worker-0-5fpfk NotReady worker 6d3h v1.28.7+f1b5f6c
worker-0-c694j Ready worker 6d3h v1.28.7+f1b5f6c
worker-0-r99dx NotReady worker 6d3h v1.28.7+f1b5f6c
- name: Wait for each node to be ready kubernetes.core.k8s_info: kind: Node wait: yes wait_condition: reason: KubeletReady type: Ready status: True wait_timeout: 30 wait_sleep: 10
EXPECTED RESULTS
Expected to work and collect some useful information instead of showing "msg": "Failed to gather information about Node(s) even after waiting for 3 seconds"
ACTUAL RESULTS
I tried with longer wait time but it never collects node information and never populates which node is not ready or any useful data
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 223, in main
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/modules/k8s_info.py", line 183, in execute_module
File "/tmp/ansible_kubernetes.core.k8s_info_payload_5469sl6c/ansible_kubernetes.core.k8s_info_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py", line 326, in find
raise CoreException(
ansible_collections.kubernetes.core.plugins.module_utils.k8s.exceptions.CoreException: Failed to gather information about Node(s) even after waiting for 3 seconds
fatal: [127.0.0.1]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_key": null,
"api_version": "v1",
"ca_cert": null,
"client_cert": null,
"client_key": null,
"context": null,
"field_selectors": [],
"hidden_fields": null,
"host": null,
"impersonate_groups": null,
"impersonate_user": null,
"kind": "Node",
"kubeconfig": null,
"label_selectors": [],
"name": null,
"namespace": null,
"no_proxy": null,
"password": null,
"persist_config": null,
"proxy": null,
"proxy_headers": null,
"username": null,
"validate_certs": null,
"wait": true,
"wait_condition": {
"reason": "KubeletReady",
"status": true,
"type": "Ready"
},
"wait_sleep": 1,
"wait_timeout": 3
}
},
"msg": "Failed to gather information about Node(s) even after waiting for 3 seconds"
}
...ignoring
The text was updated successfully, but these errors were encountered: