Merge "Add DaemonSet check for wait-for-pods role"
This commit is contained in:
commit
c3f4a5f947
@ -10,14 +10,31 @@
|
|||||||
register: _statefulsets
|
register: _statefulsets
|
||||||
|
|
||||||
- name: Ensure the number of ready replicas matches the replicas
|
- name: Ensure the number of ready replicas matches the replicas
|
||||||
shell: kubectl get {{ zj_item }} -ogo-template='{{ '{{' }}eq .status.replicas .status.readyReplicas{{ '}}' }}'
|
shell: kubectl get {{ zj_sts_item }} -ogo-template='{{ '{{' }}eq .status.replicas .status.readyReplicas{{ '}}' }}'
|
||||||
register: _is_ready
|
register: _is_ready
|
||||||
until: _is_ready.stdout == 'true'
|
until: _is_ready.stdout == 'true'
|
||||||
retries: 60
|
retries: 60
|
||||||
delay: 5
|
delay: 5
|
||||||
loop: "{{ _statefulsets.stdout_lines }}"
|
loop: "{{ _statefulsets.stdout_lines }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: zj_item
|
loop_var: zj_sts_item
|
||||||
|
|
||||||
|
# For the DaemonSet, very similar with StatefulSet
|
||||||
|
- name: Wait for all DaemonSets to become ready
|
||||||
|
block:
|
||||||
|
- name: Retrieve all DaemonSets
|
||||||
|
command: kubectl get daemonset -o name
|
||||||
|
register: _daemonsets
|
||||||
|
|
||||||
|
- name: Ensure the ready number matches the scheduled number
|
||||||
|
shell: kubectl get {{ zj_ds_item }} -ogo-template='{{ '{{' }}eq .status.currentNumberScheduled .status.numberReady{{ '}}' }}'
|
||||||
|
register: _is_ready
|
||||||
|
until: _is_ready.stdout == 'true'
|
||||||
|
retries: 60
|
||||||
|
delay: 5
|
||||||
|
loop: "{{ _daemonsets.stdout_lines }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: zj_ds_item
|
||||||
|
|
||||||
- name: Wait for all pods to become ready
|
- name: Wait for all pods to become ready
|
||||||
command: kubectl wait --for=condition=Ready --timeout=120s pod --all
|
command: kubectl wait --for=condition=Ready --timeout=120s pod --all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user