Stateful Storage

Persistent volumes and claims. What survives a restart, and what does not.

Stateful Storage: rendered example
Rendered by Gnomon from the source below. No edits.

The source

30 lines of PlantUML, and pulls in Kubernetes icons. Copy it, or open the template inside Gnomon and render it as it is.

@startuml
!define KubernetesPuml https://raw.githubusercontent.com/dcasati/kubernetes-PlantUML/master/dist
!include KubernetesPuml/kubernetes_Common.puml
!include KubernetesPuml/kubernetes_Simplified.puml
!include KubernetesPuml/OSS/KubernetesSts.puml
!include KubernetesPuml/OSS/KubernetesPod.puml
!include KubernetesPuml/OSS/KubernetesPvc.puml
!include KubernetesPuml/OSS/KubernetesPv.puml
!include KubernetesPuml/OSS/KubernetesSc.puml

title Kubernetes — Stateful storage

KubernetesSts(sts, "postgres", "2 replicas")
KubernetesPod(pod1, "postgres-0", "")
KubernetesPod(pod2, "postgres-1", "")
KubernetesPvc(pvc1, "data-postgres-0", "20Gi")
KubernetesPvc(pvc2, "data-postgres-1", "20Gi")
KubernetesPv(pv1, "pv-a", "")
KubernetesPv(pv2, "pv-b", "")
KubernetesSc(sc, "fast-ssd", "dynamic")

sts --> pod1
sts --> pod2
pod1 --> pvc1
pod2 --> pvc2
pvc1 --> pv1
pvc2 --> pv2
sc ..> pv1
sc ..> pv2
@enduml

Render this offline

This template ships in Gnomon and renders on your machine, with no account and nothing sent to a server. The browser editor is free and needs no install.

Get GnomonOpen the browser editor

Others in Kubernetes diagrams