Ejemplo n.º 1
0
def get_common_architecture(cloud_provider, filename, container_registry,
                            k8s_cluster_name, k8s_engine_name):
    with Diagram(
            f"QHub Architecture: {cloud_provider}",
            filename=f'{filename}',
            show=False,
            direction="TB",
    ):
        with Cluster(cloud_provider):
            gcr = ContainerRegistry(container_registry)
            with Cluster(k8s_cluster_name):
                kube_engine = KubernetesEngine(k8s_engine_name)

                conda_pvc = PersistentVolume('Conda')
                nfs_pvc = PersistentVolume('NFS')
                elb = LoadBalancing('Ingress')

                with Cluster('Master'):
                    general = Node('general')
                    Node('user')
                    Node('worker')
                    general << kube_engine

                with Cluster("Pods"):
                    dask_gateway = Pod('Dask Gateway')
                    jupyterhub = Pod('JupyterHub')
                    dask_scheduler = Pod('Dask Scheduler')
                    nfs_server = Pod('NFS Server')
                    conda_store = Pod('Conda Store')
                    nginx = Pod('Nginx')
                    Pod('Cert Manager')
                    image_puller = Pod('Image Puller')

        nginx >> elb
        nginx >> jupyterhub
        [nfs_server, conda_store, dask_gateway] << jupyterhub
        [conda_store, dask_scheduler] << dask_gateway
        image_puller >> gcr
        nfs_server >> nfs_pvc
        conda_store >> conda_pvc
        Helm('Helm') >> kube_engine
Ejemplo n.º 2
0
def get_common_architecture(cloud_provider, filename, container_registry,
                            k8s_cluster_name, k8s_engine_name):
    with Diagram(
            f"QHub Architecture: {cloud_provider}",
            filename=f"{filename}",
            show=False,
            direction="TB",
    ):
        with Cluster(cloud_provider):
            gcr = ContainerRegistry(container_registry)
            with Cluster(k8s_cluster_name):
                kube_engine = KubernetesEngine(k8s_engine_name)

                conda_pvc = PersistentVolume("Conda")
                nfs_pvc = PersistentVolume("NFS")
                elb = LoadBalancing("Ingress")

                with Cluster("Master"):
                    general = Node("general")
                    Node("user")
                    Node("worker")
                    general << kube_engine

                with Cluster("Pods"):
                    dask_gateway = Pod("Dask Gateway")
                    jupyterhub = Pod("JupyterHub")
                    dask_scheduler = Pod("Dask Scheduler")
                    nfs_server = Pod("NFS Server")
                    conda_store = Pod("Conda Store")
                    nginx = Pod("Nginx")
                    Pod("Cert Manager")
                    image_puller = Pod("Image Puller")

        nginx >> elb
        nginx >> jupyterhub
        [nfs_server, conda_store, dask_gateway] << jupyterhub
        [conda_store, dask_scheduler] << dask_gateway
        image_puller >> gcr
        nfs_server >> nfs_pvc
        conda_store >> conda_pvc
        Helm("Helm") >> kube_engine
Ejemplo n.º 3
0
from diagrams import Diagram, Edge
from diagrams.k8s.ecosystem import Helm

with Diagram("Helm Release", show=False, direction="TB"):

    release = Helm("release")
    release << Edge(label="chart") << Helm("repository")
    release << Helm("config 0..n")
Ejemplo n.º 4
0
                    k8s_vol >> efs

                    with Cluster("Public"):
                        ig = InternetGateway("Internet gateway")
                        elb = ElasticLoadBalancing("Ingress")
                        public = [ig, elb]
                        elb >> ecr

                    with Cluster("Master"):
                        general = Node("general")
                        user = Node("user")
                        worker = Node("worker")
                        general << eks

                    with Cluster("Pods"):
                        dask_gateway = Pod("Dask Gateway")
                        jupyterhub = Pod("JupyterHub")
                        dask_scheduler = Pod("Dask Scheduler")
                        nfs_server = Pod("NFS Server")
                        conda_store = Pod("Conda Store")
                        nginx = Pod("Nginx")
                        cert_manager = Pod("Cert Manager")
                        image_puller = Pod("Image Puller")

    nginx >> jupyterhub
    [nfs_server, conda_store, dask_gateway] << jupyterhub
    [conda_store, dask_scheduler] << dask_gateway
    [image_puller, nginx] >> elb
    nfs_server >> k8s_vol
    Helm("Helm") >> eks
Ejemplo n.º 5
0
                    k8s_vol >> efs

                    with Cluster('Public'):
                        ig = InternetGateway('Internet gateway')
                        elb = ElasticLoadBalancing('Ingress')
                        public = [ig, elb]
                        elb >> ecr

                    with Cluster('Master'):
                        general = Node('general')
                        user = Node('user')
                        worker = Node('worker')
                        general << eks

                    with Cluster("Pods"):
                        dask_gateway = Pod('Dask Gateway')
                        jupyterhub = Pod('JupyterHub')
                        dask_scheduler = Pod('Dask Scheduler')
                        nfs_server = Pod('NFS Server')
                        conda_store = Pod('Conda Store')
                        nginx = Pod('Nginx')
                        cert_manager = Pod('Cert Manager')
                        image_puller = Pod('Image Puller')

    nginx >> jupyterhub
    [nfs_server, conda_store, dask_gateway] << jupyterhub
    [conda_store, dask_scheduler] << dask_gateway
    [image_puller, nginx] >> elb
    nfs_server >> k8s_vol
    Helm('Helm') >> eks
Ejemplo n.º 6
0
    #nginx_onprem = Nginx("Ingress")
    #oci_container = Container("Container")
    #load_balancer = LoadBalancers("Load Balancer")
    container_registry = ContainerRegistries("Azure Container Registry")
    #aks_kubernetes = KubernetesServices("Kubernetes Service")
    with Cluster("Azure DevOps - CI/CD", graph_attr=graph_attr_group):
        azure_repos = Repos("Git Repo")
        azure_pipelines = Pipelines("Pipelines")
        #azure_repos >> azure_pipelines
    with Cluster("Cluster - Core Channel Application", graph_attr=graph_attr_group):
        master = KubernetesServices("master")
        with Cluster("Node Pool", graph_attr=graph_attr_node):
            #master = KubernetesServices("master")
            workers = [KubernetesServices("node 1"),
                       KubernetesServices("node 2"),
                       KubernetesServices("node 3")]
        master - workers
        #aks_kubernetes - workers

    azure_repos >> azure_pipelines >> Edge(label="Docker Push", style="bold") >> container_registry << Edge(label="Docker Pull", style="bold") << master
    Helm("Helm") >> Edge(label="Helm Upgrade", style="bold") >> master
    #load_balancer >> nginx_onprem >> workers
    
    #Pipelines("Pipelines") >> aks_kubernetes

    #with Cluster("Azure Kubernetes Service"):
    #    with Cluster("VIA"):
    #        via_group = [ContainerInstances("FrontEnd"), ContainerInstances("Backend")]
    #    container_registry >> via_group
    #pass
diag # 
Ejemplo n.º 7
0
    with Cluster("./metal") as metal:
        metals = Server("Metal cluster")
        pxe = Docker("PXE server")
        rockies = Rocky('Rocky Linux')
        initial_resources = [metals, pxe]
        k3s = K3s('K3s')

        rockies >> k3s
        metals >> rockies

    controller >> initial_resources

    with Cluster("./bootstrap") as bootstrap:
        nodes = Node('Node(s)')
        argocd = ArgoCD('ArgoCD')
        root_chart = Helm("Root chart")

    k3s >> nodes
    k3s >> argocd

    with Cluster('Kubernetes cluster'):
        with Cluster("./system"):
            system_chart = Helm("System chart")

        with Cluster("./platform"):
            platform_chart = Helm("Platform chart")

        with Cluster("./apps"):
            apps_chart = Helm("Applications chart")

        with Cluster("./global"):