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:
- Just Enough Git for GitOps
- What Really Is GitOps?
- Git going with GitOps on AKS: A Step-by-Step Guide using FluxCD AKS Extension
- What is GitOps: A Twitter Space
- Automating Image Updates with FluxCD on AKS
A Quick Recap
The Principles of GitOps
1) Declarative
A system managed by GitOps must have it's state expressed declaratively.
2) Versioned and Immutable
Desired state is stored in a way that enforces immutability, versioning and retains a complete version history.
3) Pulled Automatically
Software agents automatically pull the desired state declarations from the source.
4) Continuously Reconciled
Software agents continuously observe actual system state and attempt to apply the desired state.
Application of the Principles
GitOps tools boil down to:
A Git repository
An artifact repository (by default, a branch in the Git repo)
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).
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.
Add an Application
Next, we'll select Add.
We'll put argocd
in the search box and select the Argo CD packaged by Bitnami offering.
The search will return two options, one a container and one a Kubernetes App. We'll select the Kubernetes App and click Create
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.
The next step will be moving to the Kubernetes Cluster (AKS) Details tab.
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.
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.
Clicking Create kicks of the deployment process.
After the deployment completes, we'll have argocd listed in our Extension + applications section of our AKS Cluster.
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
(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($_))}
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
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.