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

# Storage

> How the apps you install keep their data: persistent volumes, StorageClasses and local-path storage on hosted Clusters

![A local-path volume bound to one worker node with pod placement constraints made visible.](https://docs.akua.dev/images/heros/local-path-light.svg)

Most apps keep data that must outlive a single container: a database, file uploads or a queue.
For example, a booking app stores its appointments in a database that must survive a restart.
Kubernetes provides this through persistent volumes, and a StorageClass decides how each volume is created.

## What a Cluster offers

A Cluster lists the StorageClasses Akua runs on it in `storage_classes`. Each class has an `attachment`:

* `node_local`: the volume lives on the disk of the node its first Pod ran on. It is the fastest option, and it stays on that node.
* `network`: the volume attaches over the network and follows its Pod to another node.

A hosted Cluster starts with [local path](#local-path), a `node_local` class named `local-path`.

No class is the Cluster default. Every volume an Install renders names its StorageClass explicitly.

## How an Install picks a class

When you create an Install, you can pass `storage_class` to name the class for every volume the Package renders. If you leave it out, Akua picks one the Cluster offers: its only class, otherwise a `network` class before a `node_local` one, and then the first by name. The Install reports the class it used in `storage_class`; it is null when the Package claims no volume.

If the Package claims volumes and the Cluster offers no StorageClass, Akua adds `local-path` when you hold the `cluster.addons.create` permission. Otherwise the Install fails with `storage-class-unavailable`. Install again after a Workspace admin adds storage, or name a class the Cluster has.

## Local path

Local path is the storage Akua runs on every hosted Cluster. It creates a volume as a directory on the disk of a node, so reads and writes go straight to local disk. The Cluster lists it as `local-path` with `attachment: node_local`.

* A volume is created once a Pod that uses it is scheduled (`WaitForFirstConsumer`), on the node that Pod runs on.
* The volume stays on that node. Pods that use it are scheduled back to the same node.
* Deleting the PersistentVolumeClaim deletes the volume and its data (reclaim policy `Delete`).

> [!WARNING]
>
> Local path stores data on one node and doesn't replicate it. If that node is removed or fails, the data on it is lost. Use it for workloads that replicate their own data, or that you can rebuild.

Akua places local path on a hosted Cluster as part of its baseline. You can read the Cluster's capabilities with `akua clusters list-capabilities CLUSTER_ID`.

## Attached clusters

On an [attached cluster](https://docs.akua.dev/clusters/import.md), the storage is whatever your cluster provides. Use a StorageClass your cluster already has, and pass its name as `storage_class` when you install.

## Related topics

> [card] [Create a cluster](https://docs.akua.dev/clusters/create.md)
>
> Set up a hosted Cluster.

> [card] [Add servers](https://docs.akua.dev/clusters/add-workers.md)
>
> Join the servers that provide the disks.

> [card] [Clusters overview](https://docs.akua.dev/clusters.md)
>
> Hosted and attached Clusters.

> [card] [Quotas and limits](https://docs.akua.dev/platform/quotas.md)
>
> Limits that apply to Clusters and servers.
