jakubhajek / flux-mc-control-plane

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flux multi-cluster example repository

This repository demonstrates how Flux can be leveraged for centralized management of multiple clusters and multiple tenants per cluster. A management cluster is responsible for managing resource synchronization to workload clusters by means of applying Flux Kustomizations using each cluster's kubeconfig file.

Terminology

Roles

This implementation defines several roles that reflect different use cases and permissions:

  • Platform Administrator: This is the most powerful role having access to the management cluster's repository. The platform admin creates workspaces and attaches clusters to be managed.
  • Workspace Administrator: This role grants access to an individual workspace's repository, managing all applications deployed to clusters in that workspace.
  • Cluster Administrator: This role grants access to a repository reconciled by a single cluster, allowing to deploy per-cluster applications.

Workspace

A workspace is considered as the primary grouping of multiple clusters. One cluster can only be part of one workspace. All resources managed as part of a workspace (e.g. applications to be deployed) are synchronized across all clusters in that workspace, i.e. all clusters in a workspace will receive the same set of resources specific to that workspace.

Tenant

The second layer of grouping is by tenants. Each cluster may host multiple tenants. Each tenant can only be part of one workspace.

Management Cluster

This is the central cluster managing all attached workload clusters.

Workload Cluster

This is a cluster attached to and managed by the management cluster.

Quick Start

All of the following commands spin up kind clusters. Make sure you have the following commands installed:

First spin up the control plane cluster:

./create-management-cluster.sh

Then, create a workload cluster:

./create-and-attach-kind-cluster.sh -n attached -w dev

Now you have two clusters running, a management cluster and a workload cluster. Both are synchronized using (several branches of) this Git repository.

Architecture

This is a diagram showing the various Flux resources created on the management cluster and on workload clusters.

architecture diagram

About


Languages

Language:Go 62.5%Language:Shell 37.5%