Skip to content

Commit d2f113f

Browse files
committed
Accept server certificate on start
It happens that on clean instance, when Kubelet is started, the host certificate change and the bootstrap procedure would fail, because of missing certificate acceptation. Accept certificates in "Pending" state to avoid errors. Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 49d5584 commit d2f113f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Get csr in Pending state
3+
ansible.builtin.shell: |
4+
oc get csr --no-headers | awk '/Pending/ {print $1}'
5+
register: _pending_csr
6+
7+
- name: Accept OpenShift certificate if in Pending state
8+
when: _pending_csr.stdout_lines | length > 0
9+
ansible.builtin.shell: |
10+
oc adm certificate approve {{ item }}
11+
loop: "{{ _pending_csr.stdout_lines }}"

ansible/roles/deploy-crc-cloud/tasks/main.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
- name: Replace default pubkey
1717
ansible.builtin.include_tasks: pubkey.yaml
1818

19+
- name: Accept certificate
20+
ansible.builtin.include_tasks: accept_cert.yaml
21+
1922
- name: Wait for cluster become healthy
2023
vars:
2124
wait_components: "etcd|openshift-apiserver"

0 commit comments

Comments
 (0)