|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// networking/k8s_nmstate/k8s-nmstate-about-the-kubernetes-nmstate-operator.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="k8s-nmstate-uninstall-operator_{context}"] |
| 7 | += Uninstalling the Kubernetes NMState Operator |
| 8 | + |
| 9 | +You can use the Operator Lifecycle Manager (OLM) to uninstall the Kubernetes NMState Operator, but by design OLM does not delete any associated custom resource definitions (CRDs), custom resources (CRs), or API Services. |
| 10 | + |
| 11 | +Before you uninstall the Kubernetes NMState Operator from the `Subcription` resource used by OLM, identify what Kubernetes NMState Operator resources to delete. This identification ensures that you can delete resources without impacting your running cluster. |
| 12 | + |
| 13 | +If you need to reinstall the Kubernetes NMState Operator, see "Installing the Kubernetes NMState Operator by using the CLI" or "Installing the Kubernetes NMState Operator by using the web console". |
| 14 | + |
| 15 | +.Prerequisites |
| 16 | + |
| 17 | +* You have installed the {oc-first}. |
| 18 | +* You are logged in as a user with `cluster-admin` privileges. |
| 19 | +
|
| 20 | +.Procedure |
| 21 | + |
| 22 | +. Unsubscribe the Kubernetes NMState Operator from the `Subcription` resource by running the following command: |
| 23 | ++ |
| 24 | +[source,terminal] |
| 25 | +---- |
| 26 | +$ oc delete --namespace openshift-nmstate subscription kubernetes-nmstate-operator |
| 27 | +---- |
| 28 | + |
| 29 | +. Find the `ClusterServiceVersion` (CSV) resource that associates with the Kubernetes NMState Operator: |
| 30 | ++ |
| 31 | +[source,terminal] |
| 32 | +---- |
| 33 | +$ oc get --namespace openshift-nmstate clusterserviceversion |
| 34 | +---- |
| 35 | ++ |
| 36 | +.Example output that lists a CSV resource |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +NAME DISPLAY VERSION REPLACES PHASE |
| 40 | +kubernetes-nmstate-operator.v4.18.0 Kubernetes NMState Operator 4.18.0 Succeeded |
| 41 | +---- |
| 42 | + |
| 43 | +. Delete the CSV resource. After you delete the file, OLM deletes certain resources, such as `RBAC`, that it created for the Operator. |
| 44 | ++ |
| 45 | +[source,terminal] |
| 46 | +---- |
| 47 | +$ oc delete --namespace openshift-nmstate clusterserviceversion kubernetes-nmstate-operator.v4.18.0 |
| 48 | +---- |
| 49 | + |
| 50 | +. Delete the `nmstate` CR and any associated `Deployment` resources by running the following commands: |
| 51 | ++ |
| 52 | +[source,terminal] |
| 53 | +---- |
| 54 | +$ oc -n openshift-nmstate delete nmstate nmstate |
| 55 | +---- |
| 56 | ++ |
| 57 | +[source,terminal] |
| 58 | +---- |
| 59 | +$ oc delete --all deployments --namespace=openshift-nmstate |
| 60 | +---- |
| 61 | + |
| 62 | +. Delete all the custom resource definition (CRD), such as `nmstates`, that exist in the `nmstate.io` namespace by running the following commands: |
| 63 | ++ |
| 64 | +[source,terminal] |
| 65 | +---- |
| 66 | +$ oc delete crd nmstates.nmstate.io |
| 67 | +---- |
| 68 | ++ |
| 69 | +[source,terminal] |
| 70 | +---- |
| 71 | +$ oc delete crd nodenetworkconfigurationenactments.nmstate.io |
| 72 | +---- |
| 73 | ++ |
| 74 | +[source,terminal] |
| 75 | +---- |
| 76 | +$ oc delete crd nodenetworkstates.nmstate.io |
| 77 | +---- |
| 78 | ++ |
| 79 | +[source,terminal] |
| 80 | +---- |
| 81 | +$ oc delete crd nodenetworkconfigurationpolicies.nmstate.io |
| 82 | +---- |
| 83 | + |
| 84 | +. Delete the namespace: |
| 85 | ++ |
| 86 | +[source,terminal] |
| 87 | +---- |
| 88 | +$ oc delete namespace kubernetes-nmstate |
| 89 | +---- |
| 90 | + |
0 commit comments