Skip to main content

Fleet

Fleet is a container management and deployment engine designed to offer users more control on the local cluster and constant monitoring through GitOps

fleet.rancher.io, code

Quick start​

Getting to know Fleet​

Install Fleet objects in your Kubernetes cluster​

# sets version
FLEET_VERSION=0.3.9

# (optional) views objects that will be created
helm template fleet-crd https://github.com/rancher/fleet/releases/download/v${FLEET_VERSION}/fleet-crd-${FLEET_VERSION}.tgz > temp/fleet-crd.yaml
helm template -n cattle-fleet-system fleet https://github.com/rancher/fleet/releases/download/v${FLEET_VERSION}/fleet-${FLEET_VERSION}.tgz > temp/fleet.yaml

# installs
helm -n cattle-fleet-system install --create-namespace --wait fleet-crd https://github.com/rancher/fleet/releases/download/v${FLEET_VERSION}/fleet-crd-${FLEET_VERSION}.tgz
helm -n cattle-fleet-system install --create-namespace --wait fleet https://github.com/rancher/fleet/releases/download/v${FLEET_VERSION}/fleet-${FLEET_VERSION}.tgz

# makes sure all containers are running fine
kubectl get all -n cattle-fleet-system

Use examples repo (or your own) to deploy your first applications​

# creates sample namespace
kubectl create namespace fleet-sample
# creates or updates the sample gitrepo
kubectl apply -f samples/gitrepo-guestbook-sample.yaml -n fleet-sample
# views fleet action
kubectl get fleet -n fleet-sample

Configuration​

Samples​

Alternatives​

NameModel
ArgoCDPush
FleetPull
FluxPull

Limitations​

Helm chart dependencies​

  • tgz files in charts folder (coming from helm dependency update) must be added to git to be picked up by Fleet (see issue #250)

Helm chart with objects on multiple namespaces​

  • You may encounter the issue Error while running post render on files: invalid cluster scoped object [name=* kind=PodSecurityPolicy apiVersion=policy/v1beta1] found, consider using "defaultNamespace", not "namespace" in fleet.yaml

Modified GitRepos​

Troubleshoot​

Fleet Kubernetes objects​

KindName
bundles.fleet.cattle.ioCustomResourceDefinition
bundledeployments.fleet.cattle.ioCustomResourceDefinition
bundlenamespacemappings.fleet.cattle.ioCustomResourceDefinition
clustergroups.fleet.cattle.ioCustomResourceDefinition
clusters.fleet.cattle.ioCustomResourceDefinition
clusterregistrationtokens.fleet.cattle.ioCustomResourceDefinition
gitrepos.fleet.cattle.ioCustomResourceDefinition
clusterregistrations.fleet.cattle.ioCustomResourceDefinition
gitreporestrictions.fleet.cattle.ioCustomResourceDefinition
contents.fleet.cattle.ioCustomResourceDefinition
imagescans.fleet.cattle.ioCustomResourceDefinition
gitjobs.gitjob.cattle.ioCustomResourceDefinition
gitjobServiceAccount
fleet-controllerServiceAccount
fleet-controller-bootstrapServiceAccount
fleet-controllerConfigMap
gitjobClusterRole
fleet-controllerClusterRole
fleet-controller-bootstrapClusterRole
gitjob-bindingClusterRoleBinding
fleet-controllerClusterRoleBinding
fleet-controller-bootstrapClusterRoleBinding
fleet-controllerRole
fleet-controllerRoleBinding
gitjobService
gitjobDeployment
fleet-controllerDeployment

Git token expired​

  • If you manage the GitRepo from Rancher UI and create new git credential, save twice the UI