ArgoCD
- hosting
- server
- servers
- infrastructure
- kubernetes
The last thing I ever install with kubectl apply, or helm, maybe¶
ArgoCD is a CD tool. Continuous delivery. Instead of having something like Github Actions, Gitlab CICD, or Jenkins deploy containers to clusters, why not put the job of deploying right in the kubernetes cluster?
The benefits are immense. No longer do I need to have security keys shared with another application, it all stays inside the cluster. The security boost from this alone is legendary.
Installation¶
It's as simple as installing a manifest. I went ahead and created a traefik based ingress for my instance. Creating an ingress isn't necessary as port forwarding to the machine running kubectl is a valid path, and a more secure one - not exposing ArgoCD to the internet. Once installed simply login with the pre-generated admin password, and begin setting up 'Apps'. There's a CLI app for ArgoCD as well, but honestly I prefer the WebUI, it's nice to be able to see if things are failing, see what changes I need to make, quickly access logs and even a network map to visualize how containers communicate with each other.
Apps¶
An app typically points to a Git repository. The repository can have multiple tiers for deployment, eg Dev, Staging, Production, based on a single Base tier. For my simple homelab I'm just using a single directory on a Git branch for my deployments, KISS at it's finest. I've installed two apps so far, flowise-ai and a simple nginx container hosting a friends business website until he finds a more reliable host. Right now I'm just running on a single server with multiple vm's so I can promise him 99.9999% uptime.
An example app is (https://github.com/centerionware/cityparkliquors/tree/argocd)[https://github.com/centerionware/cityparkliquors/tree/argocd]. A website I'm currently running for a friend.
Updates¶
To update an app is nothing more than updating the files in the repository. For the website example, every time my friend submits his HTML that he creates using whatever tools he wants to use, it will build a new nginx container using Github Actions. After a successful container build it will then modify the argocd branch of the project, replacing the old image hash with the newly generated one. This triggers ArgoCD to automatically update to the new container. In the end he just has to submit his code, and wait around 3-6 minutes and it will automatically deploy, causing his live website to be updated without any manual intervention.
ArgoCD can be set to require manual intervention, which may be useful for some critical workloads that need a scheduled maintainance window to update because updates may bring down services for a not insignifigant amount of time.
Conclusion¶
If you've not already setup ArgoCD you should give it a try today.
Honerable Mention, Flux¶
Before I leave you I should mention the other popular CD tool commonly used by people in the space, Flux. Flux is ArgoCD on steroids, however it doesn't have a spiffy UI out of the box. Although there are UI projects, I haven't seen one yet that's as complete as the ArgoCD UI.. Flux may still be the better choice for a lot of things however due to one ArgoCD limitation - timing. ArgoCD automatically checks for updates every 3 minutes, if an update is found and it's set to auto-apply it will. This may not always be ideal. Sometimes you only want to update once per day say at midnight when nobody is using the things. Flux allows fine grained configuration of when to update (eg: every 3 minutes to replicate ArgoCD, or once per day at a set time, whenever is best for you) on an individual app basis.