Skip to content

Commit

Permalink
[cert_manager]Delete/Recreate openshift marketplace
Browse files Browse the repository at this point in the history
On crc Zuul reproducer job, cert-manager operator installation is
failing with following error.
```
the cert-manager CRDs are not yet installed on the Kubernetes API server
```

The cert-manager operator get installed from openshift marketplace.
After digging deep, we found that pods under openshift-marketplace
namespace are hitting CrashLoopBackOff due to following error.
```
failed to populate resolver cache from source redhat-operators/openshift-marketplace:
failed to list bundles: rpc error: code = Unavailable desc = connection error: desc =
```

Based on crc-org/crc#4109 (comment),
Delete and recreating openshift-marketplace pods fixes the issue.

Since OCP is deployed after pre_infra hook and cert_manager role is
called before post_infra. There is no way to run this workaround
as a hook.

It would be best to include under openshift_setup role.

Signed-off-by: Chandan Kumar <[email protected]>
  • Loading branch information
raukadah authored and openshift-merge-bot[bot] committed Apr 17, 2024
1 parent 833d161 commit a113e1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions roles/openshift_setup/tasks/fix_openshift_marketplace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Note(Chandan): This workaround is taken from
# https://github.com/crc-org/crc/issues/4109#issuecomment-2042497411.
# It will be removed once https://github.com/crc-org/crc/issues/4109
# closed.
- name: Delete the pods from openshift-marketplace namespace
kubernetes.core.k8s:
kind: Pod
state: absent
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
namespace: openshift-marketplace

- name: Wait for openshift-marketplace pods to be running
kubernetes.core.k8s_info:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
kind: Pod
namespace: openshift-marketplace
wait: true
wait_condition:
type: Ready
status: "True"
wait_timeout: 300
3 changes: 3 additions & 0 deletions roles/openshift_setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@
spec:
additionalTrustedCA:
name: "registry-cas"

- name: Fix openshift-marketplace pods
ansible.builtin.import_tasks: fix_openshift_marketplace.yml

0 comments on commit a113e1a

Please sign in to comment.