Open a new terminal window. In the OpenShift command-line interface (CLI), log in to your OpenShift Container Platform cluster as a cluster administrator, as shown in the following example:
oc login <openshift_cluster_url> -u system:adminDelete DCSs:
for dsc in $(oc get dsc | awk '{print $1}'); do
oc delete dsc $dsc
doneCreate a ConfigMap object for deletion of the Red Hat OpenShift AI Operator.
oc create configmap delete-self-managed-odh -n redhat-ods-operatorTo delete the rhods-operator, set the addon-managed-odh-delete label to true.
oc label configmap/delete-self-managed-odh api.openshift.com/addon-managed-odh-delete=true -n redhat-ods-operatorWhen all objects associated with the Operator are removed, delete the redhat-ods-operator project.
Set an environment variable for the redhat-ods-applications project.
PROJECT_NAME=redhat-ods-applicationsWait until the redhat-ods-applications project has been deleted.
while oc get project $PROJECT_NAME &> /dev/null; do
echo "The $PROJECT_NAME project still exists"
sleep 1
done
echo "The $PROJECT_NAME project no longer exists"When the redhat-ods-applications project has been deleted, you see the following output.
The redhat-ods-applications project no longer exists
When the redhat-ods-applications project has been deleted, delete the redhat-ods-operator project.
oc delete namespace redhat-ods-operatorVerification
Confirm that the rhods-operator subscription no longer exists.
oc get subscriptions --all-namespaces | grep rhods-operatorConfirm that the following projects no longer exist.
redhat-ods-applications redhat-ods-monitoring redhat-ods-operator rhods-notebooks
for ns in $(oc get ns | grep -i redhat-ods | awk '{print $1}'); do
oc delete ns $ns
done
for ns in $(oc get ns | grep -i rhods | awk '{print $1}'); do
oc delete ns $ns
doneCheck:
oc get namespaces | grep -i redhat-ods
oc get namespaces | grep -i rhodsDelete DCSs:
for dsc in $(oc get dsc | awk '{print $1}'); do
oc delete dsc $dsc
doneDelete CRDs
This usually doesn't do the all the work... and you have to delete the finalizer manually of DSPAs!!!. Remember this should be for demos starting with RHPDS not in a real enviroment where the installation doesn't involve necesarily unistalling RHOAI.
for crd in $(oc get crd | grep opendatahub.io | awk '{print $1}'); do
oc delete crd $crd
doneDelete Knative Serving
oc delete knativeserving/knative-serving -n knative-servingDelete Knative Eventing
oc delete knativeeventing/knative-eventing -n knative-eventingDelete Service Mesh Control Plane objects
for smcp in $(oc get servicemeshcontrolplane -n istio-system -o name); do
kubectl delete $smcp -n istio-system
doneAnd check if they're all gone.
oc get servicemeshcontrolplane -n istio-system -o nameDelete installplans of the operator if found:
for installplan in $(oc get installplans -n redhat-ods-operator -o name); do
oc delete $installplan -n redhat-ods-operator
done