kubernetescicdargocdgitops

Does ArgoCD Monitor Application Code Repository, or Only the Kubernetes Manifest Repository?


Context

New to DevOps and GitOps. Suppose that I have decoupled development from deployment. The application code (a machine learning web app) is in the application repository and the Kubernetes manifest (yaml files) to deploy it are in the manifest repository (both on GitLab).

My understanding was ArgoCD is typically used to pull the latest yaml files from manifest and kubectl apply them. But recently, I got some vague instructions from a new boss saying something along the line of

  1. Configure ArgoCD to monitor the application repository for changes.
  2. Configure ArgoCD to the manifest repository
  3. Configure ArgoCD to always pull the latest image when an image is pushed for blue-green deployment.

So before I ran around asking questions to my colleagues, thought I would clarify the general understanding from SOF.

Questions

2 above is quite clear to me, which I have done previously. I believe 3 can be done by the image updater extension. But 1 above is not clear to me, in general what it means and implies. Does it mean some other tool has to be thrown in the mix other than Argo, Docker and minikube?


Solution

  • I believe point 1 is redundant due to point 3. Assuming that what is required is that the latest application code always be deployed in the cluster, the image updater extension is able to handle this pretty easily. Assuming your application repository gets built and a new image gets pushed to your container repo every time a new commit is made, then that image should just get pulled and deployed automatically.

    On the other hand, if you don't have a system that automatically builds and pushes an image to your container repo everytime the a commit is pushed, you might have to introduce a CI/CD tool. Since you are already in GitLab, it will be pretty easy for you to create a GitLab pipeline that runs a job when a commit is made which builds the Docker image out of the repo and pushes it to a repo. You could also consider a tool such as Jenkins if your builds are frequent and you seem to be going beyond GitLabs' free tier.