GitOps and ArgoCD Up and Running

Unlocking the Power of GitOps with ArgoCD: Scale Your Applications for Better Efficiency

In today’s fast-paced world, efficiency is key. That’s why more and more organizations are turning to GitOps for their application deployment needs. GitOps is a practice that uses git repositories as the source of truth for deployments, making the entire process more streamlined and efficient.

If you’re looking to get started with GitOps, look no further than ArgoCD. ArgoCD is a tool that automates the deployment of applications from git repositories. It’s perfect for organizations that want to improve their deployment workflow and scale their applications more efficiently.

By following the quickstart in the documentation this can get you started

https://argo-cd.readthedocs.io/en/stable/getting_started/

I’m running this on my AKS cluster in Azure you can run this wherever you have a cluster running even microk8s, minikube.

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

We will take this service and use the following port-forward to access the service and we will get our hands dirty.

kubectl port-forward svc/argocd-server -n argocd 8080:443

We can see the UI has a nice logo and login/password input area.

To retrieve the password this is stored in the argocd namespace run the command below if your like me running on a terminal on Windows OS this can give issues

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

This is the value we will put the username is admin and the password will be the decoded base64 if you need to use a base64 decoder you can search for one once you grab the base64 (mind you this isn’t secure in nature but for quick demo)

Once logged in the UI is straight forward with simple operations that are listed as shown below

ArgoCD community regularly runs scans on this project and list the findings by Synk on this page so you can be aware of any issues that are critical.

https://argo-cd.readthedocs.io/en/stable/snyk/

For the settings we can investigate further on what can be configured typically this will house the connections of repositories or credentials.

Settings

To get a repository in Argo we can select the Repositories option and are prompted with the following options

Repository settings

Navigating back to our home if my UI looks different I changed the theme to dark mode to help with viewing

We will select + New App and follow along with my configuration using the link below for the sample application

https://github.com/GoogleCloudPlatform/microservices-demo.git

We will then navigate to Create to start the process in our parameters for deployment it should look like the tile below now (if you changed the name it will reflect that in the bold text)

We will then select Sync select the Start Sync this will update the tile as we see below.

If we click the tile this will lead into a detailed view of the application we just synced with status showing as shown

Run the following command to see how this plays out in our cluster

kubectl get pods

Back in the ArgoCD UI we also have a legend that can show status of the pods and services we have in our application as healthy/degraded.

Ok so as we can see we have services that aren’t in tip-top shape let’s explore that further by the visualization and selecting the degraded pod.

So we have a broken heart that’s no good let’s investigate further what is causing this I’ll select the pod and get context.

We can see events has a notification or blurb of number 14 I’d wager we should go there to get context.

So we can see the docker image is pulling with “latest” mind you this is a demo application however not a good practice in production but this is causing the issue due to access denied for this.

I will now remove this application by navigating the UI and selecting delete and re-create an application with the quick start application.

If your following along on the UI you’ll select New App and it should look like these images below

Once deployed in our service lets ensure we Sync the status after you do this it should show below a nice Healthy status with a heart.

Once your done with this and messing around ensure you stop the port-forwarding on your terminal as this is serving the UI on our localhost.

kubectl -n argocd delete deployments --all

Ensure you also de-provision your cluster or stop it from running to not incur costs.

In this blog post, we’ll take a closer look at what GitOps is and how ArgoCD can help you automate your deployment process. We’ll also show you how to utilize ArgoCD for efficient release management and monitoring of your deployments. By the end of this post, you’ll have a better understanding of how GitOps can help your organization achieve greater efficiency.

Understand GitOps with ArgoCD: An Overview.

GitOps is a method for managing software deployments that combines the power of Git with the speed, agility, and automation of continuous deployment (CD). It enables developers to focus on their code while still being able to deploy code changes quickly and reliably.

ArgoCD is a tool that automates the GitOps workflow. It watches for changes in your Git repository and automatically deploys those changes to your applications. ArgoCD can be used to deploy applications to any Kubernetes cluster, making it an ideal tool for managing multi-cluster deployments.

Benefits of Using GitOps and ArgoCD.

There are many benefits to using the GitOps workflow with ArgoCD. First, it allows you to move faster by automating the deployment process. This means that you can deploy code changes more frequently and with less overhead. Second, it makes it easier to collaborate on code changes by using the standard git workflow. All code changes are tracked in the git repository, making it easy for team members to see what has been changed and when. Finally, by using ArgoCD, you can easily roll back to previous versions of your code if something goes wrong with a deployment.

Automate Your Deployment Workflow with ArgoCD.

Using ArgoCD to Automatically Deploy and Manage Applications.

Setting up ArgoCD is simple and straightforward. You can either use the provided installation scripts or manually install it yourself. Once installed, you’ll need to configure your application’s Git repository and set up a few parameters within ArgoCD itself. The process takes less than five minutes and requires no prior knowledge of DevOps principles or practices.

ArgoCD automates the entire deployment workflow, from initial code commit all the way to production. It does this by integrating with your existing CI/CD pipeline and monitoring for changes in your Git repository. When a change is detected, ArgoCD will automatically trigger a new deployment, ensuring that your applications are always up-to-date. Additionally, ArgoCD can be configured to automatically roll back deployments if errors are detected, making it an ideal tool for managing mission-critical applications.

Utilize ArgoCD for Efficient Release Management.

ArgoCD can help you manage different versions of your codebase by creating releases for each version. This way, you can automatically deploy the correct version of your code to each environment, and easily roll back to previous versions if necessary. To create a release, simply use the “argocd-util create-release” command. This will create a new git tag for the current commit, which you can then push to your remote repository.

Automatically Roll Back to Previous Versions

If you need to roll back to a previous version of your code for any reason, ArgoCD can help you do that automatically. Simply use the “argocd-util rollout” command, followed by the name of the release you want to roll back to. ArgoCD will then update the deployments in your cluster accordingly.

Analyze Your GitOps Deployments with ArgoCD.

ArgoCD provides users with the ability to monitor their deployments through metrics and logs. By default, ArgoCD will collect metrics from deployed applications and store them in a central location. These metrics can be used to track the progress of deployments, identify errors, and determine which applications are experiencing the most traffic. Additionally, ArgoCD can generate application-level logs which can be used to debug issues with deployed applications.

Receive Notifications of Application Updates.

ArgoCD can also be configured to send notifications when new versions of applications are available or when deployments fail. This allows users to stay up-to-date on the status of their deployments and quickly address any issues that may arise. Notifications can be sent via email, Slack, or other popular notification services.

Conclusion

The adoption of GitOps has been growing rapidly in recent years, and for good reason. GitOps with ArgoCD provides a scalable and efficient way to manage deployments, while also giving you the ability to monitor and roll back changes if needed. If you’re looking for a way to streamline your deployment process, ArgoCD is definitely worth considering for your selection.