---
id: "k8s-volume"
type: "component"
kind: "block-storage"
provider: "k8s"
category: "data"
docs: "https://kubernetes.io/docs/concepts/storage/volumes/"
url: "https://localhost:3000/catalogue/components/k8s-volume"
---

# Volume

Directory mounted into a Pod's containers, ephemeral with the Pod unless backed by a persistent claim.

| | |
|---|---|
| Provider | [k8s](https://localhost:3000/catalogue?provider=k8s) |
| Kind | [Block storage volume](https://localhost:3000/catalogue/kinds/block-storage) |
| Category | Data |
| Official docs | [https://kubernetes.io/docs/concepts/storage/volumes/](https://kubernetes.io/docs/concepts/storage/volumes/) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `emptyDirMedium` | enum | `node-disk`, `memory` | no | "node-disk" | inherited |
| `encryptionAtRest` | boolean | — | no | — | inherited |
| `iops` | integer | — | no | — | inherited |
| `lifetime` | enum | `ephemeral`, `persistent` | no | "ephemeral" | inherited |
| `managed` | boolean | — | no | false | **false** |
| `mediaType` | enum | `ssd`, `hdd` | no | — | inherited |
| `redundancy` | enum | `local`, `zonal`, `regional` | no | — | inherited |
| `sizeGib` | integer | — | no | — | inherited |
| `snapshots` | boolean | — | no | false | inherited |
| `survivesContainerRestart` | boolean | — | no | true | inherited |
| `survivesPodDeletion` | boolean | — | no | false | inherited |
| `volumeSource` | enum | `empty-dir`, `host-path`, `config-map`, `secret`, `downward-api`, `projected`, `persistent-volume-claim`, `nfs`, `iscsi`, `local`, `image`, `csi` | no | — | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 28

- [Elastic Block Storage](https://localhost:3000/catalogue/components/alibaba-ebs.md) `alibaba-ebs` — alibabacloud
- [Amazon EBS](https://localhost:3000/catalogue/components/aws-ebs.md) `aws-ebs` — aws
- [EC2 instance store](https://localhost:3000/catalogue/components/aws-instance-store.md) `aws-instance-store` — aws
- [Azure Container Storage](https://localhost:3000/catalogue/components/azure-container-storage.md) `azure-container-storage` — azure
- [Azure Elastic SAN](https://localhost:3000/catalogue/components/azure-elastic-san.md) `azure-elastic-san` — azure
- [Azure Disk Storage](https://localhost:3000/catalogue/components/azure-managed-disk.md) `azure-managed-disk` — azure
- [Generic block storage volume](https://localhost:3000/catalogue/components/block-storage.md) `block-storage` — default
- [Block volume](https://localhost:3000/catalogue/components/block-volume.md) `block-volume` — default
- [Ceph RBD](https://localhost:3000/catalogue/components/ceph-rbd.md) `ceph-rbd` — default
- [Longhorn](https://localhost:3000/catalogue/components/longhorn.md) `longhorn` — default
- [OpenEBS](https://localhost:3000/catalogue/components/openebs.md) `openebs` — default
- [OpenZFS](https://localhost:3000/catalogue/components/openzfs.md) `openzfs` — default
- [Portworx](https://localhost:3000/catalogue/components/portworx.md) `portworx` — default
- [Volumes Block Storage](https://localhost:3000/catalogue/components/digitalocean-volumes.md) `digitalocean-volumes` — digitalocean
- [Hyperdisk](https://localhost:3000/catalogue/components/google-hyperdisk.md) `google-hyperdisk` — gcp
- [Local SSD](https://localhost:3000/catalogue/components/google-local-ssd.md) `google-local-ssd` — gcp
- [Persistent Disk](https://localhost:3000/catalogue/components/google-persistent-disk.md) `google-persistent-disk` — gcp
- [IBM Cloud Block Storage for VPC](https://localhost:3000/catalogue/components/ibm-block-storage.md) `ibm-block-storage` — ibm
- [Block Storage for Classic](https://localhost:3000/catalogue/components/ibm-block-storage-classic.md) `ibm-block-storage-classic` — ibm
- [IBM Storage Ceph as a Service](https://localhost:3000/catalogue/components/ibm-storage-ceph.md) `ibm-storage-ceph` — ibm
- [PersistentVolume](https://localhost:3000/catalogue/components/k8s-persistent-volume.md) `k8s-persistent-volume` — k8s
- [PersistentVolumeClaim](https://localhost:3000/catalogue/components/k8s-persistent-volume-claim.md) `k8s-persistent-volume-claim` — k8s
- [StorageClass](https://localhost:3000/catalogue/components/k8s-storage-class.md) `k8s-storage-class` — k8s
- [OCI Block Volume](https://localhost:3000/catalogue/components/oci-block-volume.md) `oci-block-volume` — oci
- [OCI Boot Volume](https://localhost:3000/catalogue/components/oci-boot-volume.md) `oci-boot-volume` — oci
- [OCI Local NVMe Storage](https://localhost:3000/catalogue/components/oci-local-nvme.md) `oci-local-nvme` — oci
- [OpenStack Cinder](https://localhost:3000/catalogue/components/openstack-cinder.md) `openstack-cinder` — openstack
- [Block Storage Unit (BSU)](https://localhost:3000/catalogue/components/outscale-bsu.md) `outscale-bsu` — outscale

## Use it in a design

```yaml
nodes:
  - { id: "k8s-volume", component: "k8s-volume" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Kubernetes Volume: a directory mounted into a Pod's containers. Per "Volumes" an ephemeral volume
# lives exactly as long as its Pod and is destroyed with it, while a volume backed by a
# PersistentVolumeClaim outlives the Pod; data in any volume survives a container crash or restart.
# An emptyDir is stored on whatever medium backs the node unless emptyDir.medium is set to Memory.
schemaVersion: "1"
type: "component"
id: "k8s-volume"
kind: "block-storage"
provider: "k8s"
docs: "https://kubernetes.io/docs/concepts/storage/volumes/"
defaults:
  managed: false
properties:
  lifetime:
    type: "enum"
    values: ["ephemeral", "persistent"]
    default: "ephemeral"
  volumeSource:
    type: "enum"
    values: ["empty-dir", "host-path", "config-map", "secret", "downward-api", "projected", "persistent-volume-claim", "nfs", "iscsi", "local", "image", "csi"]
  emptyDirMedium:
    type: "enum"
    values: ["node-disk", "memory"]
    default: "node-disk"
  survivesContainerRestart:
    type: "boolean"
    default: true
  survivesPodDeletion:
    type: "boolean"
    default: false
```

Human page: https://localhost:3000/catalogue/components/k8s-volume
