How to remove Service Mesh resources clearly after uninstalling OSSM incidentally first
Environment
- Red Hat OpenShift Service Mesh
- 2.x
Issue
- You want to remove all resources of OSSM clearly after uninstalling OSSM operator first by your mistake.
- All OSSM CR resources, such like SMCP, SMMR and SMM are in stuck and not removed when removed them.
- Some CRDs cannot be removed due to existing CR resources.
Resolution
- You can remove all ServiceMeshControlPlane(SMCP), ServiceMeshMemberRoll(SMMR) and ServiceMeshMember(SMM) according to the following procedures.
- You can remove the all resources by making a metadata.finalizers value be empty.
1. remove a SMCP managed by the removed OSSM Operator as follows.
$ oc get smcp XXXX -n istio-system
$ oc delete -n istio-system smcp XXXX --wait=false
$ oc edit -n istio-system smcp XXXX
:
metadata:
:
(before)
finalizers:
- maistra.io/istio-operator
(after)
finalizers: []
2. remove a SMMR as follows.
$ oc get smmr XXXX -n istio-system
$ oc delete -n istio-system smmr XXXX --wait=false
$ oc edit -n istio-system smmr XXXX
:
metadata:
:
(before)
finalizers:
- maistra.io/istio-operator
(after)
finalizers: []
3. remove all SMMs acorss all projects in the cluster.
$ oc get smm -A
$ oc delete smm XXXX -n XXXX --wait=false
$ oc edit -n XXXX smm XXXX
:
metadata:
:
(before)
finalizers:
- maistra.io/istio-operator
(after)
finalizers: []
- After that, you remove all remained resources according to Uninstalling Service Mesh.
Root Cause
- SMCP, SMMR and SMM is managed by OSSM Operator, so if you removed the operator first before removing them, the resources are orphaned.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments