Browse Source

Add a wait for aggregated APIs when restarting control plane

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1623571
Scott Dodson 6 years ago
parent
commit
44a41f9b2d
1 changed files with 30 additions and 0 deletions
  1. 30 0
      roles/openshift_control_plane/tasks/check_master_api_is_ready.yml

+ 30 - 0
roles/openshift_control_plane/tasks/check_master_api_is_ready.yml

@@ -24,3 +24,33 @@
       API did not become available. Verbose curl output and API logs
       API did not become available. Verbose curl output and API logs
       have been collected above to assist with debugging.
       have been collected above to assist with debugging.
   when: openshift_apis is failed
   when: openshift_apis is failed
+
+- name: Check for apiservices/v1beta1.metrics.k8s.io registration
+  command: >
+    {{ openshift_client_binary }} get apiservices/v1beta1.metrics.k8s.io
+  register: metrics_service_registration
+  failed_when: metrics_service_registration.rc != 0 and 'NotFound' not in metrics_service_registration.stderr
+
+- name: Wait for /apis/metrics.k8s.io/v1beta1 when registered
+  command: >
+    {{ openshift_client_binary }} get --raw /apis/metrics.k8s.io/v1beta1
+  register: metrics_api
+  until: metrics_api.rc == 0
+  retries: 30
+  delay: 5
+  when: metrics_service_registration.rc == 0
+
+- name: Check for apiservices/v1beta1.servicecatalog.k8s.io registration
+  command: >
+    {{ openshift_client_binary }} get apiservices/v1beta1.servicecatalog.k8s.io
+  register: servicecatalog_service_registration
+  failed_when: servicecatalog_service_registration.rc != 0 and 'NotFound' not in servicecatalog_service_registration.stderr
+
+- name: Wait for /apis/servicecatalog.k8s.io/v1beta1 when registered
+  command: >
+    {{ openshift_client_binary }} get --raw /apis/servicecatalog.k8s.io/v1beta1
+  register: servicecatalog_api
+  until: servicecatalog_api.rc == 0
+  retries: 30
+  delay: 5
+  when: servicecatalog_service_registration.rc == 0