Introduction to the Kubernetes Cluster API

Kubernetes use has expanded across DevOps to help with orchestrating container environments. In 2021, 68% of IT professionals increased their Kubernetes use. But as Kubernetes use rises, the next step is figuring out how to efficiently manage multiple clusters. This is influencing new investment in multi-cluster tooling.

Having programmable control and customizable cluster templates could make K8s multi-cluster management more user-friendly and save time. These are just some of the goals behind Cluster API, a project started by Kubernetes special interest group (SIG) Cluster Lifecycle. At the alpha stage at the time of writing, Cluster API appears to be building mindshare among companies throughout the container ecosystem that have a vested interest in guiding the future of Kubernetes cluster management.

A June 2021 CNCF Radar on multi-cluster management placed Cluster API in the “assess” category. Yet, its participants expressed enthusiasm for the project. So, I recently met with Vince Prignano, staff engineer at VMware, to check in on Cluster API’s overall state and see what it will take to increase confidence in the tool. Once additional production proof, new features and higher reliability usher in a full release, Cluster API may soon become an accepted method for managing multiple Kubernetes clusters.

Multi-Cluster Madness

What is driving the need for new multi-cluster tooling? As Kubernetes becomes a defacto container management tool, there is a rising need to maintain clusters in the wild and maintain multiple clusters simultaneously. “Once you get to five or seven clusters, things get really hard to manage across the board,” says Prignano.

For example, how do you run a health check on every cluster simultaneously? If you have to roll out a new Linux image, how do you ensure everything is consistent? Or, perhaps you want to roll out instances at a specific time of day. Without automated rollouts, you could introduce versioning issues. “It’s really hard to keep track of everything,” says Prignano. Without automation, all this operational complexity becomes unmanageable—especially when an organization scales to running hundreds or thousands of K8s clusters.

Introduction to Cluster API

According to The Cluster API Book, “Cluster API is a Kubernetes sub-project focused on providing declarative APIs and tooling to simplify provisioning, upgrading and operating multiple Kubernetes clusters.” With Cluster API, teams can manage the life cycle of multiple clusters from a unified API. It can work within different computing environments, too, appeasing on-premises and multi-cloud needs. Here is a condensed version of the open source project’s goals:

  • To manage the life cycle,
  • To work in different environments,
  • To define common operations,
  • To reuse and integrate existing ecosystem components rather than duplicating their functionality,
  • To provide a transition path for Kubernetes life cycle products to adopt Cluster API incrementally.

Cluster API has its roots in kubeadm, a tool for bootstrapping K8s clusters. However, kubeadm didn’t address managing a cluster day-to-day or operationalizing an extensive Kubernetes environment for the long term, explains Prignano.

With Cluster API, operators create a YAML file that defines a cluster. Cluster API takes the same experience you have in Kubernetes with pods, deployments and ReplicaSets, but on a cluster level. Cluster API can also be installed within a cluster to manage another cluster. “Trying to use Kubernetes to manage other K8s clusters; it’s a little like inception,” he says.

Cluster API Within the K8s Ecosystem

So, how is Cluster API differentiated from other multi-cluster management tools? Whereas tools like kops are designed around a specific cloud vendor, Cluster API is more agnostic. Cluster API also emphasizes quality user experiences. “We’re trying to make it as easy as Kind to spin up a Cluster,” says Prignano. Cluster API’s capability to run automated health checks is another defining characteristic.

The Cluster API is part of the Kubernetes SIGs but is technically not part of the core Kubernetes package. According to Prignano, this is a benefit, since it means the project can support a wider version of K8s, ensuring backward compatibility. “We’re proud of the fact that there is a good feedback loop between K8s and the Cluster API project,” says Prignano. Though there is a quality feedback loop in place, interdependence from Kubernetes core could enable Cluster API to iterate a lot faster.

The Future of Cluster API

At the time of writing, Cluster API is still in an alpha state. According to Prignano, the project has been conservative about beta or general release as it works to ensure high reliability and that no major update causes breaking change. Prignano estimates a beta, or 1.0 release, may be on the horizon in 2022. However, before that occurs, contributors are working on extensibility, nailing down the GitOps experience and increasing user experience around Cluster API with new features.

One upcoming feature involves the idea of custom classes. Operators often need to give out clusters to different users, and having classes for clusters could help this process. An IP administrator could configure cluster classes using the Cluster API and offer a customizable template to others within the K8s operation team.

Cluster Evolution

As a vendor-neutral community mission, Cluster API could become more of a de facto method to manage multiple Kubernetes clusters. One of the goals of the Cluster API project is “to provide a transition path for Kubernetes life cycle products to adopt Cluster API incrementally,” so perhaps it will integrate more closely with managed Kubernetes offerings in the future.

Multi-cluster tooling is an evolving area. As the CNCF Radar found, there are many multi-cluster management strategies, from in-house creations to vendor tools and open source libraries. The Cluster API alpha stage could be an excellent time to test it and provide valuable feedback to advance the project forward.

To learn more about the Cluster API, the number one resource for developers is the Cluster API book. It resides here and is actively updated as the project evolves. Another resource for tracking the project’s progress is the Proposals repository on Github.

Bill Doerrfeld

Bill Doerrfeld is a tech journalist and analyst. His beat is cloud technologies, specifically the web API economy. He began researching APIs as an Associate Editor at ProgrammableWeb, and since 2015 has been the Editor at Nordic APIs, a high-impact blog on API strategy for providers. He loves discovering new trends, interviewing key contributors, and researching new technology. He also gets out into the world to speak occasionally.

Bill Doerrfeld has 40 posts and counting. See all posts by Bill Doerrfeld