Uninstalling foundational services
Learn how to uninstalll IBM Cloud Pak foundational services in an online and air-gapped environment.
Uninstalling foundational services in an online environment
Uninstall all services, or only selected services from your cluster.
Uninstalling all services
If you want to delete all the installed services, complete the steps in this section. Complete these steps by using the command-line interface (CLI).
-
Log in to the cluster by using the
oc logincommand. -
Locate the operator namespace where the
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>operator is deployed. For example, the<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs_ns" data-variable="keyword.cs_ns" class="md-conref">keyword.cs_ns</span>namespace.export operatorNamespace=<foundational-services-namespace> -
Locate the service namespace where the services are deployed.
export servicesNamespace=$(oc get commonservice common-service -n $operatorNamespace -o jsonpath='{.spec.servicesNamespace}') -
Delete the CommonService APIs from the operator and service namespace.
oc delete commonservice common-service -n $operatorNamespace oc delete commonservice common-service -n $servicesNamespace -
Uninstall the
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>operator from the operator namespace.oc delete csv -l operators.coreos.com/ibm-common-service-operator.$operatorNamespace -n $operatorNamespace oc delete subscription -l operators.coreos.com/ibm-common-service-operator.$operatorNamespace -n $operatorNamespace -
Delete the
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>APIs from the operator namespace and service namespace.-
Delete the OperandRequest instances.
oc delete operandrequest --all -n $operatorNamespace oc delete operandrequest --all -n $servicesNamespace -
Delete the OperandConfig instances.
oc delete operandconfig --all -n $operatorNamespace oc delete operandconfig --all -n $servicesNamespace -
Delete the OperandRegistry instances.
oc delete operandregistry --all -n $operatorNamespace oc delete operandregistry --all -n $servicesNamespace -
Delete the NamespaceScope instances.
oc delete namespacescope --all -n $operatorNamespace
-
-
Uninstall the Operand Deployment Lifecycle Manager operator.
oc delete csv -l operators.coreos.com/ibm-odlm.$operatorNamespace -n $operatorNamespace oc delete subscription -l operators.coreos.com/ibm-odlm.$operatorNamespace -n $operatorNamespace -
Uninstall the IBM NamespaceScope operator if it exists.
oc delete csv -l operators.coreos.com/ibm-namespace-scope-operator.$operatorNamespace -n $operatorNamespace oc delete subscription -l operators.coreos.com/ibm-namespace-scope-operator.$operatorNamespace -n $operatorNamespace -
Delete operator and service namespaces.
oc delete namespace $operatorNamespace oc delete namespace $servicesNamespaceNote: If namespace deletion fails or hangs, patch out the finalizers for remaining objects in the namespaces.-
Determine which resources to patch by running the following command:
oc describe namespace <foundational-services-namespace>Under the Conditions field, look for the NamespaceContentRemaining Type.
Conditions: Type Status LastTransitionTime Reason Message ---- ------ ------------------ ------ ------- NamespaceFinalizersRemaining True Wed, 25 Jan 2023 12:10:16 -0800 SomeFinalizersRemain Some content in the namespace has finalizers remaining: commonui.operators.ibm.com in 1 resource instances, commonui1.operators.ibm.com in 1 resource instances-
For each resource listed in NamespaceContentRemaining, run the following two commands:
oc get <resource type> -n <foundational-services-namespace>For example, resource type
commonwebuis.operators.ibm.com. Note down the names of the resources.oc patch <resource type> <resource name> -n <cs namespace> --type="json" -p '[{"op": "remove", "path":"/metadata/finalizers"}]'
-
-
-
Delete additional cluster resources.
-
Delete the
common-service-mapsConfigMap.-
If you have other
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>instances v3.x installed in the cluster, update thecommon-service-mapsConfigMap inkube-publicnamespace, to delete the namespace mapping for the<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>instance that you are uninstalling.oc edit configmap common-service-maps -n kube-publicFor example, if you are uninstalling the
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>instance from namespacecpfs-v4-operator-nsandcpfs-v4-services-nswithcloudpak-tethered-ns-a, remove the following entry:kind: ConfigMap apiVersion: v1 metadata: name: common-service-maps namespace: kube-public data: common-service-maps.yaml: | controlNamespace: cs-control namespaceMapping: - map-to-common-service-namespace: cpfs-v4-services-ns <-- Remove this entry starting from here requested-from-namespace: - cpfs-v4-operator-ns - cpfs-v4-services-ns - cloudpak-tethered-ns-a <-- Remove this entry ending here - map-to-common-service-namespace: cpfs-v3-ns requested-from-namespace: - cpfs-v3-ns - cloudpak-tethered-ns-b ``` -
If all the
<span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span>instances are v4.x in the cluster, delete thecommon-service-mapsConfigMap inkube-publicnamespace.
oc delete configmap common-service-maps -n kube-public -
-
Delete the
ibm-cs-ns-mapping-webhook-configurationValidatingWebhookConfiguration.oc delete validatingwebhookconfiguration ibm-cs-ns-mapping-webhook-configuration --ignore-not-found -
Delete the
ibm-common-service-validating-webhook-<operator-namespace>ValidatingWebhookConfiguration.oc delete validatingwebhookconfiguration ibm-common-service-validating-webhook-$operatorNamespace --ignore-not-found -
Delete the
ibm-operandrequest-webhook-configuration-<operator-namespace>MutatingWebhookConfiguration.oc delete mutatingwebhookconfiguration ibm-operandrequest-webhook-configuration-$operatorNamespace --ignore-not-found
-
Uninstalling individual services
If you want to delete one or more services, complete the following steps:
-
Log in to the cluster by using the
oc logincommand. -
Find the OperandRequest created by IBM Cloud Paks in the IBM Cloud Paks namespaces.
-
Run the following command to edit the OperandRequest:
oc edit operandrequest <operandrequest-name> -n <IBM Cloud Paks namespaces>The following is an example of an OperandRequest definition:
apiVersion: operator.ibm.com/v1alpha1 kind: OperandRequest metadata: name: common-service namespace: <IBM Cloud Paks namespaces> spec: requests: - operands: - name: ibm-im-operator - name: ibm-platformui-operator registry: common-service -
Delete the service that you want to uninstall from your cluster from the list of
operands. For example, if you want to uninstall theibm-platformui-operatorservice, the OperandRequest definition would resemble the following code:apiVersion: operator.ibm.com/v1alpha1 kind: OperandRequest metadata: name: common-service namespace: <IBM Cloud Paks namespaces> spec: requests: - operands: - name: ibm-im-operator registry: common-service -
Save the changes and close the editor.
Uninstalling foundational services in an air-gapped environment
Uninstall IBM Cloud Pak foundational services in your cluster that has no Internet connectivity.
Run the following commands to uninstall foundational services:
-
Uninstall the catalog source.
oc ibm-pak case launch \ --case ./ \ --inventory ibmCommonServiceOperatorSetup \ --action uninstall-catalog \ --namespace ${NAMESPACE} \ --args "--registry <IP_or_FQDN_of_your_local_registry>:5000 --user admin --pass admin" -
Uninstall the foundational services operators.
oc ibm-pak case launch \ --case ./ \ --inventory ibmCommonServiceOperatorSetup \ --action uninstall-operator \ --namespace ${NAMESPACE} \ --args "--registry <IP_or_FQDN_of_your_local_registry>:5000 --user admin --pass admin" -
Verify that the
CatalogSourceis removed.oc get pods -n openshift-marketplace oc get catalogsource -n openshift-marketplace -
Verify that the foundational services are removed.
oc get pod -n ${NAMESPACE}