Example #1
0
def basic_vault_agent_architecture():
    with Diagram(name="Vault Agent Architecture", show=False, direction="LR"):

        with Cluster("Control Plane"):
            apiserver = APIServer()

        with Cluster("Vault"):
            svc = Service(":8200")
            certs_secret = Secret("Certs Secret")
            vault_configmap = ConfigMap("Vault Config")
            vault = Vault("Vault")
            file_backend = PV("Encrypted Store")

            vault >> file_backend
            vault >> Edge() << svc
            vault << certs_secret
            vault << vault_configmap

        with Cluster("Secure Pod"):
            vault_agent = Custom("Vault Agent", crio_icon)
            vault_init_agent = Custom("Init Vault Agent", crio_icon)

            manual = [vault_init_agent, vault_agent]

            app_container = Custom("App", crio_icon)
            inMemory = Vol("In Memory")

            manual >> inMemory
            app_container << inMemory

            manual << svc << manual >> Edge() << app_container

        apiserver >> Edge() << vault
Example #2
0
from diagrams.onprem.network import Internet
from diagrams.onprem.network import Internet
from diagrams.k8s.compute import Deploy
from diagrams.k8s.network import Ingress
from diagrams.k8s.podconfig import Secret
from diagrams.k8s.podconfig import ConfigMap
with Diagram("kubernetes deployment nodejs postgresql ingress", show=False):
    with Cluster("Kubernetes Components"):
        with Cluster("Services"):
            service_internal_node = Service("Internal Node Service")
            service_internal_postgres = Service("Internal Postgres Service")
        with Cluster("Ingress"):
            ingress = Ingress("Ingress")
        with Cluster("Pods"):
            postgresql = Pod("Postgresql")
            nodejs = Pod("Nodejs")

        with Cluster("configuration"):
            deployment = Deploy("Deployment")
            configmap = ConfigMap("ConfigMap")
            secret = Secret("Secret")
        deployment >> secret
        deployment >> configmap
        deployment >> Edge(label="defines") >> service_internal_node
        deployment >> Edge(label="defines") >> service_internal_postgres
        nodejs >> service_internal_postgres >> postgresql
    inet = Internet("Internet")
    inet >> ingress >> service_internal_node >> nodejs


        ing_chartmuseum = Nginx("Ingress") 
        #ing_deck = Nginx("deck") 
        #ing_hook = Nginx("hook")
        #ing_crier = Nginx("crier")

        with Cluster("Registries",graph_attr={"fontsize": "47"}):
            with Cluster("Nexus"):
                svc_nexus = custom.Custom("Nexus","assets/img/logos/logo_nexus.png")

                pod_nexus = Pod("nexus")
                secret_nexus = Secret("nexus")
                token_nexus = Secret("default-token")
                sa_nexus = ServiceAccount("default")
                data_volume = PVC("nexus-data-volume")
                config_volume_nexus = PV("nexus")
                configmap_nexus = ConfigMap("nexus")

                pod_nexus - Edge(color="gray", style="dashed") - secret_nexus - Edge(color="gray", style="dashed")  - token_nexus - Edge(color="gray", style="dashed")  - sa_nexus
                pod_nexus - Edge(color="gray", style="dashed") - config_volume_nexus

                svc_nexus >> pod_nexus

            with Cluster("Chartmusem"):
                svc_chartmuseum = custom.Custom("Chartmuseum","assets/img/logos/logo_chartmuseum.png")

                pod = Pod("chartmuseum")
                secret = Secret("chartmuseum")
                token = Secret("default-token")
                sa = ServiceAccount("default")    

                pod - Edge(color="gray", style="dashed")  - secret  - Edge(color="gray", style="dashed")  - token  - Edge(color="gray", style="dashed")  - sa
Example #4
0
from diagrams.k8s.compute import DaemonSet, Deployment, Pod, ReplicaSet
from diagrams.k8s.network import Ingress, Service
from diagrams.k8s.podconfig import ConfigMap
from diagrams.k8s.group import Namespace

with Diagram("JupyterHub Kubernetes Architecture", show=False):
    nublado_ns = Namespace("nublado")
    pp_net = Ingress("/pp")
    nb_net = Ingress("/nb")

    pp_svc = Service("Prepuller")
    pp_deploy = Deployment("Prepuller")
    pp_pod = Pod("Prepuller")
    pp_ds = DaemonSet("Single image puller")

    hub_config = ConfigMap("Hub Config YAML")

    hub_svc = Service("JupyterHub")
    hub_deploy = Deployment("JupyterHub")
    hub_pod = Pod("JupyterHub")

    proxy_svc = Service("JupyterHubProxy")
    proxy_deploy = Deployment("JupyterHubProxy")
    proxy_pod = Pod("JupyterHubProxy")

    user_ns = Namespace("nublado-lsptestuser01")
    user_lab_pod = Pod("JupyterLab pod")
    user_config = ConfigMap("Lab Config YAML + Token")

    nublado_ns >> nb_net >> proxy_svc >> proxy_deploy >> proxy_pod >> hub_svc
    nublado_ns >> pp_net >> pp_svc >> pp_deploy >> pp_pod >> hub_config >> pp_pod >> pp_ds
from diagrams import Cluster, Diagram
from diagrams.k8s.compute import Deploy, DaemonSet, Pod
from diagrams.k8s.podconfig import ConfigMap

with Diagram("kubernetes.deployment.enabled", show=True, direction="LR"):
    ds = None
    deploy = None
    with Cluster("Namespace\ninstana-agent"):
        with Cluster("Deployment\nkubernetes-sensor"):
            deploy = Pod("2 Replicas\nKubernetes Sensor")

        with Cluster("DaemonSet\ninstana-agent"):
            ds = Pod('Per Node\nHost & APM')

        cm = ConfigMap("instana-agent")
        dcm = ConfigMap("instana-agent-deployment")

        cm >> deploy
        cm >> ds
        dcm >> deploy
from diagrams.k8s.podconfig import ConfigMap
from diagrams.k8s.podconfig import Secret
from diagrams.k8s.compute import Pod
from diagrams.k8s.network import Ingress
from diagrams.onprem.network import Internet
from diagrams.k8s.compute import Deployment
from diagrams.k8s.compute import StatefulSet
from diagrams.k8s.infra import Node
from diagrams.k8s.compute import ReplicaSet
from diagrams.k8s.network import Service

with Diagram("kubernetes getting started", show=False):
    node = Node("Node")
    inet = Internet("Kubernetes")
    vol = Volume("Volumes")
    cm = ConfigMap("ConfigMap")
    secret = ConfigMap("Secret")
    pod = ConfigMap("Pod")
    ingress = Ingress("Ingress")
    depl = Deployment("Deployment")
    ss = StatefulSet("StatefulSet")
    service = Service("Service")
    rs = ReplicaSet("Replication")
    node << inet
    pod << inet
    service << inet
    ingress << inet
    rs << inet

    inet >> cm
    inet >> secret
from diagrams.k8s.compute import Pod
from diagrams.k8s.network import Service
from diagrams.k8s.podconfig import Secret, ConfigMap
from diagrams.oci.compute import Container
from diagrams.onprem.container import Docker
from diagrams.onprem.network import Gunicorn
from diagrams.programming.framework import Flask

with Diagram("Lorem Ipsum Cloud Native Books Service",
             show=True,
             filename='lorem_ipsum_cloud_native_books_service'):
    with Cluster("Kube"):
        svc = Service('svc')
        pod = Pod('pod')
        secrets = Secret('secrets')
        cm = ConfigMap('cm')

        with Cluster('Runtime'):
            stats = Custom('stats', './resources/statsd.png')
            app = Container('app')
            statsd = Container('statsd')
            docker = Docker('')
            web = Flask('web')
            wsgi = Gunicorn('wsgi')
            app >> Edge(label='runs_on') >> docker
            app >> Edge(label='runs') >> [wsgi]
            app >> Edge(label='uses') >> [web]
            wsgi >> stats
        svc >> pod >> [app, statsd]
        pod << [secrets, cm]