Uninstall OLM

The process of uninstalling OLM is symmertic to the process of intalling it. Specifically all OLM specific CRDs and the OLM deployment need to be deleted. The apiservices should be removed as the first step, preventing it from becoming a dangling resource.

Note that uninstalling OLM does not necessarily clean up the operators installed with it. Please clean up installed operator resources before uninstalling OLM, especially for resources that do not have an owner reference.

Uninstall Released OLM

For uninstalling released versions of OLM, you can use the following commands:

export OLM_RELEASE=<olm-release-version>
kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com
kubectl delete -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_RELEASE}/crds.yaml
kubectl delete -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_RELEASE}/olm.yaml

NOTE: You can identify which version of OLM you are using by inspecting the version of the packageserver CSV.

export OLM_NAMESPACE=<olm-namespace>
kubectl -n $OLM_NAMESPACE get csvs
NAME          DISPLAY        VERSION REPLACES PHASE
packageserver Package Server 0.13.0           Succeeded

Verify OLM Uninstall

You can check that OLM has been uninstalled by inspecting the OLM namespace.

kubectl get namespace $OLM_NAMESPACE
Error from server (NotFound): namespaces "$OLM_NAMESPACE" not found

More specifically, you can verify that OLM has been uninstalled successfully by making sure that OLM owned CustomResourceDefinitions are removed:

kubectl get crd | grep operators.coreos.com

You can also check that the OLM deployments are terminated:

kubectl get deploy -n $OLM_NAMESPACE
No resources found.

Lastly, check that the role and rolebinding in the OLM namespace are removed:

kubectl get role -n $OLM_NAMESPACE
No resources found.
kubectl get rolebinding -n $OLM_NAMESPACE
No resources found.