ClickOps to GitOps (an Azure Marketplace story)

smurawski

Steven Murawski

Posted on September 25, 2023

ClickOps to GitOps (an Azure Marketplace story)

Our GitOps Journey So Far

What Has Come Before

Our team has dug into some of the basics of GitOps over the past week. So far, we've talked about:

A Quick Recap

The Principles of GitOps

1) Declarative

A system managed by GitOps must have it's state expressed declaratively.
Enter fullscreen mode Exit fullscreen mode

2) Versioned and Immutable

Desired state is stored in a way that enforces immutability, versioning and retains a complete version history.
Enter fullscreen mode Exit fullscreen mode

3) Pulled Automatically

Software agents automatically pull the desired state declarations from the source.
Enter fullscreen mode Exit fullscreen mode

4) Continuously Reconciled

Software agents continuously observe actual system state and attempt to apply the desired state.
Enter fullscreen mode Exit fullscreen mode

Application of the Principles

GitOps tools boil down to:

  1. A Git repository

  2. An artifact repository (by default, a branch in the Git repo)

  3. An agent that is responsible for ensuring that the state of the cluster matches the configuration defined in the artifact repository (over time)

Applying GitOps

Applying these principles to the use of the tools identified, we can effectively manage our Kubernetes clusters and workloads therein with auditable, automated changes and maintain a consistent configuration despite unintentional configuration drift.

Our Next GitOps Tool Exploration - ArgoCD

Now, it's time to dig in to the next GitOps tool in the GitOps ecosystem - Argo CD.

Argo CD is part of the Argo ecosystem of tools. Argo CD is a GitOps engine and continuous delivery tool. Argo CD is a Kubernetes controller that monitors the applications running inside your cluster and ensures that it matches the desired state (as represented by manifests or Helm charts in your target repository).

Argo CD architectural overview

Reducing Time to Impact with the Azure Marketplace

The Azure Marketplace is integrated into our Azure Kubernetes Service (AKS) clusters and provides a way for open source and commercial offerings that are container-based to be easily deployed into AKS clusters.

Installing ArgoCD from the Azure Marketplace

Argo CD is offered through the Azure Marketplace. Marketplace offers are installed as extensions into AKS.

We'll start in the Azure Portal on the AKS Cluster view.

Extensions + Applications

We'll navigate down the left-hand side of the page to the Extensions + applications item under Settings.

Azure portal, AKS view, selecting Extensions + applications

Add an Application

Next, we'll select Add.

AKS Extensions + applications screen with Add highlighted

We'll put argocd in the search box and select the Argo CD packaged by Bitnami offering. Install a Kubernetes Application with ArgoCD in the search box

The search will return two options, one a container and one a Kubernetes App. We'll select the Kubernetes App and click Create

Selecting the Kubernetes App for Argo CD

This will open up the Create Argo CD packaged by Bitnami page. We specify a subscription and resource group, as well as whether or not we need a new AKS cluster.

Create Argo CD packaged by Bitnami - basics tab with subscription, resource group, and whether or not to create a new AKS cluster.

The next step will be moving to the Kubernetes Cluster (AKS) Details tab.

Create Argo CD packaged by Bitnami - Kubernetes Cluster (AKS) Details with dropdown to select a cluster from within the targeted resource group.

After we specified the cluster details, we move to the Application Details tab. Here, we add a resource name (which has to be lowercase letters or numbers - no symbols - of between 6 and 30 characters). We can customize the namespace, but we'll take the default. And we can decide if we want the extension to be able to automatically deploy minor version updates.

Create Argo CD packaged by Bitnami - Application Details tab, with the extension resource name, installation namespace, and whether or not to allow auto upgrades for minor versions.

The last step of this process is to go to the Review + create tab. Here we'll see the versions of the application and deployment resources, as well as any potential cost (for the packaged application specifically) and other details like terms of use. We'll click Create here.

Create Argo CD packaged by Bitnami - Review + create tab.

Clicking Create kicks of the deployment process.

Deployment process in the Azure portal for Argo CD

After the deployment completes, we'll have argocd listed in our Extension + applications section of our AKS Cluster.

View of the deployed application in the AKS Cluster view in the Azure portal

Access the Argo CD Server

We'll retrieve the Argo CD Server password with kubectl.

kubectl get secret argocd-secret -o jsonpath='{.data.clearPassword}' | base64 --decode
Enter fullscreen mode Exit fullscreen mode

(or if you are like me and using PowerShell)

kubectl get secret argocd-secret -o jsonpath='{.data.clearPassword}'  | % {[system.text.encoding]::utf8.getstring([system.convert]::FromBase64String($_))}
Enter fullscreen mode Exit fullscreen mode

Then, we need to expose the Argo CD server so we can access it from our workstation.

kubectl port-forward svc/argocd-argo-cd-server 30443:80
Enter fullscreen mode Exit fullscreen mode

Then, we can access the Argo CD Server at https://localhost:30443 with the user name admin and the password we retrieved in the previous step.

From there, we could jump into the sample in the Argo CD documentation and carry on from there.

Summary

The AKS Marketplace provides a convenient way to installed a somewhat managed experience and quickly get started with new applications.

Getting Argo CD up and running is pretty simple and we can start exploring it in greater depth in our AKS environment.

Continue the conversation

Leave your questions in the comments or come over to the Microsoft Open Source Discord and chat with me and my team in the cloud-native channel!

And check back with our team tomorrow, as Paul digs into Flagger.

💖 💪 🙅 🚩
smurawski
Steven Murawski

Posted on September 25, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Just Enough Git for GitOps
git Just Enough Git for GitOps

September 18, 2023