Creating Clusters with Class

Creating Clusters with Class

Introduction

Hidden behind ClusterTopology lies incredible templating capability for creating and managing clusters at scale. This feature allows Clusters to be controlled by a Topology field containing a reference composed of various templates that allow reusable and central composition.

Let’s check out why we would need the ClusterTopology feature and what advantages it has over using direct object reference.

Old Way • Individual Objects

Till Cluster API release 1.0 the only way to specify was by using all Custom Resources as objects in a Cluster template.

clusterctl templating allowed using variables in a template allowing the creation of clusters with different names and parameters.

based on the Docker Infrastructure-based template from release-1.0

The templates consist of objects that belong to a particular cluster, If you plan to create and manage 100 such clusters you are required to replicate all the objects 100 times. And if you have to add/update let’s say one extra argument to change — audit-log-maxsize to comply with your new Organization policy you are in soup. You will need to update 100 Kubeadmcontrolplane instances, even if you have all these objects checked in Git, and using Git Ops, you will still need to make changes at 100 lines.

One advantage to this approach is that the Cluster is completely contained with its dependencies. A change in another unrelated KubeadmControlPlane will not affect this Cluster.

New Way • Topology + ClusterClass + Templates

Cluster Class

Cluster Class is the real magic sauce behind enabling the ClusterTopology feature. It cleanly abstracts away all the non-core components in a clean composition. Allowing changes made to the templates at one central location, and the effect is applied to all clusters that are associated or using a given cluster class.

Operations teams can have blueprint clusterclasses following best practices such as controlling and exposing Organisation-wide — audit-log-maxsize field for all controlplane nodes. Imagine being able to ensure that a field — audit-log-maxsize for the API server is always up to date with your Organisation's security mandate.

Topology

Cluster Topology allows becoming a centre stage to run Cluster API-based clusters, manage scale-up, and upgrade operations with ease.

Operations teams can provide standard organization-wide templates and clusterclasses and respective teams can manage their clusters scale by themselves using Cluster Topology.

based on the Docker Infrastructure-based template from the latest


Cluster Class and Topology bring separation of concerns by abstracting blueprint classes as templates, allowing standard templates. Such as an organization can decide what type of WorkerMachineTemplates are available for all departments or can provide specific templates for specific teams. One can ensure that machines use the latest images.

The possibilities are limitless.

In the upcoming sections, we will look into ClusterClass and Topology specifications in detail.