generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 140
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
k8s_drain not waiting for pod deletion if there is only one pod to evict #769
Comments
patchback bot
pushed a commit
that referenced
this issue
Dec 11, 2024
SUMMARY Fixes #769 . k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained. The list of pods, pods, was being "popped" before the first iteration of the while loop: pod = pods.pop() while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods: When pods contains only one element, the while loop is skipped. ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_drain Reviewed-by: Mike Graves <mgraves@redhat.com> (cherry picked from commit 4c305e7)
patchback bot
pushed a commit
that referenced
this issue
Dec 11, 2024
SUMMARY Fixes #769 . k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained. The list of pods, pods, was being "popped" before the first iteration of the while loop: pod = pods.pop() while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods: When pods contains only one element, the while loop is skipped. ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_drain Reviewed-by: Mike Graves <mgraves@redhat.com> (cherry picked from commit 4c305e7)
This was referenced Dec 11, 2024
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Dec 11, 2024
This is a backport of PR #770 as merged into main (4c305e7). SUMMARY Fixes #769 . k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained. The list of pods, pods, was being "popped" before the first iteration of the while loop: pod = pods.pop() while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods: When pods contains only one element, the while loop is skipped. ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_drain
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Dec 11, 2024
This is a backport of PR #770 as merged into main (4c305e7). SUMMARY Fixes #769 . k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained. The list of pods, pods, was being "popped" before the first iteration of the while loop: pod = pods.pop() while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods: When pods contains only one element, the while loop is skipped. ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_drain
Merged
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Jan 20, 2025
SUMMARY Version 3.3.0 of ansible-collection kubernetes.core came with several improvements and bugfixes ISSUE TYPE New release pull request Changelog Minor Changes k8s_drain - Improve error message for pod disruption budget when draining a node (#797). Bugfixes helm - Helm version checks did not support RC versions. They now accept any version tags. (#745). helm_pull - Apply no_log=True to pass_credentials to silence false positive warning.. (#796). k8s_drain - Fix k8s_drain does not wait for single pod (#769). k8s_drain - Fix k8s_drain runs into a timeout when evicting a pod which is part of a stateful set (#792). kubeconfig option should not appear in module invocation log (#782). kustomize - kustomize plugin fails with deprecation warnings (#639). waiter - Fix waiting for daemonset when desired number of pods is 0. (#756). ADDITIONAL INFORMATION Collection kubernets.core version 3.3.0 is compatible with ansible-core>=2.14.0 Reviewed-by: Alina Buzachis Reviewed-by: Yuriy Novostavskiy Reviewed-by: Mike Graves <mgraves@redhat.com>
This was referenced Jan 20, 2025
Closed
Merged
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Jan 20, 2025
SUMMARY This release came with new module helm_registry_auth, and improvements to the error messages in the k8s_drain module, new parameter insecure_registry for helm_template module and several bug fixes. ISSUE TYPE New release pull request Changelog Minor Changes Bump version of ansible-lint to minimum 24.7.0 (#765). Parameter insecure_registry added to helm_template as equivalent of insecure-skip-tls-verify (#805). connection/kubectl.py - Added an example of using the kubectl connection plugin to the documentation (#741). k8s_drain - Improve error message for pod disruption budget when draining a node (#797). Bugfixes helm - Helm version checks did not support RC versions. They now accept any version tags. (#745). helm_pull - Apply no_log=True to pass_credentials to silence false positive warning.. (#796). k8s_drain - Fix k8s_drain does not wait for single pod (#769). k8s_drain - Fix k8s_drain runs into a timeout when evicting a pod which is part of a stateful set (#792). kubeconfig option should not appear in module invocation log (#782). kustomize - kustomize plugin fails with deprecation warnings (#639). waiter - Fix waiting for daemonset when desired number of pods is 0. (#756). New Modules helm_registry_auth - Helm registry authentication module ADDITIONAL INFORMATION Collection kubernets.core version 3.1.0 is compatible with ansible-core>=2.15.0 Reviewed-by: Mike Graves <mgraves@redhat.com>
yurnov
added a commit
to yurnov/kubernetes.core
that referenced
this issue
Jan 20, 2025
SUMMARY This release came with new module helm_registry_auth, and improvements to the error messages in the k8s_drain module, new parameter insecure_registry for helm_template module and several bug fixes. ISSUE TYPE New release pull request Changelog Minor Changes Bump version of ansible-lint to minimum 24.7.0 (ansible-collections#765). Parameter insecure_registry added to helm_template as equivalent of insecure-skip-tls-verify (ansible-collections#805). connection/kubectl.py - Added an example of using the kubectl connection plugin to the documentation (ansible-collections#741). k8s_drain - Improve error message for pod disruption budget when draining a node (ansible-collections#797). Bugfixes helm - Helm version checks did not support RC versions. They now accept any version tags. (ansible-collections#745). helm_pull - Apply no_log=True to pass_credentials to silence false positive warning.. (ansible-collections#796). k8s_drain - Fix k8s_drain does not wait for single pod (ansible-collections#769). k8s_drain - Fix k8s_drain runs into a timeout when evicting a pod which is part of a stateful set (ansible-collections#792). kubeconfig option should not appear in module invocation log (ansible-collections#782). kustomize - kustomize plugin fails with deprecation warnings (ansible-collections#639). waiter - Fix waiting for daemonset when desired number of pods is 0. (ansible-collections#756). New Modules helm_registry_auth - Helm registry authentication module ADDITIONAL INFORMATION Collection kubernets.core version 3.1.0 is compatible with ansible-core>=2.15.0 Reviewed-by: Mike Graves <mgraves@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
In the module
k8s_drain
the result of the draining process is never checked if there is only one pod to evict from the node.ISSUE TYPE
COMPONENT NAME
k8s_drain
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
k8s_drain should wait until the pod is evicted successfully or run in a timeout.
ACTUAL RESULTS
k8s_drain reports immediately status "changed" no matter if the pod was evicted or not.
Even though the pod needs 60 seconds to terminate, k8s_drain reports deletion already after 2 seconds while the pod is still running.
The text was updated successfully, but these errors were encountered: