You've already forked Curso-lenguaje-python
Add diagrams test
This commit is contained in:
20
catch-all/07_diagrams_as_code/06_stateful_k8s.py
Normal file
20
catch-all/07_diagrams_as_code/06_stateful_k8s.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
from diagrams import Cluster, Diagram
|
||||
from diagrams.k8s.compute import Pod, StatefulSet
|
||||
from diagrams.k8s.network import Service
|
||||
from diagrams.k8s.storage import PV, PVC, StorageClass
|
||||
|
||||
with Diagram("Stateful Architecture", show=False):
|
||||
with Cluster("Apps"):
|
||||
svc = Service("svc")
|
||||
sts = StatefulSet("sts")
|
||||
|
||||
apps = []
|
||||
for _ in range(3):
|
||||
pod = Pod("pod")
|
||||
pvc = PVC("pvc")
|
||||
pod - sts - pvc
|
||||
apps.append(svc >> pod >> pvc)
|
||||
|
||||
apps << PV("pv") << StorageClass("sc")
|
||||
Reference in New Issue
Block a user