# Configuring Containerd Storage

Platform9 recommends configuring extra storage for /var/lib/containerd directory. This is the location where all the container images and other containerd metadata is stored.

By Default the PMK Nodelet service has the following behaviour when configuring containerd storage on the nodes:

* If `/var/lib/containerd` is already mounted on an additional device, then it uses the same mount point.
* if `/var/lib/containerd` is not mounted, then Nodelet looks for local disks of size >= 100 GB on the node.
  * A disk which is not in use anywhere(not mounted on any path) is looked for and the discovery is stopped as soon as the condition is satisfied and the `/var/lib/containerd` is mounted to that disk.

### Using specific disk for containerd storage

The above mentioned default behaviour can have some undesired consequences such as:

* If the node has multiple unused disks of size >= 100GB and nodelet can use the unintended one, which was supposed to used for some other purpose.

**Following flags can be used to specify the disk to be used:**

* `DISABLE_CONTAINERD_MOUNT`: Disable discovery mechanism for free disks during containerd configuration.
  * Example: export `DISABLE_CONTAINERD_MOUNT`=true
* `CONTAINERD_DEVICE`: Specify the device that nodelet should use to mount /var/lib/containerd.
  * Example: export `CONTAINERD_DEVICE`=/dev/sdc1

The above flags need to be specified in `/etc/pf9/kube_override.env` file on every node of the cluster.

{% hint style="info" %}
If `/var/lib/containerd` is already mounted, Nodelet will skip using the configuration present in `/etc/pf9/kube_override.env` file.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-kubernetes/5.15/clusters/advanced-cluster-configuration/configuring-containerd-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
