Merge pull request #3305 from mattymo/fixup_upgrade
Fixes for upgrade mode
This commit is contained in:
commit
9964ba77ee
2 changed files with 20 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
drain_grace_period: 300
|
drain_grace_period: 300
|
||||||
drain_timeout: 360s
|
drain_timeout: 360s
|
||||||
drain_label_selector: ""
|
drain_pod_selector: ""
|
||||||
drain_nodes: true
|
drain_nodes: true
|
||||||
|
|
|
@ -32,6 +32,24 @@
|
||||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
when: needs_cordoning
|
when: needs_cordoning
|
||||||
|
|
||||||
|
- name: Check kubectl version
|
||||||
|
command: kubectl version --client --short
|
||||||
|
register: kubectl_version
|
||||||
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
|
run_once: yes
|
||||||
|
when:
|
||||||
|
- drain_nodes
|
||||||
|
- needs_cordoning
|
||||||
|
- 'drain_pod_selector != ""'
|
||||||
|
|
||||||
|
- name: Ensure minimum version for drain label selector if necessary
|
||||||
|
assert:
|
||||||
|
that: "kubectl_version.stdout.split(' ')[-1] | version_compare('v1.10.0', '>=')"
|
||||||
|
when:
|
||||||
|
- drain_nodes
|
||||||
|
- needs_cordoning
|
||||||
|
- 'drain_pod_selector != ""'
|
||||||
|
|
||||||
- name: Drain node
|
- name: Drain node
|
||||||
command: >-
|
command: >-
|
||||||
{{ bin_dir }}/kubectl drain
|
{{ bin_dir }}/kubectl drain
|
||||||
|
@ -40,7 +58,7 @@
|
||||||
--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 %}
|
{% if drain_pod_selector != "" %}--pod-selector '{{ drain_pod_selector }}'{% endif %}
|
||||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
when:
|
when:
|
||||||
- drain_nodes
|
- drain_nodes
|
||||||
|
|
Loading…
Reference in a new issue