ArlonCTL Tutorial

In this Tutorial, we will deploy an EKS cluster consisting of two worker nodes using Arlon, by making use of ArlonCTL.

For context around what is Arlon, PMK integration with Arlon, and ArlonCTL, please first read Profile Engine with Arlon and ArlonCTL

Download

Download arlonctl on your machine using this command:

Bash
Copy

This downloads arlonctl in /usr/local/bin/arlonctl

Currently, the supported OS are :

  • Linux(amd64)
  • MacOs(amd64, arm64)

Verify

Check if all the prerequisite tools are installed and running by running : arlonctl verify

To run arlonctl commands, kubectl is a required tool and git, argocd CLI are optional requirements. In order to download these tools, do refer to these links below:

Context Creation

This command allows user to create and switch between two or more DUs / contexts. It makes it easy and efficient for the user to manage multiple DUs.

The first step is to create a context for the current DU.This can be done by running:

Bash
Copy

This command creates a new context, which the user can then work with. The current context will be set to the newly created context using this command. To create a new context, the user needs to add their DU-FQDN, their username and password.

After the context creation is successful, it can be verified by using arlonctl context list which shows the current context being used.

All the contexts which have been added by the user are stored in a contexts.json file which is at ~/.config/arlon. Sensitive credentials such as passwords are stored in the JSON file after being encrypted. The kubeconfig of the current DU as well is stored in the same location with the name context.config. The logs for all the arlonctl commands are stored in ~/.config/arlon/logs.txt

Workspace Repo

If the verification is successful and all the required tools are installed, go ahead and add a workspace repository to argocd. This git repo is the “source of truth” for all the apps. This is the repo, where arlonctl will add all the files and manifests related to the profiles, bundles, clusters To add a repo to argocd, use this command :

Bash
Copy

$GITHUB_PAT is the Github Personal Access Token.

$User is the github username.

$WORKSPACE_REPO_URL is the github url of the workspace repo.

Cloud Provider

Once the repo has been added to argocd, proceed to add a cloudprovider(AWS) in PMK UI. After the cloudprovider is successfully added to the DU, list the cloud providers present in the DU using arlonctl.

Bash
Copy

Creating Cluster Components

Bundle

A bundle is a grouping of data files that produce a set of Kubernetes manifests via a tool.Each bundle is defined using a Kubernetes secret in the arlon namespace.

Static Bundle: A static bundle embeds the manifest's YAML data itself and is not affected by subsequent changes to this manifest.

Download xenial.yaml from : https://github.com/arlonproj/arlon/blob/main/examples/bundles/xenial.yaml. We will create a static bundle using this app.

Bash
Copy

Dynamic Bundle: A dynamic bundle contains a reference to the manifest data stored in git.When the user updates a dynamic bundle in git, all clusters consuming that bundle (through a profile specified at cluster creation time) will acquire the change.

We will create a dynamic version of the same application, this time using a reference to a git directory containing the YAML.Clone the git repository that was earlier added to ArgoCD. Then follow these steps :

Bash
Copy

Once this bundle is added to your workspace repository, proceed to create a dynamic bundle.

$WORKSPACE_REPO_URL is the workspace repo url that has earlier been added to ArgoCD.

Profile

A profile expresses a desired configuration for a Kubernetes cluster. It's a collection of bundles (static, dynamic, or a combination). A profile can be static or dynamic. Profiles are stored in git as YAMLs.

Static Profile: When a cluster consumes a static profile at creation time, the set of bundles for the cluster is fixed at that time and does not change over time even when the static bundle is updated.

Bash
Copy

Dynamic Profile: Any change in the bundles present in the profile will get reflected in the dynamic profile. Any cluster consuming that dynamic profile will be affected by the change, meaning it may lose or acquire new bundles in real time.

Bash
Copy

$WORKSPACE_REPO_URL is the workspace repo url that has earlier been added to ArgoCD.

Clusterspec

It is the specification that describes the characteristics (size and shape) of the cluster to be deployed. i.e. the API (CAPI/ Crossplane), the cloud, version of Kubernetes, number of nodes in the cluster etc.

Bash
Copy

$CLOUD_PROVIDER is the output of arlonctl cloudprovider list.

$AWS_REGION is the AWS Region.

$SSH_KEY is the AWS SSH Key.

$NODETYPE is the size of the node (e.g. t2.large, t2.medium).

Cluster

It is a Kubernetes cluster that pf9-arlon creates and manages via a git directory structure stored in the workspace repository.

Cluster: arlonctl-1 (Static Profile and Static Bundle):

Bash
Copy

Cluster: arlonctl-2 (Dynamic Profile and Dynamic Bundle):

Bash
Copy

$WORKSPACE_REPO_URL is the workspace repo url that has earlier been added to ArgoCD.

Once the cluster is deployed, the status of the apps and the cluster deployed by Arlon can be queries by running the following command from the ArgoCD CLI :

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated by Trilok Khairnar