diff options
author | ewolinetz <ewolinet@redhat.com> | 2017-06-23 14:15:59 -0500 |
---|---|---|
committer | ewolinetz <ewolinet@redhat.com> | 2017-06-23 14:15:59 -0500 |
commit | 0ba0acba909ff02fb4f2735f7fb3916800ca9455 (patch) | |
tree | 4eb05c68e63d941a83e4699b91196e6a0f16be22 | |
parent | 68ce47d836ece0f57082c2ce3fdf32d79a436772 (diff) | |
download | openshift-0ba0acba909ff02fb4f2735f7fb3916800ca9455.tar.gz openshift-0ba0acba909ff02fb4f2735f7fb3916800ca9455.tar.bz2 openshift-0ba0acba909ff02fb4f2735f7fb3916800ca9455.tar.xz openshift-0ba0acba909ff02fb4f2735f7fb3916800ca9455.zip |
Updating to label node and wait for apiservice to be healthy and started
-rw-r--r-- | roles/openshift_service_catalog/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/openshift_service_catalog/tasks/install.yml | 6 | ||||
-rw-r--r-- | roles/openshift_service_catalog/tasks/start_api_server.yml | 22 |
3 files changed, 27 insertions, 3 deletions
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 |