-
Bug
-
Resolution: Duplicate
-
Undefined
-
Unspecified
-
False
-
-
False
-
-
https://github.com/ansible-collections/kubernetes.core/issues/593
-
-
-
-
- SUMMARY
new parameter for this module "wait_for_completion" (of drain)
- SUMMARY
-
-
-
-
-
-
-
- ISSUE TYPE
-
-
-
- Feature Idea
-
-
-
-
- COMPONENT NAME
kubernetes.core.k8s_drain module
- COMPONENT NAME
-
-
-
-
-
-
-
- ADDITIONAL INFORMATION
currently, if you would issue something like this:
- ADDITIONAL INFORMATION
-
-
-
```
- name: drain node
kubernetes.core.k8s_drain:
state: drain
delete_options:
terminate_grace_period: 300
- name: reboot host
reboot:
```
the following would happen: drain API call would be made with a grace prerioud for the pods of 300seconds, but since the ansible task "drain node" is complete - the reboot host task would be run immediatly after
so you have to do some inbetween checking yourself:
```
- name: drain node
kubernetes.core.k8s_drain:
state: drain
delete_options:
terminate_grace_period: 300
- name: wait for all pods to terminate
until: all pods terminated
< some magic depending on your pods / apps e.g. counting terminating pods >
- this task runs only AFTER all pods have gracefully been terminated
- name: reboot host
reboot:
```
nice to have would be:
```
- name: drain node
kubernetes.core.k8s_drain:
wait_for_completion: true
state: drain
delete_options:
terminate_grace_period: 300
- this task runs only AFTER all pods have gracefully been terminated, since k8s_drain "waits_for_completion"
- name: reboot host
reboot:
```