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 no diagram uploads. The browser editor is free and needs no install.

Get GnomonOpen the browser editor

Others in Kubernetes diagrams

Analytics cookies (optional)

May we use Google Analytics to understand visits, product links and feature use? If you accept, Google receives usage and device information, including your IP address, and sets analytics cookies. We do not send your documents, filenames or account details. Advertising features are disabled.

Analytics is off until you accept. Your choice is saved on this browser for 180 days using necessary local storage. You can change it at any time in Analytics preferences. Closing this message rejects analytics. Read our privacy policy.