# Uninstalling Connectware (Kubernetes)

Uninstalling Connectware removes Connectware from your system, including all containers, volumes, and service configurations.

{% hint style="warning" %}
Make sure to back up any important data before proceeding with the uninstallation, as this process will permanently remove all Connectware-related data from your system.
{% endhint %}

## Prerequisites

* [Helm version 3](https://helm.sh/docs/intro/quickstart/#install-helm) is installed on your system.
* [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) is installed on your system.
* You know the name and namespace of your Connectware installation (see [Obtaining the Name, Namespace, and Version of your Connectware Installation](https://docs.cybus.io/2-1-0/connectware-on-kubernetes/connectware-helm-chart#obtaining-the-name-namespace-and-version-of-your-connectware-installation)).

## Uninstalling Connectware

To uninstall Connectware, use the helm uninstall command on your Connectware on Kubernetes installation:

{% code lineNumbers="true" %}

```bash
helm uninstall -n ${NAMESPACE} ${INSTALLATION_NAME}
```

{% endcode %}

## Cleaning up Leftover Resources

Some resources will intentionally not be removed, like some PersistentVolumeClaims, and potentially ConfigMaps and secrets manually created for mTLS.

If you want to completely clean up, for example for a fresh install, use this command to identify the resources:

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} get all,cm,secret,pvc
```

{% endcode %}

Keep in mind that some resources are part of a standard Kubernetes namespace, for example `configmap/kube-root-ca.crt` or `service/kubernetes`. After identifying the resources for cleanup, use this command to remove them:

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} delete <resource-1> <resource-2> <resource-n>
```

{% endcode %}

**Example**

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} delete persistentvolumeclaim/brokerdata-broker-0
persistentvolumeclaim/brokerdata-broker-1 configmap/cw-mtls-ca-cert
secret/cw-mtls-welder-robots
persistentvolumeclaim/postgresql-postgresql-0
persistentvolumeclaim/certs
```

{% endcode %}

{% hint style="info" %}
If you plan a fresh installation in the same location, make sure to remove `persistentvolumeclaim/postgresql-postgresql-0` and `persistentvolumeclaim/certs`.
{% endhint %}
