Install and Use Fleet CLI
SUSE® Rancher Prime Continuous Delivery CLI is a command-line interface (CLI) that allows you to interact directly with SUSE® Rancher Prime Continuous Delivery from your local machine. It enables you to create, apply, and inspect bundles without requiring a GitRepo. Typical use cases include:
-
Testing and previewing bundle contents.
-
Creating bundles directly from Helm charts, Kubernetes manifests, and
fleet.yamlfiles. -
Checking which clusters a bundle would target.
-
Validating deployments without installing SUSE® Rancher Prime Continuous Delivery in the cluster.
|
You can use For more information, see Install Fleet. |
Install Fleet CLI
Fleet CLI is a stand-alone binary that you can download from the Fleet GitHub releases page.
Linux/macOS
curl -L -o fleet https://github.com/rancher/fleet/releases/latest/download/fleet-linux-amd64
# Make it executable and move to PATH
chmod +x fleet
sudo mv fleet /usr/local/bin/
Prerequisites
Make sure you have the following tools installed and configured:
-
A working Kubernetes cluster (for example, k3s, kind, or a cloud provider).
-
kubectlis configured for your cluster. -
Helm is installed.
-
Fleet CLI is installed and accessible in your terminal.
Key Commands
SUSE® Rancher Prime Continuous Delivery provides several CLI commands to create, preview, and deploy bundles. These commands are useful for debugging and understanding the bundle lifecycle.
-
fleet apply: Creates or previews a bundle from local files, such as a Helm chart, Kubernetes manifests, or kustomize folders. This command does not require access to a cluster, so it works even without SUSE® Rancher Prime Continuous Delivery orkubectlinstalled.Example:
fleet apply my-bundle ./manifests
-
fleet target: Reads a bundle file and evaluates which clusters would receive it, based on selectors and targeting rules such astargets,targetOverrides,clusterGroups, and label selectors.Example:
fleet target my-bundle ./manifests
-
fleet deploy: Takes the output offleet target, or a dumpedbundledeployment/content resource, and deploys it to a cluster—just likefleet-agentwould.You can use it in these scenarios:
fleet apply -o - name ./folderto check the YAML of the bundle before creating it. For more information, see Examining the Bundle Lifecycle with the CLI. Use with a target to debug selectors and verify which downstream clusters are targeted. **fleet deploy --dry-runto print resources that would be deployed, without applying them.
Deploy a Sample Bundle Using Fleet CLI
You can deploy workloads without using GitRepos by applying them locally with the CLI. For example, use the Fleet examples repository:
git clone https://github.com/rancher/fleet-examples
cd fleet-examples/single-cluster
Apply it to the current cluster:
fleet apply -o my-cool-bundle manifests
This command creates a Bundle resource in the namespace.
Convert a Helm Chart into a Bundle
You can use Fleet CLI to convert a Helm chart into a bundle. For example, to convert the external-secrets operator chart:
cat > targets.yaml <<EOF
targets:
- clusterSelector: {}
EOF
mkdir app
cat > app/fleet.yaml <<EOF
defaultNamespace: external-secrets
helm:
repo: https://charts.external-secrets.io
chart: external-secrets
EOF
fleet apply --compress --targets-file=targets.yaml -n fleet-default -o - external-secrets app > eso-bundle.yaml
kubectl apply -f eso-bundle.yaml
Make sure you use a cluster selector in targets.yaml that matches all clusters you want to deploy to.
For more information, refer to Fleet: Multi-Cluster Deployment with the Help of External Secrets.
Troubleshooting
If the bundle is not ready:
-
Check if
fleet-controllerandfleet-agentpods are running. -
Make sure the
fleet-localcluster is registered. -
Inspect the bundle for error messages:
kubectl describe bundle -n fleet-local <bundle-name> -
Delete and reapply the bundle if you encounter Helm ownership conflicts.
Verify Agent and Controller Status
Before troubleshooting bundle or deployment issues, verify that the Fleet agent is registered and running on the downstream cluster. For more information, see Fleet Agent is Registered, Watches for BundleDeployments.
If a bundle is not ready on a given cluster, check the following:
-
On the management cluster:
-
Verify that the
fleet-controllerandgitjobpods (orhelmops, depending on your setup) are running. -
Ensure the cluster status shows Ready.
-
Check the status of the bundle—it should contain an error message if deployment failed.
-
-
On the target cluster where the bundle isn’t ready:
-
Verify that this target cluster is registered and has a running
fleet-agentpod. -
As a last resort, check the logs of the
fleet-agentpod.
-