瀏覽代碼

openshift-control-plane: check whether the sync pods are ready before selecting nodes

If the sync pod is not ready, then the node selection might fail due to pods
not being labeled yet. (https://bugzilla.redhat.com/show_bug.cgi?id=1609019)
Paul Gier 6 年之前
父節點
當前提交
9894aea3b8
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      roles/openshift_node_group/tasks/sync.yml

+ 19 - 0
roles/openshift_node_group/tasks/sync.yml

@@ -46,3 +46,22 @@
     state: absent
     name: "{{ mktemp.stdout }}"
   changed_when: False
+
+- name: Wait for the sync daemonset to become ready and available
+  oc_obj:
+    state: list
+    kind: daemonset
+    name: sync
+    namespace: openshift-node
+  register: __status_of_sync_ds
+  until:
+    - __status_of_sync_ds.results is defined
+    - __status_of_sync_ds.results.results is defined
+    - __status_of_sync_ds.results.results | length > 0
+    - __status_of_sync_ds.results.results[0].status is defined
+    - __status_of_sync_ds.results.results[0].status.numberAvailable is defined
+    - __status_of_sync_ds.results.results[0].status.desiredNumberScheduled is defined
+    - __status_of_sync_ds.results.results[0].status.numberAvailable == __status_of_sync_ds.results.results[0].status.desiredNumberScheduled
+  retries: 60
+  delay: 30
+  failed_when: false