Unable to delete Kubevirt CRD on Openshift

974 views
Skip to first unread message

Prince Sarvaiya

unread,
Sep 15, 2022, 8:55:37 AM9/15/22
to kubevirt-dev
Hi Team,

We have deploy Openshift cluster with Virtualization enabled,

Now i am trying to delete kubevirt-hyperconverged and re-installing it again, This CRD is stuck on deletion

error: kubevirts.kubevirt.io "kubevirt-kubevirt-hyperconverged" could not be patched: Internal error occurred: failed calling webhook "kubevirt-update-validator.kubevirt.io": failed to call webhook: Post "https://kubevirt-operator-webhook.openshift-cnv.svc:443/kubevirt-validate-update?timeout=10s": service "kubevirt-operator-webhook" not found

I even tried to patch and update the finalize to empty, but it didn't work

 oc patch kubevirts.kubevirt.io/kubevirt-kubevirt-hyperconverged -n openshift-cnv -p '{"metadata":{"finalizers":[]}}' --type=merge
Error from server (InternalError): Internal error occurred: failed calling webhook "kubevirt-update-validator.kubevirt.io": failed to call webhook: Post "https://kubevirt-operator-webhook.openshift-cnv.svc:443/kubevirt-validate-update?timeout=10s": service "kubevirt-operator-webhook" not found

Kindly assist

Chandler Wilkerson

unread,
Sep 15, 2022, 10:20:10 PM9/15/22
to Prince Sarvaiya, kubevirt-dev
Before you can remove the resources in the openshift-cnv namespace, you will have to remove the webhook configurations that are preventing your deletes.

   oc get mutatingwebhookconfigurations,validatingwebhookconfigurations | grep kubevirt

This will give you an idea of what is still on your cluster preventing your uninstall.

--
You received this message because you are subscribed to the Google Groups "kubevirt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubevirt-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubevirt-dev/93543f9e-1a9b-4af7-8ba3-78c64f0f7800n%40googlegroups.com.


--
Chandler Wilkerson, RHCE, CKA
Sr. Software Engineer

Red Hat

Prince Sarvaiya

unread,
Sep 16, 2022, 1:23:08 AM9/16/22
to Chandler Wilkerson, kubevirt-dev
Thank you Chandler, this helps.

It is working now! Additional to what you said, we have to run this below 2 commands again to delete the resources

oc patch kubevirt.kubevirt.io/kubevirt-kubevirt-hyperconverged -n openshift-cnv -p '{"metadata":{"finalizers":[]}}' --type=merge

oc patch hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged -n openshift-cnv -p '{"metadata":{"finalizers":[]}}' --type=merge

---

I deleted all the CRD of kubevirt io, deleted everything in openshift-cnv namespace. Installed the virtualization operator again to start fresh.

All CRD, hyperconverged, kubevirt resources like CDI, virt handler, everything was installed successfully, and pods are running.

But the virtualization option is not getting visible in the workload. It shows the kubevirt plugin is degraded.

I understand this issue is related to openshift, but just sharing for your reference. PFA.

ocp.PNG
Reply all
Reply to author
Forward
0 new messages