Skip to content
Graphviz (DOT) templates

StatefulSet — Database Cluster

Headless service + StatefulSet with ordered pods and persistent volumes.

Template previewGraphviz (DOT)
sts HS Headless Service (db.default.svc) P0 pod db-0 (primary) HS->P0 P1 pod db-1 (replica) HS->P1 P2 pod db-2 (replica) HS->P2 P0->P1 replicate P0->P2 replicate V0 PVC data-db-0 P0->V0 V1 PVC data-db-1 P1->V1 V2 PVC data-db-2 P2->V2

What this template contains

Graph
Directed
Edges
8
Source
16 lines

Make it your own.

digraph sts {
  rankdir=LR;
  graph [bgcolor=transparent];
  node [shape=box, style="rounded,filled", fontname=Inter, fontsize=10];

  HS [label="Headless Service\n(db.default.svc)", fillcolor="#dbeafe"];
  P0 [label="pod db-0\n(primary)", fillcolor="#fce7f3"];
  P1 [label="pod db-1\n(replica)"];
  P2 [label="pod db-2\n(replica)"];
  V0 [label="PVC data-db-0", shape=cylinder, fillcolor="#fef3c7"];
  V1 [label="PVC data-db-1", shape=cylinder, fillcolor="#fef3c7"];
  V2 [label="PVC data-db-2", shape=cylinder, fillcolor="#fef3c7"];

  HS -> P0; HS -> P1; HS -> P2;
  P0 -> V0; P1 -> V1; P2 -> V2;
  P0 -> P1 [label="replicate", style=dashed];
  P0 -> P2 [label="replicate", style=dashed];
}