Skip to content

Commit

Permalink
fix: Adjust bootstrap wait time (#114)
Browse files Browse the repository at this point in the history
Adjust bootstrap wait time. The duration depends highly on network speed
and system performance.

Signed-off-by: Klaus Smolin <smolin@de.ibm.com>
Co-authored-by: Jacob Emery <jacob.emery@ibm.com>
  • Loading branch information
smolin-de and jacobemery committed Apr 10, 2023
1 parent d216fcb commit 8724b1d
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions roles/wait_for_bootstrap/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,44 @@
- name: Start openshift-installer with 'wait-for bootstrap-complete' (async task)
tags: wait_for_bootstrap
ansible.builtin.command: openshift-install wait-for bootstrap-complete --dir=/root/ocpinst
async: 3600
# Set wait time to 75 min, because it depends highly on system performance and network speed
async: 4500
poll: 0
register: watch_bootstrap

- name: "Wait for first node-bootstrapper request, should be started within 6 min (retry every 30s)...To watch progress, \
- name: "Wait for first node-bootstrapper request. Takes < 10 min with good network connection (retry every 30s)...To watch progress, \
SSH to root@bastion, SSH to core@bootstrap-ip and run 'journalctl -b -f -u release-image.service -u bootkube.service'"
tags: wait_for_bootstrap
ansible.builtin.shell: |
set -o pipefail
oc get csr | grep ":node-bootstrapper"
register: csr_check
until: (":node-bootstrapper" in csr_check.stdout)
retries: 12
retries: 60
delay: 30

- name: Print first node-bootstrapper requests
tags: wait_for_bootstrap
ansible.builtin.debug:
var: csr_check.stdout_lines

- name: Wait for control node CSRs (retry every 30s)
tags: wait_for_bootstrap
ansible.builtin.shell: |
set -o pipefail
oc get csr | awk '{print $4}' | grep "^system:node:{{ item | lower }}"
register: cmd_output
until: ("system:node:" in cmd_output.stdout)
loop: "{{ env.cluster.nodes.control.hostname }}"
retries: 20
delay: 30

- name: "Retry wait-for bootstrap-complete job ID check until it's finished. This may take some time... To watch progress, \
SSH to bastion, switch to root, from there, SSH to core@bootstrap-ip and run 'journalctl -b -f -u release-image.service -u bootkube.service'"
tags: wait_for_bootstrap
ansible.builtin.async_status:
jid: "{{ watch_bootstrap.ansible_job_id }}"
register: bootstrapping
until: bootstrapping.finished
retries: 100
# Set wait time to 60 min, because it depends highly on system performance and network speed
retries: 120
delay: 30

- name: Make sure kubeconfig works properly
tags: wait_for_bootstrap
ansible.builtin.command: oc whoami
register: oc_whoami
until: oc_whoami.stdout == "system:admin"
retries: 60
until: (oc_whoami.stdout == "system:admin")
retries: 30
delay: 10

- name: Print output of oc whoami, should be "system:admin" if previous task worked
Expand Down

0 comments on commit 8724b1d

Please sign in to comment.