-
Cluster engine: Fleet is a container management and deployment engine designed to offer users more control on the local cluster and constant monitoring through GitOps. Fleet focuses not only on the ability to scale, but it also gives users a high degree of control and visibility to monitor exactly what is installed on the cluster.
-
Deployment management: Fleet can manage deployments from git of raw Kubernetes YAML, Helm charts, 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 all resources in the cluster. As a result, users have a high degree of control, consistency, and auditability.
For information read it here: Fleet Documentation
-
Check helm is installed in the system.
helm version
-
Install
helm
(if not installed)sudo zypper install helm
-
Download
kubectl
-
In this guide we're using K3s Kubernetes cluster. For this we will use the dockerize way to install K3s Kuberenets is install K3d.
To install k3d follow this guide.
- 1 VM with 4 CPU and 8GB Ram
Fleet is fundamentally a set of Kubernetes custom resource definitions (CRDs) and controllers that manage GitOps for a single Kubernetes cluster or a large scale deployment of Kubernetes clusters. It is a distributed initialization system that makes it easy to customize applications and manage HA clusters from a single point. Click here for more info.
Initially we will install the Docker in the system.(Skip this step if Docker is already present in the system)
-
Install Docker and Check it's running in the system.
sudo zypper install docker
-
Start the docker daemon during boot:
sudo systemctl enable docker
-
Join the docker group that is allowed to use the docker daemon:
sudo usermod -G docker -a $USER
-
Restart the docker daemon:
sudo systemctl restart docker
-
Verify docker is running:
docker version
-
Install
fleet-crd
viaHelm
.helm -n cattle-fleet-system install --create-namespace --wait \ fleet-crd https://github.com/rancher/fleet/releases/download/v0.6.0-rc.4/fleet-crd-0.6.0-rc.4.tgz
wait for few minutes to fetch information and create respective CR's in the system.
-
Install
fleet
viaHelm
.helm -n cattle-fleet-system install --create-namespace --wait \ fleet https://github.com/rancher/fleet/releases/download/v0.6.0-rc.4/fleet-0.6.0-rc.4.tgz
-
Check fleet status
kubectl -n fleet-local get fleet
-
Add a Git Repo to Watch
cat > example.yaml << "EOF" apiVersion: fleet.cattle.io/v1alpha1 kind: GitRepo metadata: name: sample # This namespace is special and auto-wired to deploy to the local cluster namespace: fleet-local spec: # Everything from this repo will be ran in this cluster. You trust me right? repo: "https://github.com/rancher/fleet-examples" paths: - simple EOF
-
Create above
GitRepo
CRDkubectl apply -f example.yaml
-
Check the deployment is created there or not from the git repository added.
kubectl get deploy frontend
Now try to play with the fleet by modifying the application and see whether it get reverted or not.
Want to know more about fleet multicluster management stay connected...