From 0ba0acba909ff02fb4f2735f7fb3916800ca9455 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Fri, 23 Jun 2017 14:15:59 -0500 Subject: Updating to label node and wait for apiservice to be healthy and started --- roles/openshift_service_catalog/defaults/main.yml | 2 +- roles/openshift_service_catalog/tasks/install.yml | 6 ++++-- .../tasks/start_api_server.yml | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 roles/openshift_service_catalog/tasks/start_api_server.yml diff --git a/roles/openshift_service_catalog/defaults/main.yml b/roles/openshift_service_catalog/defaults/main.yml index dc573e78a..01ee2544d 100644 --- a/roles/openshift_service_catalog/defaults/main.yml +++ b/roles/openshift_service_catalog/defaults/main.yml @@ -1,3 +1,3 @@ --- openshift_service_catalog_remove: false -openshift_service_catalog_nodeselector: {} +openshift_service_catalog_nodeselector: {"openshift-infra": "apiserver"} diff --git a/roles/openshift_service_catalog/tasks/install.yml b/roles/openshift_service_catalog/tasks/install.yml index 6a2b94bc8..c1773b5f6 100644 --- a/roles/openshift_service_catalog/tasks/install.yml +++ b/roles/openshift_service_catalog/tasks/install.yml @@ -98,7 +98,7 @@ cpu_requests: none memory_request: none cors_allowed_origin: localhost - node_selector: {"openshift-infra": "apiserver"} + node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}" - name: Set Service Catalog API Server daemonset oc_obj: @@ -146,7 +146,7 @@ image: "" cpu_limit: none memory_limit: none - node_selector: {"openshift-infra": "apiserver"} + node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}" - name: Set Controller Manager deployment oc_obj: @@ -172,6 +172,8 @@ - "{{ mktemp.stdout }}/controller_manager_service.yml" delete_after: yes +- include: start_api_server.yml + - name: Delete temp directory file: name: "{{ mktemp.stdout }}" diff --git a/roles/openshift_service_catalog/tasks/start_api_server.yml b/roles/openshift_service_catalog/tasks/start_api_server.yml new file mode 100644 index 000000000..b143292b6 --- /dev/null +++ b/roles/openshift_service_catalog/tasks/start_api_server.yml @@ -0,0 +1,22 @@ +--- +# Label nodes and wait for apiserver and controller to be running (at least one) +- name: Label {{ openshift.node.nodename }} for APIServer and controller deployment + oc_label: + name: "{{ openshift.node.nodename }}" + kind: node + state: add + labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | oo_dict_to_list_of_dict }}" + +# wait to see that the apiserver is available +- name: wait for api server to be ready + command: > + curl -k https://apiserver.kube-service-catalog.svc/healthz + args: + # Disables the following warning: + # Consider using get_url or uri module rather than running curl + warn: no + register: api_health + until: api_health.stdout == 'ok' + retries: 120 + delay: 1 + changed_when: false -- cgit v1.2.3