Fleet is built into Rancher (and installable standalone). It's designed for many clusters — the design target was a million edge clusters.
5.1 Model¶
GitRepo (fleet-default ns) ──► Bundles ──► BundleDeployments ──► fleet-agent on each cluster
│ ▲
└── targets (cluster selectors, cluster groups)
- GitRepo: points at a repo, branch/revision and paths.
- Bundle: Fleet's internal unit — rendered manifests/Helm/Kustomize from one path.
- ClusterGroup: label selectors over clusters.
- fleet.yaml: per-path config — Helm values, Kustomize dir, per-target overrides.
5.2 Example¶
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: platform-addons
namespace: fleet-default
spec:
repo: https://gitlab.example.net/platform/fleet-addons.git
branch: main
paths:
- cert-manager
- ingress
- monitoring
clientSecretName: gitlab-deploy-token
targets:
- name: prod
clusterSelector:
matchLabels:
env: prod
- name: lab
clusterGroup: homelab
# monitoring/fleet.yaml
defaultNamespace: cattle-monitoring-system
helm:
repo: https://charts.rancher.io
chart: rancher-monitoring
version: 106.1.2+up69.8.2 # pin explicitly
releaseName: rancher-monitoring
values:
prometheus:
prometheusSpec:
retention: 15d
targetCustomizations:
- name: lab
clusterGroup: homelab
helm:
values:
prometheus:
prometheusSpec:
retention: 3d
resources:
requests:
memory: 1Gi
diff:
comparePatches:
- apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
operations:
- {"op": "remove", "path": "/webhooks"}
5.3 Fleet tips¶
- Bundle status
Modifiedusually means drift (something mutated a resource) — usediff.comparePatchesfor known benign mutations. - Use
dependsOninfleet.yamlto order bundles (e.g. CRDs before CRs). helm.takeOwnership: truelets Fleet adopt pre-existing releases.- Fleet can manage cluster definitions themselves (the
provisioning.cattle.ioobjects above) when pointed at the local cluster — true "clusters as code." - Polling is default; configure webhooks from GitLab/GitHub for near-instant sync.
← Rancher Manager · Index · Longhorn: distributed block storage →