-
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
Improve error message for pod disruption budget when draining a node #798
Improve error message for pod disruption budget when draining a node #798
Conversation
eb77f46
to
41ce338
Compare
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 6m 35s |
The integration tests seem to be failing because of this recent commit in the |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 27s |
Build succeeded (gate pipeline). ✔️ ansible-galaxy-importer SUCCESS in 4m 40s |
52f2cb5
into
ansible-collections:main
Backport to stable-3: 💚 backport PR created✅ Backport PR branch: Backported as #815 🤖 @patchback |
…798) SUMMARY Closes #797 . The error message "Too Many Requests" is confusing and is changed to a more meaningful message: TASK [Drain node] ************************************************************************* Montag 25 November 2024 09:20:28 +0100 (0:00:00.014) 0:00:00.014 ******* fatal: [host -> localhost]: FAILED! => {"changed": false, "msg": "Failed to delete pod kube-public/draintest-6b84677b99-9jf7m due to: Cannot evict pod as it would violate the pod's disruption budget."} The new task output would allow to deal with a pod disruption budget with the retries/until logic in a more controlled way: --- - hosts: "{{ target }}" serial: 1 gather_facts: false tasks: - name: Drain node kubernetes.core.k8s_drain: kubeconfig: "{{ kubeconfig_path }}" name: "{{ inventory_hostname }}" delete_options: ignore_daemonsets: true delete_emptydir_data: true wait_timeout: 100 disable_eviction: false wait_sleep: 1 delegate_to: localhost retries: 10 delay: 5 until: drain_result is success or 'disruption budget' not in drain_result.msg register: drain_result ISSUE TYPE Feature Pull Request COMPONENT NAME k8s_drain Reviewed-by: Mike Graves <[email protected]> (cherry picked from commit 52f2cb5)
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #816 🤖 @patchback |
…798) SUMMARY Closes #797 . The error message "Too Many Requests" is confusing and is changed to a more meaningful message: TASK [Drain node] ************************************************************************* Montag 25 November 2024 09:20:28 +0100 (0:00:00.014) 0:00:00.014 ******* fatal: [host -> localhost]: FAILED! => {"changed": false, "msg": "Failed to delete pod kube-public/draintest-6b84677b99-9jf7m due to: Cannot evict pod as it would violate the pod's disruption budget."} The new task output would allow to deal with a pod disruption budget with the retries/until logic in a more controlled way: --- - hosts: "{{ target }}" serial: 1 gather_facts: false tasks: - name: Drain node kubernetes.core.k8s_drain: kubeconfig: "{{ kubeconfig_path }}" name: "{{ inventory_hostname }}" delete_options: ignore_daemonsets: true delete_emptydir_data: true wait_timeout: 100 disable_eviction: false wait_sleep: 1 delegate_to: localhost retries: 10 delay: 5 until: drain_result is success or 'disruption budget' not in drain_result.msg register: drain_result ISSUE TYPE Feature Pull Request COMPONENT NAME k8s_drain Reviewed-by: Mike Graves <[email protected]> (cherry picked from commit 52f2cb5)
…798) (#815) This is a backport of PR #798 as merged into main (52f2cb5). SUMMARY Closes #797 . The error message "Too Many Requests" is confusing and is changed to a more meaningful message: TASK [Drain node] ************************************************************************* Montag 25 November 2024 09:20:28 +0100 (0:00:00.014) 0:00:00.014 ******* fatal: [host -> localhost]: FAILED! => {"changed": false, "msg": "Failed to delete pod kube-public/draintest-6b84677b99-9jf7m due to: Cannot evict pod as it would violate the pod's disruption budget."} The new task output would allow to deal with a pod disruption budget with the retries/until logic in a more controlled way: --- - hosts: "{{ target }}" serial: 1 gather_facts: false tasks: - name: Drain node kubernetes.core.k8s_drain: kubeconfig: "{{ kubeconfig_path }}" name: "{{ inventory_hostname }}" delete_options: ignore_daemonsets: true delete_emptydir_data: true wait_timeout: 100 disable_eviction: false wait_sleep: 1 delegate_to: localhost retries: 10 delay: 5 until: drain_result is success or 'disruption budget' not in drain_result.msg register: drain_result ISSUE TYPE Feature Pull Request COMPONENT NAME k8s_drain
…798) (#816) This is a backport of PR #798 as merged into main (52f2cb5). SUMMARY Closes #797 . The error message "Too Many Requests" is confusing and is changed to a more meaningful message: TASK [Drain node] ************************************************************************* Montag 25 November 2024 09:20:28 +0100 (0:00:00.014) 0:00:00.014 ******* fatal: [host -> localhost]: FAILED! => {"changed": false, "msg": "Failed to delete pod kube-public/draintest-6b84677b99-9jf7m due to: Cannot evict pod as it would violate the pod's disruption budget."} The new task output would allow to deal with a pod disruption budget with the retries/until logic in a more controlled way: --- - hosts: "{{ target }}" serial: 1 gather_facts: false tasks: - name: Drain node kubernetes.core.k8s_drain: kubeconfig: "{{ kubeconfig_path }}" name: "{{ inventory_hostname }}" delete_options: ignore_daemonsets: true delete_emptydir_data: true wait_timeout: 100 disable_eviction: false wait_sleep: 1 delegate_to: localhost retries: 10 delay: 5 until: drain_result is success or 'disruption budget' not in drain_result.msg register: drain_result ISSUE TYPE Feature Pull Request COMPONENT NAME k8s_drain
SUMMARY
Closes #797 .
The error message "Too Many Requests" is confusing and is changed to a more meaningful message:
The new task output would allow to deal with a pod disruption budget with the retries/until logic in a more controlled way:
ISSUE TYPE
COMPONENT NAME
k8s_drain