Flux CD Vs Argo CD
I'm trying out both to find the winner of Continuous Delivery to a Kubernetes Cluster.
Disclaimer: There isn't a winner only you, you're the winner for choosing to automate your deployments (Terribly diplomatic and lame of me I know, but there you go).
So You've got a cluster created the hard way or the GKE way, either way, you've got a cluster, great!
Now.... what do you do with it and how do you get applications in there?!
By now, you're probably familiar with some imperative commands, you've probably even been typing up some Kubernetes manifest yaml files and applying them like crazy, all good stuff but you might be hankering for more!
You might have automated your cluster with some VMs with Ansible (unlikely, fair play if you have) Or spinning up some managed cloud clusters with Terraform (more likely) but now your thinking wouldn't be nice to automate the k apply -f manifest.yaml
commands you've been running.
GitOps
The real reason we're here is for GitOps, we want to push our application changes to a Git repo and have those changes realised into real life onto our cluster, it's predictable and repeatable, we have an audit of the changes being made and we can easily roll back in case of any issues. There's a whole heap of opinions and options on GitOps and its not even for just application configuration, we're talking infra, Docker building etc. But that's for another day.....
GitHub actions work well, Google Cloud Build and Google Cloud Deploy all work great too but I've been looking at Flux CD and Argo CD more so as they are installed on a cluster themselves and are a self-hosted option if you will (No, not Jenkins. Not even if there's a fire).
I've installed Flux CD and Argo CD on my VM based cluster following my guide here and here's what I thought.
Installation wise, they can both be installed very quickly to get you up and running.
Argo CD can be installed via a Helm chart or just a kubectl apply -f and with Flux CD, I installed the command line tool and bootstrapped a Github repo I used for testing.
Argo CD
First impressions, with Argo CD, I really liked the console UI. Installation is pretty simple you can install via the Helm chart or just apply the manifest file via the Argo CD repo/documentation.
And here's what you get essentially an API server, repository server and the application controller which is the watch loop that watches the applications deployed with Argo CD.
This is a demo application from the Argo CD examples repo, that can be added via the console or via the argocd CLI tool.
The application dashboard console paints a really nice visual of whats actually happening in your cluster come deployment time.
You can really easily just grab a Helm chart repo URL and add an application via a Helm chart using the dashboard, a nice and easy to get going.
You can also connect to your GitHub repos, make your changes, commit and push Argo CD will then reconcile what it sees in the repo and what it knows it has deployed, there are also options where you can choose for Argo to "sync" automatically or not, if you wanted some manual intervention, it's always a nice option.
The GitOps option, connecting to a repo and watching for changes, now this is what makes this worthwhile.
Argo updating my deployment by adding a 3rd pod.
Yeah, yeah I pushed straight to master, so shoot me :shrug
I really like Argo CD, I've got it pointing at 2 clusters at the moment for deploying applications to, some options like adding another cluster to Argo CD are CLI command only which works fine and has good documentation on finding your way around and who doesn't love a dashboard with stuff spinning up and down?!
Flux CD
Flux is a CLI only tool, I believe there are some UI dashboard tools but I haven't tried any yet.
I found Flux CD easy enough to set up, and install the Flux CD CLI tool, bootstrap a Git repo, I connected GitHub using the documentation I was also able to use a private repo and a personal account, no need for any enterprise GitHub accounts etc.
Flux CD then installs the controllers on your cluster for use with Helm, Kustomize and Git repos.
I bootstrapped a repo I had already configured but it can also create the repo if it doesn't exist and then adds a flux-cluster directory in the repo, after the Flux repo bootstrapping had completed, I added my manifest files into the cluster directory, commit and push and find my application on my cluster, I've been super inspirational and used an Nginx deployment and service in the nginx-test directory to demonstrate.
I then update my application, to test just scaling down from 3 to 2 pods in my super exciting nginx application, add, commit and push.
The Git source controller in the Flux CD pod then reconciles what it sees in the Git repo to what is deployed in real life and updates the objects in the cluster
(Ignore all the node exporter pods, I've been playing with Prometheus on this new cluster...)
I've gone from 3 to 2 by pushing some changes to the repo! It just feels so much better automating!
My Thoughts
I like how lightweight Flux feels and need to try out some of the Helm chart controllers but you know, time and whatnot.
Flux also feels like a tool I can use and I also don't have to look after it, Argo CD could almost need a cluster of its own if this was looking like moving to production grade.
Either way, I'm not sure I have a favourite just yet (I know how very diplomatic of me) I don't think I've used them both long enough to compare. I've been using Argo for slightly longer and have found it nice and easy to update the values and upgrade chart versions for applications I've deployed using Helm.
I intend on testing and playing with Flux CD a bit more and I really like how hands off it feels.
Let me know what you think! Have I missed anything? Is there another tool I should check out? Feel free to comment! I'm more than happy to take on any constructive criticism and feedback!
Hopefully, this has at least been an interesting read, as I've really enjoyed tinkering and playing with these tools.