Uninstalling the remaining resources after migrating to foundational services version 4.x
After you upgrade IBM Cloud Pak foundational services from version 3.x to 4.x, some components of the foundational services remain in the control namespace. You can remove these components automatically by using the script, or manually.
- Using the script to automatically check and uninstall foundational services version 3.x remaining components
- Manually uninstalling foundational services version 3.x components
Using the script to automatically check and uninstall foundational services version 3.x remaining components
You can use the cleanup_cp2_control.sh script to check and uninstall the remaining components of foundational services version 3.x.
Prerequisites for automatic uninstallation
- Download the CASE bundle and the entire
installer_scriptsdirectory that contains thecleanup_cp2_control.shscript and other tools that you need to uninstall the remaining components of foundational services version 3.x. For more information, see Downloading scripts for additional configuration from specific version CASE bundle.
Using the script
To view information about how to use the cleanup_cp2_control.sh script, run the following command:
./cleanup_cp2_control.sh --help
You can use the following parameters while using the script:
--oc string File path to oc CLI. Default uses oc in your PATH
-h, --help Print usage information
--enable-licensing Set this flag to check ibm-licensing-operator
Example
./cleanup_cp2_control.sh --enable-licensing
Manually uninstalling foundational services version 3.x components
You can use the OpenShift console or run commands to uninstall the remaining resources after upgrading to foundational services version 4.x.x.
Prerequisites for manual uninstallation
- Check the
common-service-mapsConfigMap in thekube-publicnamespace to get all namespaces where foundational services is installed. Note: Namespaces that are listed in thecommon-service-mapsConfigMap entries do not have anibm-common-service-operatoron v3.x version. - If the cert-manager operator or operand is deployed in
controlNamespacelisted incommon-service-mapsConfigMap, another instance of cert-manager (regardless of its version, and whether it is from IBM, Red Hat, or community) should exist in another namespace.
Uninstalling operators and operands
-
Uninstall the ibm-namespace-scope operator and its operand in
controlNamespace.- Delete the NamespaceScope instances in the
controlNamespace.- OpenShift console: Click Operators > Installed Operators > IBM NamespaceScope Operator > NamespaceScope and delete all the NamespaceScope instances.
- CLI: Find the NamespaceScope instances in the
controlNamespace:oc delete namespacescope odlm-scope-managedby-odlm nss-odlm-scope nss-managedby-odlm -n <controlNamespace> --ignore-not-found
-
Delete the ibm-namespace-scope operator.
- OpenShift console: Click Operators > Installed Operators > IBM NamespaceScope Operator > Uninstall Operatorand delete the ibm-namespace-scope operator.
-
CLI: Run the following commands to delete the ibm-namespace-scope operator:
oc get csv -n <controlNamespace> | grep ibm-namespace-scope-operatoroc delete csv <csv_name> -n <controlNamespace>oc delete sub ibm-namespace-scope-operator -n <controlNamespace> --ignore-not-found
- Delete the NamespaceScope instances in the
-
Uninstall
ibm-common-service-webhookand its operand.-
Remove the
ibm-common-service-webhookdeployment.- OpenShift console: Click Workloads > Deployments > ibm-common-service-webhook > Delete Deployment.
- CLI: Run the following command to delete this deployment:
oc delete deployment ibm-common-service-webhook -n <controlNamespace>
-
Remove MutatingWebhookConfigurations.
- OpenShift console: Click Home > Search > MutatingWebhookConfiguration and delete the following resources:
ibm-common-service-webhook-configurationandibm-operandrequest-webhook-configuration. - CLI: Run the following commands to delete
ibm-cs-ns-mapping-webhook-configuration:oc delete MutatingWebhookConfiguration ibm-common-service-webhook-configuration ibm-operandrequest-webhook-configuration --ignore-not-found
- OpenShift console: Click Home > Search > MutatingWebhookConfiguration and delete the following resources:
-
Remove ValidatingWebhookConfigurations.
- OpenShift console: Click Home > Search > ValidatingWebhookConfiguration and delete
ibm-cs-ns-mapping-webhook-configuration. - CLI: Run the following command to delete
ibm-cs-ns-mapping-webhook-configuration:oc delete ValidatingWebhookConfiguration ibm-cs-ns-mapping-webhook-configuration --ignore-not-found
- OpenShift console: Click Home > Search > ValidatingWebhookConfiguration and delete
-
Remove
podpresetsinstance.- OpenShift console: Click Home > Search > Podpresets.
- CLI: Run the following command to delete the
podpresetsresources:oc get podpresets.operator.ibm.com -A --no-headers | awk '{print $1}' | xargs oc delete -n $ns --ignore-not-found podpresets.operator.ibm.com
-
-
Uninstall
ibm-secret-share-operatorand its operand.-
Remove ibm-secret-share-operator deployment.
- OpenShift console: Click Workloads > Deployments > secretshare > Delete Deployment.
- CLI: Run the following command to delete the deployment:
oc delete deployment secretshare -n <controlNamespace>
-
Remove secretshare instance.
- OpenShift console: Click Home > Search > SecretShare, to delete all
secretshareinstances - CLI: Run the following command to delete the resources:
oc get secretshare -A --no-headers | awk '{print $1}' | xargs oc delete -n $ns --ignore-not-found secretshare
- OpenShift console: Click Home > Search > SecretShare, to delete all
-
-
Uninstall
ibm-crossplane-operatorandibm-corssplane-provider-operatoroperator and its operands.-
Remove Corssplane instance.
- OpenShift console: Click Home > Search and find and delete the following resources: configuration.pkg.ibm.crossplane.io, lock.pkg.ibm.crossplane.io, ProviderConfig.
-
CLI: Run the following commands to delete the resources:
oc get configuration.pkg.ibm.crossplane.io -A --no-headers | awk '{print $1}' | xargs oc delete --ignore-not-found configuration.pkg.ibm.crossplane.iooc get lock.pkg.ibm.crossplane.io -A --no-headers | awk '{print $1}' | xargs oc delete --ignore-not-found lock.pkg.ibm.crossplane.iooc get ProviderConfig -A --no-headers | awk '{print $1}' | xargs oc delete --ignore-not-found ProviderConfig
-
Remove crossplane CSV and subscriptions.
-
You can run the following command to delete the crossplane CSV and subscriptions:
oc get csv -n <controlNamespace> | grep ibm-crossplaneoc delete csv <csv_name> -n <controlNamespace>oc delete sub ibm-crossplane-operator-app -n <controlNamespace> --ignore-not-foundoc delete sub ibm-crossplane-provider-kubernetes-operator-app -n <controlNamespace> --ignore-not-foundoc delete sub ibm-crossplane-provider-ibm-cloud-operator-app -n <controlNamespace> --ignore-not-found
-
-
-
Uninstall Audit Logging resources.
- Remove Audit Logging resources.
- OpenShift console: Click Home > Search > AuditLogging and delete it.
- CLI: Run the following command to delete the resources:
oc get auditlogging -A --no-headers | awk '{print $1}' | xargs oc delete -n $ns --ignore-not-found auditlogging
- Remove Audit Logging resources.
-
Uninstall IBM Cert Manager v3 operator and its operands.
-
Remove Cert Manager resources.
- OpenShift console: Click Home > Search > certmanager and delete it.
- CLI: Run the following command to delete the resources:
oc get certmanager.operator.ibm.com -A --no-headers | awk '{print $1}' | xargs oc delete -n $ns --ignore-not-found certmanager.operator.ibm.com
-
Remove Cert Manager CSV and subscriptions.
-
You can run the following commands to delete the Cert Manager CSV and subscriptions:
oc get csv -n <controlNamespace> | grep ibm-cert-manager-operator.v3oc delete csv <csv_name> -n <controlNamespace>oc delete sub ibm-cert-manager-operator -n <controlNamespace> --ignore-not-found
-
-