Extra options for upgrade mode
Optionally do not drain nodes by setting drain_nodes to false Optionally set a labelselector to target which pods should be drained.
This commit is contained in:
parent
18f0531bba
commit
d692737a13
2 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,5 @@
|
||||||
---
|
---
|
||||||
drain_grace_period: 300
|
drain_grace_period: 300
|
||||||
drain_timeout: 360s
|
drain_timeout: 360s
|
||||||
|
drain_label_selector: ""
|
||||||
|
drain_nodes: true
|
||||||
|
|
|
@ -35,10 +35,13 @@
|
||||||
- name: Drain node
|
- name: Drain node
|
||||||
command: >-
|
command: >-
|
||||||
{{ bin_dir }}/kubectl drain
|
{{ bin_dir }}/kubectl drain
|
||||||
--force
|
--force
|
||||||
--ignore-daemonsets
|
--ignore-daemonsets
|
||||||
--grace-period {{ drain_grace_period }}
|
--grace-period {{ drain_grace_period }}
|
||||||
--timeout {{ drain_timeout }}
|
--timeout {{ drain_timeout }}
|
||||||
--delete-local-data {{ inventory_hostname }}
|
--delete-local-data {{ inventory_hostname }}
|
||||||
|
{% if drain_label_selector != "" %}--selector '{{ drain_label_selector }}'{% endif %}
|
||||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
when: needs_cordoning
|
when:
|
||||||
|
- drain_nodes
|
||||||
|
- needs_cordoning
|
||||||
|
|
Loading…
Reference in a new issue