manage uninstall-components

Uninstall the specified components.

Extended description

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

In addition the command deletes the following resources associated with the instance:
  • Helm releases
  • Kubernetes resources
  • OLM artifacts, including:
    • Catalog sources
    • Cluster service versions
    • Operator subscriptions

The command does not delete the cluster-scoped resources associated with the instance. If you want to delete the cluster-scoped resources, you must run the cpd-cli manage delete-cluster-scoped-resources command.

You can uninstall the components in several ways. You can uninstall:
  • A single component associated with the instance
  • A group of components associated with the instance (by specifying a comma-separated list of components)
  • All of the components associated with an instance (by specifying the --delete_all_components option)

Syntax

cpd-cli manage uninstall-components \
--instance-name=<project-name> \
[--components=<comma-separated-list-of-component-names>] \
[--delete_all_components=true|false] \
[--include_dependency=true|false] \
[--preview=true|false]

Arguments

The uninstall-components 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
Optional.

If you don't specify this option, you must specify the --delete_all_components option.

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.

--delete_all_components Delete the Kubernetes, Helm, and OLM resources for all of the components in the specified project.
Status
Optional.

If you don't specify this option, you must specify the --components option.

Syntax
--delete_all_components=true|false
Default value
false

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

Valid values
false
Do not delete all of the components associated with the instance.
true
Delete all of the components associated with the instance.
--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.

--instance_ns The project (namespace) where IBM Software Hub is installed.
Status
Required.
Syntax
--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.
--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.

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 uninstall-components \
--instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=${COMPONENTS}
Uninstall the specified components and their dependencies in the specified project.
cpd-cli manage uninstall-components \
--instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=${COMPONENTS} \
--include_dependency=true
Uninstall the Db2 Warehouse component in the specified project.
cpd-cli manage uninstall-components \
--instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=db2wh
Preview the oc commands to uninstall the Db2 Warehouse component in the specified project
cpd-cli manage uninstall-components \
--instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=db2wh \
--preview=true