manage delete-cr

Uninstall the specified components from the specified project (namespace). This command deletes the custom resources that are associated with the components.

Extended description

To uninstall a service, you must delete the custom resource for the service. The delete-cr command deletes the custom resources that are associated with the specified components.

Deleting the custom resource does not delete the OLM artifacts.
  • If you delete the custom resource, you can reinstall the service by running the apply-cr command.
  • If you want to delete the OLM artifacts to completely remove the software from the cluster, run the delete-olm-artifacts command.

You can uninstall the components in a batch by specifying a comma-separated list of components, or you can uninstall components individually.

Syntax

cpd-cli manage delete-cr \
--cpd_instance_ns=<project-name> \
--components=<comma-separated-list-of-component-names> \
[--include_dependency=true|false] \
[--preview=true|false] \
[-v][-vv][-vvv]

Arguments

The delete-cr command has no arguments.

Options

Table 1: Command options
Option Description
--components A comma-separated list of the components that you want to uninstall.
Status
Required.
Syntax
--components=<comma-separated-list-of-component-names>
Default value
There is no default value. The list depends on which components you want to uninstall.
Valid values
For the list of components, see Component IDs.

You can specify individual components or a comma-separated list of components.

--cpd_instance_ns The project (namespace) where IBM Cloud Pak® for Data is installed.
Status
Required.
Syntax
--cpd_instance_ns=<project-name>
Default value
No default. User-defined.
Valid values
The name of the project (namespace) where the software that you want to remove is installed.
--include_dependency Specify whether you want to remove the dependencies for the specified components.
Status
Optional.
Syntax
--include_dependency=true|false
Default value
false
Valid values
false
Do not delete the dependencies of the specified components.
true
Delete any dependencies of the specified components.

If you are removing a subset of the components in the instance, the dependencies will not be removed if they are still being used by another component in the instance. For example, if you remove IBM Knowledge Catalog but Watson Studio is still installed in the instance, the common core services will not be uninstalled.

--preview Preview the commands that run when you issue this CLI command.

The command issues a series of oc commands. You can see the list of oc commands that are associated with the command.

The oc commands are saved to the preview.sh file in the work directory.

Status
Optional.
Syntax
--preview=true|false
Default value
false

If you omit this option, the default value is used.

Valid values
false
Run the commands to apply the changes to your cluster.
true
Preview the commands without running them.

You can copy the oc commands from the output and run them yourself. However, this method is not recommended. When you run the commands manually, you do not have access to the additional helper scripts that are included in the underlying Ansible® playbook.

-v
-vv
-vvv
Display verbose output.

Options are listed from least verbose to the most verbose.

Status
Optional.
Syntax
Verbose output
-v
Very verbose output
-vv
Most verbose output
-vvv
Default value
Not applicable.
Valid values
Not applicable.

Examples

Note: The following example uses the recommended installation environment variables.

It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For details, see Setting up installation environment variables.

Uninstall the specified components in the specified project.
cpd-cli manage delete-cr \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=${COMPONENTS}
Uninstall the specified components and their dependencies in the specified project.
cpd-cli manage delete-cr \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=${COMPONENTS} \
--include_dependency=true
Uninstall the Db2 Warehouse component in the specified project.
cpd-cli manage delete-cr \
--components=db2wh \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
Preview the oc commands to uninstall the Db2 Warehouse component in the specified project
cpd-cli manage delete-cr \
--components=db2wh \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--preview=true