2.9 KiB
Bundle Lifecycle
A bundle is an internal resource used for the orchestration of resources from git. When a GitRepo is scanned it will produce one or more bundles.
To demonstrate the life cycle of a Fleet bundle, we will use multi-cluster/helm as a case study.
- User will create a GitRepo that points to the multi-cluster/helm repository.
- The
gitjob-controllerwill sync changes from the GitRepo and detect changes from the polling or webhook event. With every commit change, thegitjob-controllerwill create a job that clones the git repository, reads content from the repo such asfleet.yamland other manifests, and creates the Fleet bundle.
Note: The job pod with the image name
rancher/tekton-utilswill be under the same namespace as the GitRepo.
- The
fleet-controllerthen syncs changes from the bundle. According to the targets, thefleet-controllerwill createBundleDeploymentresources, which are a combination of a bundle and a target cluster. - The
fleet-agentwill then pull theBundleDeploymentfrom the Fleet controlplane. The agent deploys bundle manifests as a Helm chart from theBundleDeploymentinto the downstream clusters. - The
fleet-agentwill continue to monitor the application bundle and report statuses back in the following order: bundledeployment > bundle > GitRepo > cluster.
This diagram shows the different rendering stages a bundle goes through until deployment.
Examining the Bundle Lifecycle With the CLI
Several fleet CLI commands help with debugging bundles.
fleet apply
Apply renders a folder with Kubernetes resources, such as a Helm chart, manifests, or kustomize folders, into a Fleet bundle resource.
git clone https://github.com/rancher/fleet-test-data
cd fleet-test-data
fleet apply -n fleet-local -o bundle.yaml testbundle simple-chart/
More information on how to create bundles with fleet apply can be found in the section on bundles.
Lifecycle CLI
Fleet CLI commands help you debug and understand the bundle lifecycle. The following example uses the full bundle lifecycle using CLI:
git clone https://github.com/rancher/fleet-test-data
cd fleet-test-data
# for information about apply see https://fleet.rancher.io/bundle-add
fleet apply -n fleet-local -o bundle.yaml testbundle simple-chart/
fleet target --bundle-file bundle.yaml --dump-input-list > bd.yaml
fleet deploy --input-file bd.yaml --dry-run
For more information, refer to Fleet CLI Key commands.