# How To Clean up Decommissioned Node Manually

## Problem

Cleaning up the decommissioned node manually.

## Environment

* Platform9 Managed Kubernetes- All Versions

## Procedure

1. Stop the Platform9 Managed Kubernetes Stack:

{% tabs %}
{% tab title="Bash" %}

```bash
~$ sudo systemctl stop pf9-hostagent pf9-nodeletd
~$ sudo /opt/pf9/nodelet/nodeletd phases stop
```

{% endtab %}
{% endtabs %}

2. Erase the pf9-hostagent package from node:

{% tabs %}
{% tab title="Bash" %}

```bash
~$ sudo yum erase pf9-hostagent docker-ce* docker-ce-cli* containerd* -y
```

{% endtab %}
{% endtabs %}

3. If the stale directories exists, remove them by using the below command:

{% tabs %}
{% tab title="Bash" %}

```bash
~$ sudo rm -rf /opt/pf9/ /etc/pf9/ /root/pf9 /usr/bin/pf9ctl /var/log/pf9 /opt/cni /etc/cni/ /opt/containerd /var/lib/kubelet/cpu_manager_state /var/opt/pf9 /etc/yum.repos.d/* /var/lib/docker/ /var/lib/containerd
```

{% endtab %}
{% endtabs %}

Optionally, delete the temporary files in /tmp:

{% tabs %}
{% tab title="Bash" %}

```bash
~$ cd /tmp && rm -rf docker-* hostagent* kube-scheduler-*
```

{% endtab %}
{% endtabs %}

4. Reboot the node to ensure there is no residual process.

{% tabs %}
{% tab title="Bash" %}

```bash
~$ sudo reboot
```

{% endtab %}
{% endtabs %}

###
