Chapter 9. Uninstall the Loki Operator
You can uninstall the Loki Operator and delete its persistent volume claims (PVCs) from your cluster.
9.1. Uninstall the Loki Operator Copy linkLink copied to clipboard!
You can uninstall Loki Operator by using either the OpenShift CLI (oc) or the Red Hat OpenShift Logging web console. After uninstalling Loki Operator, delete persistent volume claims (PVCs) if you do not want to reuse them in other installations of LokiStack.
9.1.1. Delete the Loki Operator by using the CLI Copy linkLink copied to clipboard!
You can delete the Loki Operator by using the OpenShift CLI (oc).
Prerequisites
- You have administrator permissions.
-
You installed the OpenShift CLI (
oc).
Procedure
Delete the
LokiStackcustom resource (CR) by running the following command:$ oc delete LokiStack logging-loki -n openshift-loggingSubstitute
logging-lokiwith the name of yourLokiStackCR if you have used a different name.Check the current version of the subscribed Loki Operator in the
currentCSVfield by running the following command:$ oc get csv -n openshift-operators-redhat | grep loki-operatorYou get an output similar to the following example:
loki-operator.v6.2.4 Loki Operator 6.2.4 loki-operator.v6.2.3 SucceededNote the first field in the output, it indicates the
currentCSVvalue.Delete the subscription associated with the Loki Operator by running the following command:
$ oc delete subscriptions.operators.coreos.com loki-operator -n openshift-operators-redhatDelete the
CSVobject for Loki Operator in the target namespace using thecurrentCSVvalue obtained from the earlier step:$ oc delete csv loki-operator.v6.2.4 -n openshift-operators-redhatUninstall the Loki Operator by running the following command:
$ oc delete OperatorGroup <name> -n openshift-operators-redhat
9.1.2. Delete the Loki Operator by using the web console Copy linkLink copied to clipboard!
You can delete the Loki Operator by using the Red Hat OpenShift Logging web console.
Prerequisites
- You have administrator permissions.
- You have access to the Red Hat OpenShift Logging web console.
Procedure
-
In the web console, go to Operators
Installed Operators. -
Find Loki Operator in the list and click
next to it, then click Uninstall Operator.
- In the pop-up, select Delete all operand instances for this operator and click Uninstall.
9.1.3. Delete logging PVCs by using the CLI Copy linkLink copied to clipboard!
You can delete persistent volume claims (PVCs) if you do not want to reuse them in other installations of LokiStack by using the OpenShift CLI (oc).
Prerequisites
- You have administrator permissions.
-
You installed the OpenShift CLI (
oc).
Procedure
Delete logging PVCs by running the following command:
$ oc -n openshift-logging delete pvc -l app.kubernetes.io/name=lokistack
9.1.4. Delete logging PVCs by using the web console Copy linkLink copied to clipboard!
You can delete persistent volume claims (PVCs) if you do not want to reuse them in other installations of LokiStack, by using the web console.
Prerequisites
- You have administrator permissions.
- You have access to the Red Hat OpenShift Logging web console.
Procedure
-
In the web console, go to the Storage
Persistent Volume Claims page. -
Click
next to each PVC, and select Delete Persistent Volume Claim.