DEV Community

Michael Cade
Michael Cade

Posted on • Originally published at vzilla.co.uk on

GitOps – Getting started with ArgoCD

Last week at the Kasten booth at KubeCon 2021 EU I gave a 30-minute session on “Incorporating data management into your continuous deployment workflows and GitOps model” the TLDR was that with Kasten K10 we can use BackupActions and hooks from your favourite CD tool to make sure that with any configuration change you are also going to take a backup of your configuration before the change but most importantly the data will also be grabbed. This will become more apparent and more useful when you are leveraging ConfgMaps to interact with data that is being consumed and added by an external group of people and data is not stored within version control.

Continuous Integration and Continuous Deployment seem to come hand in hand in all conversations but actually they are or at least to me they can be too different and separate workflows completely. It is important to note here that this walkthrough is not focusing on Continuous integration but more so on the Deployment / Delivery of your application and incorporating data management into your workflows.

050921 1635 GitOpsGetti1

Deploying ArgoCD

Before we get into the steps and the scenario, we need to deploy our Continuous Deployment tool, for this demo I am going to be using ArgoCD.

I hear you cry “But what is ArgoCD?” – “Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes

Version control is the key here, ever made a change to your environment on the fly and have no recollection of that change and because the lights are on and everything is green you continue to keep plodding along? Ever made a change and broke everything or some of everything? You might have known you made the change and you can quickly roll back your change, that bad script or misspelling. Now ever done this a massive scale and maybe it was not you or maybe it was not found straight away and now the business is suffering. Therefore, version control is important. Not only that but “Application definitions, configurations, and environments should be declarative, and version controlled.” On top of this (which comes from ArgoCD), they also mention that “Application deployment and lifecycle management should be automated, auditable, and easy to understand.”

From an Operations background but having played a lot around Infrastructure as Code this is the next step to ensuring all of that good stuff is taken care of along the way with continuous deployment/delivery workflows.

Now we go ahead and deploy ArgoCD into our Kubernetes cluster. Before I deploy anything I like to make sure that I am on the correct cluster with normally running the following command to check my nodes. We then also need to create a namespace.

Confirm you are on the correct cluster

kubectl get nodes

Create a namespace

kubectl create namespace argocd

Deploy CRDs

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.0.0-rc3/manifests/install.yaml

050921 1635 GitOpsGetti2

When all ArgoCD pods are up running you can confirm this by running the following command.

#Confirm all CRDs are deployedkubectl get all -n argocd
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti3

When the above is looking good, we then should consider accessing this via the port forward. Using the following command.

#When everything is ready, we want to access the ArgoCD UIkubectl port-forward svc/argocd-server -n argocd 8080:443
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti4

Now we can connect to ArgoCD, navigate to your port forward using your https://localhost:8080 address and you should have the below screen.

050921 1635 GitOpsGetti5

To log in you will need a username of admin and then to grab your created secret as your password use the following command, I am using WSL and an Ubuntu instance to grab the following command if you are using Windows then there are Base64 tools out there apparently I just have been trying to immerse myself into Linux.

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d && echo
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti6

When you log in for the first time you will not see the boxes that I have in play around apps I have already deployed. You will have a blank canvas.

050921 1635 GitOpsGetti7

Another way to Deploy, Maybe easier

Now the above method works and you can then start working on the next post that walks through the actual demo I performed in the session, but I also want to shout out arkade as another option to deploy not only ArgoCD but many different other tools that are useful in your Kubernetes environments.

The following command will get arkade installed on your system

# Note: you can also run without `sudo` and move the binary yourselfcurl -sLS https://dl.get-arkade.dev | sudo sh
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti8

The first thing to do is check out the awesome list of apps available on arkade.

arkade get
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti9

Now back to this way of deployment of ArgoCD, we can now simply run this one command to get up and running.

arkade get argocd
Enter fullscreen mode Exit fullscreen mode

050921 1635 GitOpsGetti10

What if we want to find out more of the options available to us within the ArgoCD deployment, arkade has good info on all the apps to give detail about gaining access and what needs to happen next if you are unsure.

050921 1635 GitOpsGetti11

In the next post, we are going to be walking through the demo aspects of the session.

Top comments (0)