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
To uninstall the remaining components, you can download the following script from the scripts-adopter
branch of the ibm-common-service-operator
GitHub repository:
cleanup_cp2_control.sh.
Parameters:
--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
- Check the
common-service-maps
ConfigMap in thekube-public
namespace to get all namespaces where foundational services is installed. Note: Namespaces that are listed in thecommon-service-maps
ConfigMap entries do not have anibm-common-service-operator
on v3.x version. - If the cert-manager operator or operand is deployed in
controlNamespace
listed incommon-service-maps
ConfigMap, 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-operator
oc 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-webhook
and its operand.-
Remove the
ibm-common-service-webhook
deployment.- 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-configuration
andibm-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
podpresets
instance.- OpenShift console: Click Home > Search > Podpresets.
- CLI: Run the following command to delete the
podpresets
resources: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-operator
and 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
secretshare
instances - 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-operator
andibm-corssplane-provider-operator
operator 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.io
oc get lock.pkg.ibm.crossplane.io -A --no-headers | awk '{print $1}' | xargs oc delete --ignore-not-found lock.pkg.ibm.crossplane.io
oc 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-crossplane
oc delete csv <csv_name> -n <controlNamespace>
oc delete sub ibm-crossplane-operator-app -n <controlNamespace> --ignore-not-found
oc delete sub ibm-crossplane-provider-kubernetes-operator-app -n <controlNamespace> --ignore-not-found
oc 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.v3
oc delete csv <csv_name> -n <controlNamespace>
oc delete sub ibm-cert-manager-operator -n <controlNamespace> --ignore-not-found
-
-