This is technically the first article in my series on GitOps.
Over the last few months, I have wondered about SUSE’s Fleet product. Why does no one use it? Why are Argo CD and Flux the “go-to” products for GitOps?
I finally decided it was time to give it a shot. I destroyed my Rancher cluster which was being managed by Argo CD, and I started reading the Fleet docs. Needless to say, I am not turning back.
Fleet can manage deployments from git of raw Kubernetes YAML, Helm charts, or Kustomize or any combination of the three. Regardless of the source all resources are dynamically turned into Helm charts and Helm is used as the engine to deploy everything in the cluster. This gives a high degree of control, consistency, and auditability. Fleet focuses not only on the ability to scale, but to give one a high degree of control and visibility to exactly what is installed on the cluster.
~ https://github.com/rancher/fleet
So why did I decide to switch completely over to fleet? There are actually a few reasons:
I use Harvester as my hypervisor.
I use Rancher (RKE2) as my Kubernetes engine.
I don’t love Argo CD.
I never invested the time to learn Flux.
I am a SUSE fanboy.
I am pretty locked into the SUSE way of life at this point. I am starting to see how all the SUSE products seem to blend into each other and form one big picture.
Now we switch to tutorial mode. I wanted to do a brief explainer on how to use Fleet and how not to use it.
I decided it was time to make a repo with some cool demo apps that we can install to our kube cluster with Fleet. Here is the repo.
To start out, if you are using Rancher, you already have Fleet.
On the left sidebar, you’ll see something called “Continuous Delivery.”
If you click into that, technically you are looking at Fleet.
Let’s dive deeper.
Your dashboard shows you the current status of your deployed resources. Your “Git Repos” show the repos that you are deploying from. Your clusters page shows the clusters you are deploying to. Your cluster groups page shows you the groups that you have made for specific clusters (think dev, stage, and production). Your advanced page shows you more advanced stuff that is not really relevant in this scope.
Let’s add my demo repo and deploy some resources to a cluster. First, we need a cluster to deploy to. I will make a simple RKE2 cluster with the Harvester cloud provider.
I have one node, and some default options. Nothing special. Let’s wait for the cluster to come up. The VM will come up and Rancher will install docker and get it ready for Kubernetes.
Once the cluster is up, we can start pushing stuff to it using Fleet.
The demo cluster is now showing up and is ready. We navigate to “Git Repos” and click on “Add Repository”, and we are greeted with the following screen:
Most of this is pretty obvious. One thing that tripped me up was that the default branch is “master” while I use “main”.
I always like to check the “Enable Self-Healing” box. The “Always Keep Resources” box should be checked if you are worried that you will delete the Git repo from Fleet (it can happen).
I am going to deploy Adguard Home to this cluster. I will edit the path to look like this:
Keep in mind, this will deploy everything in my folder “adguard-home”. Something also to keep in mind is that if there is not a namespace resource and you are looking to deploy to a particular namespace, you will get an error complaining it is not there. Argo CD has a feature that will automatically create the namespace for you if it’s not defined but needed.
Next, I tell fleet where I want adguard-home to land. I can make cluster groups if I want to but, in this case, I am only deploying to the demo cluster.
I will click create, and…
Now we wait for the resources to get applied.
Clicking into it, we can see now that all the resources except for the load balancer have been applied to the cluster.
If we now navigate to the cluster…
The pod is running and everything looks good besides the load balancer. I forgot to actually install a load balancer service so that will not create properly. For reference I usually use metallb.
UPDATE: Harvester comes with a LB service installed by default. You can read the docs on that here. I am creature of habit and deploy things “the way I always deploy them” hence the metallb.
But that is beside the point for this tutorial. I was able to deploy things to a cluster from fleet! Very cool! No Argo CD or Flux required.
There are a lot of other cool fleet features, but I think I will cover those in a later article.
I have officially decided that I will only be deploying Kubernetes resources to my homelab from Fleet.
More GitOps to come!
Cheers,
Joe