Uninstall the Helm and Catalog services
The catalog-ui and helm services are no longer available starting from version 3.6.x. If you installed these services previously they are still available, but will not receive future updates. You can uninstall these services if you confirm they are no longer needed.
Required user type or access level: Cluster administrator
Important: Do not uninstall the Helm and Catalog services unless you are certain they are no longer needed. Removing the Helm and Catalog services when they are still required can damage or break your environment. Some IBM Cloud Paks and components might rely on these services.
Scripted uninstall of the Helm and Catalog services
-
Create a script, for example,
uninstall_helm_operators.sh
and add the following code.#!/bin/bash # Licensed Materials - Property of IBM # Copyright IBM Corporation 2020. All Rights Reserved # US Government Users Restricted Rights - # Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # This is an internal component, bundled with an official IBM product. # Please refer to that particular license for additional information. # # This script intends to clean up the resources installed by the obsolete helm operators # - ibm-catalog-ui-operator # - ibm-helm-repo-operator # - ibm-helm-api-operator # main operand request namespace NAMESPACE=$1 # main operand request name OPERANDREQUEST_NAME=$2 # check for arguments if [[ ( -z "${NAMESPACE}" || -z "${OPERANDREQUEST_NAME}" ) ]]; then echo "Usage: $0 NAMESPACE OPERANDREQUEST_NAME" echo "Uninstall obsolete helm operators." echo "" echo "Parameters:" echo "NAMESPACE the main operandrequest namespace" echo "OPERANDREQUEST_NAME the name of the main operandrequest" exit 1 fi # ensure the operators are not in operandregistry DEFINED_IN_REGISTRY=$(oc -n ibm-common-services get operandregistry common-service -o jsonpath='{.spec}' --ignore-not-found | grep 'ibm-catalog-ui-operator') if [[ ! -z "${DEFINED_IN_REGISTRY}" ]]; then CS_OPERATOR=$(oc -n ibm-common-services get csv | grep ibm-common-service-operator | awk '{print $1}') echo "[ERROR] This script cannot be used with ${CS_OPERATOR}" exit 1 fi # ensure main operandrequest is present if [[ -z "$(oc -n ${NAMESPACE} get operandrequest ${OPERANDREQUEST_NAME} --no-headers --ignore-not-found)" ]]; then echo "[ERROR] main operandrequest '${OPERANDREQUEST_NAME}' not found in namespace '${NAMESPACE}'" exit 1 fi echo "Start uninstalling obsolete helm operators ..." echo "----------------------------------------------" # Delete main operand request echo "[INFO] Deleting from main operand request ..." MAIN_OPERANDREQUEST=$(oc -n ${NAMESPACE} get operandrequest ${OPERANDREQUEST_NAME} -o jsonpath='{.spec.requests}' --ignore-not-found) OBSOLETE_OPERATORS=$(echo "${MAIN_OPERANDREQUEST}" | grep -E "ibm-catalog-ui-operator|ibm-helm-api-operator|ibm-helm-repo-operator") if [[ ! -z "${OBSOLETE_OPERATORS}" ]]; then if [[ ! -z "$(oc -n ${NAMESPACE} apply view-last-applied operandrequest ${OPERANDREQUEST_NAME})" ]]; then oc -n ${NAMESPACE} apply view-last-applied operandrequest ${OPERANDREQUEST_NAME} \ | sed -E "/ibm-catalog-ui-operator|ibm-helm-api-operator|ibm-helm-repo-operator/d" | oc apply -f - else oc -n ${NAMESPACE} get operandrequest ${OPERANDREQUEST_NAME} -o yaml --export \ | sed -E "/ibm-catalog-ui-operator|ibm-helm-api-operator|ibm-helm-repo-operator/d" | oc apply -f - fi fi # Delete custom resources echo "[INFO] Deleting custom resources ..." if [[ ! -z "$(oc get crd cataloguis.operator.ibm.com --ignore-not-found --no-headers)" ]]; then oc -n ibm-common-services delete cataloguis.operator.ibm.com catalog-ui --ignore-not-found fi if [[ ! -z "$(oc get crd helmrepos.operator.ibm.com --ignore-not-found --no-headers)" ]]; then oc -n ibm-common-services delete helmrepos.operator.ibm.com helm-repo --ignore-not-found fi if [[ ! -z "$(oc get crd helmapis.operator.ibm.com --ignore-not-found --no-headers)" ]]; then oc -n ibm-common-services delete helmapis.operator.ibm.com helm-api --ignore-not-found fi # Delete operand requests echo "[INFO] Deleting operand requests ..." oc -n ibm-common-services delete operandrequest catalog-ui-request --ignore-not-found oc -n ibm-common-services delete operandrequest helm-repo-request --ignore-not-found oc -n ibm-common-services delete operandrequest helm-api-request --ignore-not-found # Delete install plans echo "[INFO] Deleting install plans ..." oc -n ibm-common-services get installplan --no-headers --ignore-not-found \ | grep ibm-catalog-ui-operator | awk '{print $1}' \ | xargs oc -n ibm-common-services delete installplan oc -n ibm-common-services get installplan --no-headers --ignore-not-found \ | grep ibm-helm-repo-operator | awk '{print $1}' \ | xargs oc -n ibm-common-services delete installplan oc -n ibm-common-services get installplan --no-headers --ignore-not-found \ | grep ibm-helm-api-operator | awk '{print $1}' \ | xargs oc -n ibm-common-services delete installplan # Delete subscriptions echo "[INFO] Deleting subscriptions ..." oc -n ibm-common-services delete sub ibm-catalog-ui-operator --ignore-not-found oc -n ibm-common-services delete sub ibm-helm-repo-operator --ignore-not-found oc -n ibm-common-services delete sub ibm-helm-api-operator --ignore-not-found # Delete cluster service versions echo "[INFO] Deleting cluster service versions ..." oc -n ibm-common-services get csv --no-headers --ignore-not-found -o name \ | grep ibm-catalog-ui-operator | xargs oc -n ibm-common-services delete oc -n ibm-common-services get csv --no-headers --ignore-not-found -o name \ | grep ibm-helm-repo-operator | xargs oc -n ibm-common-services delete oc -n ibm-common-services get csv --no-headers --ignore-not-found -o name \ | grep ibm-helm-api-operator | xargs oc -n ibm-common-services delete # Delete CRDs echo "[INFO] Deleting custom resource definitions ..." oc delete crd cataloguis.operator.ibm.com --ignore-not-found oc delete crd helmrepos.operator.ibm.com --ignore-not-found oc delete crd helmapis.operator.ibm.com --ignore-not-found echo "----------------------------------------------" echo "[INFO] Done"
-
Set the permissions on the script and run it by specifying the namespace and main operandrequest name.
For example:
./uninstall_helm_operators.sh ibm-common-services common-service