> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seekr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uninstall SeekrFlow

> Remove a SeekrFlow Self-Managed deployment and the resources it leaves behind.

Uninstalling removes SeekrFlow from the cluster. To protect your data, it keeps some resources in place. See [Remove retained resources](#remove-retained-resources).

## Uninstall

<Tabs>
  <Tab title="With the sfe CLI">
    <Steps>
      <Step title="Preview the uninstall">
        ```bash theme={null}
        sfe uninstall -p <profile-name> --dry-run
        ```
      </Step>

      <Step title="Uninstall">
        ```bash theme={null}
        sfe uninstall -p <profile-name>
        ```

        `sfe` asks you to confirm. It removes the resources SeekrFlow created while it ran, then uninstalls the release. If it stalls, add `--force` to finish. A forced uninstall can leave resources behind.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Without the sfe CLI">
    <Steps>
      <Step title="Delete the resources SeekrFlow created">
        While the operator is still running, delete the agents, tools, models, and LoRA syncs it created:

        ```bash theme={null}
        kubectl delete agents.seekr.ai,tools.seekr.ai,flowmodels.seekr.ai,lorasyncs.seekr.ai --all -n seekrflow
        ```

        Without this step, these resources hold the namespace in `Terminating` after the uninstall removes the operator.
      </Step>

      <Step title="Uninstall">
        ```bash theme={null}
        helm uninstall seekrflow --namespace seekrflow
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Remove retained resources

The uninstall keeps these resources, so that uninstalling by mistake doesn't destroy data.

To reinstall after a failed first install, remove the namespaces and databases, then start again from [Create the namespaces](/self-managed/flow/provision/cluster#create-the-namespaces). Reuse your values file rather than running `sfe bootstrap` again.

<Danger>
  Removing these resources is permanent, and destroys your deployment's data. Remove them only if you want the deployment gone entirely. To keep a copy of the databases, back them up first. See [Back up the databases](/self-managed/flow/operate/upgrade#before-you-upgrade).
</Danger>

| Resource | How to remove it |
| - | - |
| The `seekrflow` and `argo-workflows` namespaces, including their secrets and persistent volume claims | `kubectl delete namespace seekrflow argo-workflows` |
| Persistent volumes with a `Retain` reclaim policy, which outlive the namespace | Find them with `kubectl get pv`, then delete the ones SeekrFlow used. |
| SeekrFlow's custom resource definitions | Delete them by name. See [Delete the custom resource definitions](#delete-the-custom-resource-definitions). |
| SeekrFlow's databases and login roles in PostgreSQL | Delete the instance, or drop only SeekrFlow's databases and roles. See [Drop the databases and roles](#drop-the-databases-and-roles). |
| Files in your object storage bucket | Your cloud provider's or object store's tools. |
| Secrets in your secret store, under `seekrflow/` | Your secret store's tools. |
| Cloud resources you created in Provision, such as roles and Pod Identity associations | Your cloud provider's tools. |

### Delete the custom resource definitions

```bash theme={null}
kubectl delete crd seekrfloweverywheres.seekr.ai flowservices.seekr.ai flowmodels.seekr.ai \
  agents.seekr.ai tools.seekr.ai lorasyncs.seekr.ai loraadapters.production-stack.vllm.ai
```

<Danger>
  Deleting a custom resource definition deletes every resource of that kind across the whole cluster, not only in the `seekrflow` namespace. Skip any definition that other software on the cluster uses.
</Danger>

### Drop the databases and roles

If you created the PostgreSQL instance only for SeekrFlow, delete the instance instead. If other applications use it, drop only SeekrFlow's databases and roles. Connect to the `postgres` database as your admin account, then run these statements. If you didn't enable Keycloak, the `keycloak` statements do nothing:

```sql theme={null}
DROP DATABASE IF EXISTS seekrflow;
DROP DATABASE IF EXISTS agents;
DROP DATABASE IF EXISTS user_auth;
DROP DATABASE IF EXISTS metaflow;
DROP DATABASE IF EXISTS mlflow;
DROP DATABASE IF EXISTS keycloak;

DROP ROLE IF EXISTS seekrflow_app;
DROP ROLE IF EXISTS seekrflow_keycloak;
DROP ROLE IF EXISTS seekrflow_read_write, seekrflow_read_only;
DROP ROLE IF EXISTS agents_read_write, agents_read_only;
DROP ROLE IF EXISTS user_auth_read_write, user_auth_read_only;
DROP ROLE IF EXISTS metaflow_read_write, metaflow_read_only;
DROP ROLE IF EXISTS mlflow_read_write, mlflow_read_only;
DROP ROLE IF EXISTS keycloak_read_write, keycloak_read_only;
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.