As the GitOps paradigm continues to evolve, different interpretations and implementations will continue to appear. SUSE Rancher Fleet is a project creating a powerful, lightweight, and scalable GitOps engine. Recently, we showed the art of the possible between Shipa and SUSE Rancher Fleet. Make sure to check out our joint solution brief where the intersection of the SUSE Rancher and Shipa stacks come together. Though if this is your first time leveraging either Shipa or SUSE Rancher Fleet, we can get you started with this example. Make sure to fork or clone the example so you can see Fleet trigger with Git.
Installing Fleet
Installing Fleet on a cluster is pretty straightforward. Fleet’s quickstart has the pair of Helm install commands to leverage.
helm -n fleet-system install --create-namespace --wait fleet-crd https://github.com/rancher/fleet/releases/download/v0.3.9/fleet-crd-0.3.9.tgz helm -n fleet-system install --create-namespace --wait fleet https://github.com/rancher/fleet/releases/download/v0.3.9/fleet-0.3.9.tgz
And just like that, you have Fleet installed. Next is to get started with Shipa Cloud.
Getting Started with Shipa Cloud
If you don’t have a Shipa Cloud account, make sure to sign up. Once you log into Shipa Cloud, if this is your first time, a few Shipa objects need to be created. Everything that has been created in the below steps via the UI can be created also via an infrastructure-as-code e.g IaC solution such as Terraform or Crossplane.
Framework
A Shipa Framework is the logical home of all of your policies and abstraction.
Shipa Cloud -> Frameworks + Create Framework.
Can select the “resonsable defaults” for the Purpose.
Once you hit next, can give a name to the Framework.
Name: fleetframework
Plan: shipa-plan
Team: shipa-team.
Then click Create and your Framework has been created.
Once the Framework has been created, can bind that to a Kubernetes cluster.
Cluster
Shipa will need to bind to a Kubernetes cluster to act on your behalf. Shipa does need a few pieces of information to connect to your Kubernetes cluster. Coming up very soon is a one-click bind to your Kubernetes cluster.
Though if you do not have a cluster bound to Shipa Cloud, can add a new Cluster.
Shipa Cloud -> Clusters + Add Cluster
Can give a Cluster a name and follow the prompts for the needed info. Can select to have “fleetframework” be associated with the Cluster.
Click Next to fill in the required information.
Click Next with the required information. With your Cluster connected, lastly will need to create a Shipa Application.
Application
A Shipa Application is something that needs to get deployed and is subject to the rules/policies of the Framework. Recently, there have been improvements to quickly deploy.
Shipa Cloud -> Applications + Add Application
Name: fleetapp
Framework: fleetframework
Team: shipa-team
Image URL [Sample Image Link] : docker.io/shipasoftware/hello-shipa:latest
Click Deploy and your application has been deployed.
Clicking on the URL, you can see the deployed application.
Though for this example, we want to deploy via Fleet. To accomplish that, there is one more piece that needs to be wired in, which is Crossplane.
Crossplane Configuration
Crossplane is an excellent abstraction layer allowing for the easy switch of GitOps providers with Shipa. If you don’t have Crossplane installed in your cluster [e.g the cluster running Fleet], you can do that with Helm also.
kubectl create namespace crossplane-system helm repo add crossplane-stable https://charts.crossplane.io/stable helm repo update helm install crossplane --namespace crossplane-system crossplane-stable/crossplane
With Crossplane installed, there is a trio of Crossplane Objects that need to be created for the Shipa Abstraction.
Wiring Crossplane to Shipa
Wiring Crossplane to Shipa is pretty straightforward. Just need to install the Crossplane Provider and wiring up your Shipa Cloud credentials.
In the crossplane-secret.yaml, make sure to replace the token with your Shipa Cloud Token.
Can get your Shipa Cloud Token by leveraging the Shipa CLI and running shipa token show.
Then add the API key to the crossplane-secret.yaml
Apply the three manifests.
kubectl apply -f crossplane-provider-shipa.yaml kubectl apply -f crossplane-secret.yaml kubectl apply -f crossplane-shipa-config.yaml
Now you are all set for the last piece, time to trigger Fleet.
First Fleet Deployment with Shipa
In the /apps directory in the sample repository, this would all that would have to be exposed to a developer. The only wiring the developer would need is an image and what the application is and that is it.
To have Fleet trigger on this, just apply the Fleet Object.
Apply the Fleet Object in your Fleet Cluster.
kubectl apply -f fleet-app.yaml kubectl -n fleet-local get fleet
With Fleet’s execution, you can now head back to the Shipa UI and check out what has just been deployed.
Click on the URL.
Congratulations on your first Fleet deployment with Shipa.
SUSE Rancher Fleet and Shipa, Better Together.
There is certainly a lot of the art of the possible between the SUSE Rancher Stack and Shipa. Swapping GitOps Engines from ArgoCD to Dagger to Fleet is simple with Shipa. All you need to expose to your developers is one or two lines in YAML and let Shipa take care of the rest. Check out our Joint Solution Brief to see how the SUSE Rancher stack and Shipa works well together.
Cheers,
-Ravi