Anthos in a nutshell

How to manage and orchestrate multi-clusters across many cloud providers.

Rafael Alvarez
Globant
4 min readNov 10, 2022

--

Anthos as an orchestrator for different technologies

Anthos is a Kubernetes (K8S) distributed agent in charge of applying multi-cluster-wide configurations across different platforms.

Anthos relies on version control software to store and distribute cluster configurations and deployments.

The semantics for governance and auditing process of K8S depend on the organization’s requirements.

In this article, we will review a Basic Reference Architecture to deploy Anthos. We will also expose the required preparations to onboard K8S Clusters to be managed by Anthos.

Reference Architecture

Follows a basic reference architecture on connecting many K8S Clusters across different providers. This allows us to have a single glass pane for its management and configuration.

Anthos architecture reference

Each required K8S Cluster requires a component embedded within the cluster's realm. Said component performs callback functions to the main Google Cloud Platform (GCP) project. This particular project is also known as the host project. Its main goal is to manage and configure fleets of K8S.

The Anthos Config repository can be hosted in any source repository that respects the git interface of commands. That is, as long Google Kubernetes Engine (GKE) has read access to it.

Preparation of K8S Cluster

To prepare each K8S Cluster to be managed by Anthos, four steps are needed:

  • For each cluster: install Anthos configuration management in the cluster:

Access to the Anthos Config Management tools can be found here.

  • Create YAML deployment files (one for each cluster) with the following key elements to consider:

cluster_name must be unique for each cluster. As a consequence you will end up with as many config_management_cluster_name.yaml files as clusters you have to manage.

  • Apply the previous configuration for each cluster:
  • For each cluster: configure git access credentials within K8S

That is the configuration needed to synchronize all clusters against a centralized repository.

Now, it's only reasonable to ask how we know the status of synchronization, and the answer to that comes in the form of a binary named nomos.

The binary package nomosis also downloadable from the Anthos download page. It is written in Go, and it is available for various platforms. The basic usage is as follows:

That means when you run nomos status, it will output the status for each managed cluster.

In this case, kubectl is connected to cluster_1. Such cluster is fully synchronized against the repository with commit id 1b664887. Also, synchronization happens with the main branch from the repository. Any commit to such a branch will trigger an update on each cluster.

Last is the folder structure needed to host all cluster configurations.

We can use the nomos init command to set up a basic cluster structure. Once executed, it will create a tree like this:

To get a complete reference on repository structure and semantics, you can check the Anthos reference guide.

To verify an existing repository, you can use the nomos vet command.

Finally, you can start with an empty configuration repository or use an existing demo repo. In the demo-repo, there is a foo-corp cluster configuration for you to check and execute the most basic deployments.

Conclusion

In summary, we saw how to configure Anthos on each cluster (GKE or otherwise). We have also seen how to check the cluster status and initialize a repository to host cluster configurations.

--

--

Rafael Alvarez
Globant

Proactive and highly responsible DevOps SME with vast experience in Information Technology and Computer Security along with background in Operational Research.