kubernetes-operator

how to remove operator-lifecycle-manager from operatorhub.io


I have installed an operator from operatorhub.io. Now how do you remove the operator lifecycle manager again?

Install:

curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.22.0/install.sh | bash -s v0.22.0

Delete:?


Solution

  • If you have the operator-sdk installed you can simply run

    operator-sdk olm uninstall
    

    Otherwise, taking a look at the OLM github repo's Makefile, you can follow these steps:

        - kubectl delete -f deploy/upstream/quickstart/crds.yaml
        - kubectl delete -f deploy/upstream/quickstart/olm.yaml
        - kubectl delete catalogsources.operators.coreos.com
        - kubectl delete clusterserviceversions.operators.coreos.com
        - kubectl delete installplans.operators.coreos.com
        - kubectl delete operatorgroups.operators.coreos.com subscriptions.operators.coreos.com
        - kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com
        - kubectl delete ns olm
        - kubectl delete ns openshift-operator-lifecycle-manager
        - kubectl delete ns openshift-operators
        - kubectl delete ns operators
        - kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-edit
        - kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-view
        - kubectl delete clusterrole.rbac.authorization.k8s.io/system:controller:operator-lifecycle-manager
        - kubectl delete clusterroles.rbac.authorization.k8s.io "system:controller:operator-lifecycle-manager"
        - kubectl delete clusterrolebindings.rbac.authorization.k8s.io "olm-operator-binding-openshift-operator-lifecycle-manager"