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

# Persistent storage

> How LKS gives Workloads persistent volumes backed by Latitude Block Storage and File Storage

LKS provisions persistent volumes for your `PersistentVolumeClaims`, in two kinds:

* **Block volumes.** A Latitude [Block Storage](https://www.latitude.sh/docs/storage/block-storage.md) volume, attached to the Node running the Pod. Use them for data one Node works on at a time, such as a database. This is the default.
* **Shared volumes.** A Latitude [File Storage](https://www.latitude.sh/docs/storage/filesystem.md) filesystem, mounted over NFS by Pods on any number of Nodes at once. Use them for data several Pods share, such as uploads, build caches, or model files.

The data stays on the volume when the Pod restarts, or moves to another Node if needed.

## How it works

### Block volumes

* **Created on first use.** A volume is created when a Pod first uses the claim, in the Cluster's location. Until then the claim stays `Pending`.
* **One Node at a time.** A volume is attached to one Node at a time (`ReadWriteOnce`). Pods on that Node can share it.
* **Follows the Pod.** When the Pod moves to another Node, the volume is detached from the old Node and attached to the new one, with its data.
* **Grows on request.** Increasing a claim's size grows the volume and its filesystem while the Pod keeps running.
* **Deleted or kept with the claim.** Deleting the claim deletes the volume, or keeps it in your project, depending on the StorageClass.

The first volume attached in a project can take up to two minutes while the Node joins the project's storage network. Later attaches take seconds.

See [Persistent volumes](https://www.latitude.sh/docs/lks/persistent-volumes.md).

### Shared volumes

* **Created with the claim.** A filesystem is created as soon as you create a claim against `latitude-file`, in the Cluster's location.
* **Many Nodes at once.** Every Pod that uses the claim mounts the same filesystem, on whichever Node it runs (`ReadWriteMany`).
* **Grows on request.** Increasing a claim's size grows the filesystem while Pods keep using it.
* **Deleted or kept with the claim.** Deleting the claim deletes the filesystem, or keeps it in your project, depending on the StorageClass.

The first shared volume on a Node adds about 20 to 30 seconds to the Pod's start while the Node joins the project's storage network. Later Pods on that Node mount at once.

See [File volumes](https://www.latitude.sh/docs/lks/file-volumes.md).

## Availability

Persistent storage is available for Clusters in locations with Latitude Block Storage. See [Feature availability by location](https://www.latitude.sh/docs/regions-locations.md#feature-availability-by-location). Shared volumes are available wherever block volumes are.

> [!NOTE]
>
> Persistent storage is rolling out by location. If your Cluster has no `latitude-block` StorageClass (`kubectl get storageclass`), it isn't available for your Cluster yet. If it has `latitude-block` but no `latitude-file`, shared volumes aren't available for your Cluster yet.

## High availability

A block volume is attached to one Node at a time, so a Pod that uses it runs on that Node only. If the Node stops, the volume moves to another Node once the platform confirms the Node is down, which takes a few minutes. Until then the Pod isn't restarted elsewhere.

For a Workload that must stay available through a Node failure, run several replicas that each keep their own copy of the data, such as a database with replication in a StatefulSet.

A shared volume is mounted on every Node that runs one of its Pods. When one Node stops, replicas on other Nodes keep using the volume, and a replacement Pod can mount it on another Node without waiting for the volume to move.

## Not yet supported

* Volume snapshots and clones.
* Raw block volumes (`volumeMode: Block`).
* NFSv3 for shared volumes.


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