Skip to content

Latest commit

 

History

History
153 lines (122 loc) · 7.46 KB

infrastructure.md

File metadata and controls

153 lines (122 loc) · 7.46 KB

Infrastructure

This document outlines the architecture documentation for Infrastructure domain.

Cluster Management

Bringing up a new Kubernetes Cluster is fairly easy, the IaaS providers provide APIs so that users can easily bring up clusters even without having to understand tools like kubeadm.

Preparing that cluster for workloads can require a bit more work, the Cluster Management functionality provides mechanisms for creating new CAPI clusters from templates, bootstrapping Flux into the clusters to start loading workloads from a git repository, and installing packages of components (which we call Profiles) into newly bootstrapped clusters.

Our cluster-management functionality sets up a collaboration between CAPI, Flux and Helm (Profiles) for customer clusters, and provides a single-pane-of-glass view of the workloads on these clusters.

C4Context
    title Weave GitOps Enterprise

    Boundary(gitopsOperation, "GitOps Operations") {
        Person(PlatformEngineer, "Platform Engineer", "operates WGE platform for applications")
        Person(ApplicationDeveloper, "Application Developer", "writes and operates Line-of-Business applications")

        Boundary(git, "Git") {
            System_Ext(gitProvider, "GitProvider", "Source storage in Git. Ex. GitHub")
        }

        Boundary(Kubernetes, "Kubernetes Cluster") {
            Boundary(fluxb, "Flux") {
                Component(sourceController, "Source Controller")
            }

            Boundary(wg, "Weave GitOps Enterprise") {
                Component(WeaveGitopsEnterpriseUI, "Weave GitOps Enterprise UI")
                Component(clusterController, "Cluster Controller")
                Component(clusterBootstrapController, "Cluster Bootstrap Controller")
            }
            Rel(PlatformEngineer, gitProvider, "Gitops flow for changes")
            UpdateRelStyle(PlatformEngineer, gitProvider, $offsetX="-140", $offsetY="-40")
            Rel(ApplicationDeveloper, gitProvider, "Gitops flow for changes")
            UpdateRelStyle(ApplicationDeveloper, gitProvider, $offsetX="80", $offsetY="-40")
            Rel(PlatformEngineer, WeaveGitopsEnterpriseUI, "Cluster overview")
            Rel(ApplicationDeveloper, WeaveGitopsEnterpriseUI, "Application view")


            Boundary(capib, "CAPI subsystem") {
                Component(capiController, "Cluster API Controller")
                Component(capiAWSController, "Cluster API for AWS Controller")
            }
            Rel(sourceController, gitProvider, "Archive source")
            UpdateRelStyle(sourceController, gitProvider, $offsetX="0", $offsetY="20")

            Rel(capiAWSController, cloudProvider, "Create and update clusters")
            Rel(clusterBootstrapController, clusterController, "Track cluster state")
            Rel(capiAWSController, capiController, "Update cluster state")
        }
        Boundary(cloud, "Cloud") {
            System_Ext(cloudProvider, "Cloud Provider", "Provide IaaS, ex. AWS")
        }

    }
    UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="3")
Loading

In Action

Documentation and Next Steps

Terraform

Addresses the problem of provisioning infrastructure beyond Kubernetes clusters for both platform
and application developers. It uses Terraform as most prominent IaC solution nowadays. Leverages Weaveworks TF-controller to manage Terraform under Gitops principles and integrates with Weave GitOps.

Given a platform engineer or developer that wants to provision Terraform infrastruture via TF-contorller

The common gitops flow applies:

  • A PR is created to GitProvider (or other git provider) with the change.
  • PR is reviewed and merged.
  • Flux source controllers syncs it. Then terraform flow kicks in:
  • Terraform Controller reconciles Terraform Crs.
  • Terraform Runners executes terraform jobs.
  • The infrastructure is provisioned.
C4Component
    title Weave GitOps Enterprise
    Boundary(gitopsOperation, "GitOps Operations") {
        Person(PlatformEngineer, "Platform Engineer", "operates WGE platform for applications")
        Person(ApplicationDeveloper, "Application Developer", "writes and operates Line-of-Business applications")
        Rel(PlatformEngineer, gitProvider, "Gitops flow for changes")
        UpdateRelStyle(PlatformEngineer, gitProvider, $offsetX="-140", $offsetY="-40")
        Rel(ApplicationDeveloper, gitProvider, "Gitops flow for changes")
        UpdateRelStyle(ApplicationDeveloper, gitProvider, $offsetX="80", $offsetY="-40")

        Boundary(git, "Git") {
            System_Ext(gitProvider, "GitProvider", "Source storage in Git. Ex. GitHub")
        }

        Boundary(Kubernetes, "Kubernetes Cluster") {
            Boundary(wg, "Weave GitOps Enterprise") {
                Component(WeaveGitopsEnterpriseUI, "Weave GitOps Enterprise UI")
            }
            Rel(ApplicationDeveloper, WeaveGitopsEnterpriseUI, "View Terraform")
            UpdateRelStyle(ApplicationDeveloper, WeaveGitopsEnterpriseUI, $offsetX="0", $offsetY="-40")
            Rel(PlatformEngineer, WeaveGitopsEnterpriseUI, "View Terraform")
            UpdateRelStyle(PlatformEngineer, WeaveGitopsEnterpriseUI, $offsetX="-110", $offsetY="-70")

            Boundary(kubecp, "Kube Control Plane") {
                Component(KubernetesApi, "Kubernetes API")
            }

            Boundary(fluxb, "Flux") {
                Component(sourceController, "Source Controller")
            }

            Rel(sourceController, gitProvider, "pull terraform source")

            Boundary(terraform, "Terraform") {
                Component(terraformController, "Terraform Controller", "manages terraform resources")
                Component(terraformRunner, "Terraform Runners", "terraform execution component")
            }

            Rel(terraformController, KubernetesApi, "read terraform manifests")
            Rel(terraformController, terraformRunner, "manage terraform executions")
            Rel(terraformRunner, infraProvider, "provisions infrastructure")
        }

        Boundary(cloud, "Cloud") {
            System_Ext(infraProvider, "Infrastructure Provider", "Any infrastructure that terraform supports")
        }

    }
    UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2")
Loading

In Action

Documentation and Next Steps