---
title: Charmhub | Deploy Opensearch K8S using Charmhub - The Open Operator Collection
description: Deploy the latest version of Opensearch K8S as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/opensearch-k8s/docs/t-clean-up
---

# Opensearch K8S

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

Platform:

2/edge 22

```
juju deploy opensearch-k8s --channel 2/edge
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

> [Charmed OpenSearch Tutorial](https://charmhub.io/opensearch-k8s/docs/tutorial) > 7. Clean up the environment

# Clean up the environment

In this tutorial, we’ve successfully:

* Deployed OpenSearch on LXD
* Enabled TLS
* Integrated with a client application
* Rotated user credentials
* Scaled our deployment

You may now keep your OpenSearch deployment running to continue experimenting or remove it entirely to free up resources on your machine.

## [Remove Charmed OpenSearch](https://charmhub.io/opensearch-k8s/docs/t-clean-up#p-24546-remove-charmed-opensearch)

> **Warning:** When you remove Charmed OpenSearch as shown below, you will lose all the data in your cluster.

To remove Charmed OpenSearch and the model it is hosted on, run this command:

```
juju destroy-model tutorial --destroy-storage --force --no-wait
```

The next step is to remove the Juju controller. You can see all of the available controllers by entering `juju controllers`.

To remove the controller created for this tutorial, enter:

```
juju destroy-controller opensearch-demo
```

Then, don’t forget to delete the Juju model configuration file.

```
rm cloudinit-userdata.yaml
```

## [Remove Juju](https://charmhub.io/opensearch-k8s/docs/t-clean-up#p-24546-remove-juju)

> **Warning:** When you remove Juju as shown below you will lose access to any other applications you have hosted on Juju.

To remove Juju altogether, enter:

```
sudo snap remove juju --purge
```

## [Remove LXD](https://charmhub.io/opensearch-k8s/docs/t-clean-up#p-24546-remove-lxd)

> **Warning:** When you remove LXD as shown below you will lose access to any other applications you have hosted on LXD.

You can list all your currently running LXD container with `lxc list`.

To uninstall Juju, enter:

```
sudo snap remove lxd --purge
```

## [Reset the Kernel parameters](https://charmhub.io/opensearch-k8s/docs/t-clean-up#p-24546-reset-the-kernel-parameters)

> **Warning:** In the following command, use the values you saved during step 1 → Get default values.

If you did not save those values, use the second reset option.

Leaving the custom kernel parameters outside of this tutorial scope can impact the host machine’s performance.

To reset them, you can either :

* Reboot your computer
* Set your original parameters with the following command :

```
sudo tee -a /etc/sysctl.conf > /dev/null <<EOT
vm.max_map_count=262144
vm.swappiness=60
net.ipv4.tcp_retries2=15
fs.file-max=1048576
EOT

sudo sysctl -p
```

---

## [What next?](https://charmhub.io/opensearch-k8s/docs/t-clean-up#p-24546-what-next)

* Check out other charms on [charmhub.io](https://charmhub.io/)
* Read about [High Availability Best Practices](https://canonical.com/blog/database-high-availability)
* [Report](https://github.com/canonical/opensearch-operator/issues) any problems you encountered
* [Give us your feedback](https://chat.charmhub.io/charmhub/channels/data-platform).
* [Contribute to the code base](https://github.com/canonical/opensearch-operator)

---
