Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/persona.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Key Personas and Their Roles

| Persona | Responsibilities | Key Benefits |
| --- | ----- | ----- |
| Platform Engineers | Set up and manage Fleet installation across clusters <br/> Define and enforce multi-cluster application and policy deployments <br/> Manage GitRepo and fleet.yaml configurations <br/> Perform cluster-wide updates and rollbacks | Centralized control across clusters <br/> Improved standardization and compliance |
| Application Developers | Structure application Helm charts or manifests in Git <br/> Define deployment targets and environments in `fleet.yaml` <br/> Monitor deployment status via UI or CLI | GitOps-based workflows <br/> Faster, automated, and consistent deployments across environments |
| Security Administrators | Define and enforce security policies as code- <br/> Deploy security tools and configurations <br/> Audit and manage security posture across clusters | Reduced risk and centralized compliance management <br/> Automated, consistent security configuration |
Comment on lines +3 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a dot at the end of each sentence in the items that are in the same column?

I see we have fleet.yaml and fleet.yaml in the document. I guess we should use the same form, but I'm not sure which one is better (looks like fleet.yaml). We maybe should define a style guide.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use bullet points to make points easier to distinguish from each other?

Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider revising 'as code-' to 'as code:' or another appropriate phrasing to fix the punctuation typo.

Suggested change
| Security Administrators | Define and enforce security policies as code- <br/> Deploy security tools and configurations <br/> Audit and manage security posture across clusters | Reduced risk and centralized compliance management <br/> Automated, consistent security configuration |
| Security Administrators | Define and enforce security policies as code: <br/> Deploy security tools and configurations <br/> Audit and manage security posture across clusters | Reduced risk and centralized compliance management <br/> Automated, consistent security configuration |

Copilot uses AI. Check for mistakes.
155 changes: 125 additions & 30 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import TabItem from '@theme/TabItem';

# Quick Start

![](/img/single-cluster.png)

Who needs documentation, lets just run this thing!
![Image displaying the flow of single cluster with Fleet](../static/img/single-cluster.png)

## Install

Fleet is distributed as a Helm chart. Helm 3 is a CLI, has no server side component, and its use is
fairly straightforward. To install the Helm 3 CLI follow the <a href="https://helm.sh/docs/intro/install">official install instructions</a>.
Fleet is distributed as a Helm chart. Helm 3 is a CLI, has no server side component, and its use is
Copy link
Member

@olblak olblak May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fleet is distributed as a Helm chart. Helm 3 is a CLI, has no server side component, and its use is
Fleet is distributed as a Helm chart. Helm is a CLI, has no server side component, and its use is

Do we need to specify version 3?
My understanding is that the Helm project is planning on a version 4 and this page will look outdated very soon.
Plus the version "3" provides no valuable information

fairly straightforward. To install the Helm 3 CLI follow the <a href="https://helm.sh/docs/intro/install">official install instructions</a>.

Fleet enables continuous delivery of Kubernetes workloads across multiple clusters using a GitOps model. In this guide, you would be deploying a basic NGINX Pod using fleet.yaml.

:::caution Fleet in Rancher
:::caution
Rancher has separate helm charts for Fleet and uses a different repository.
:::

Expand Down Expand Up @@ -43,47 +42,143 @@ Install the Fleet Helm charts (there's two because we separate out CRDs for ulti
fleet/fleet`}
</CodeBlock>

To verify installation, run:

`kubectl get pods -n cattle-fleet-system`

## Add a Git Repo to Watch

Change `spec.repo` to your git repo of choice. Kubernetes manifest files that should
be deployed should be in `/manifests` in your repo.
Specify the Git repositories containing your deployment manifests or Helm charts. For hello world, example you need:
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider rephrasing 'For hello world, example you need:' to 'For example, for a hello world deployment, include:' for improved clarity.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to use a singular here, to prevent confusion among users: a given GitRepo resources watches one git repository.

Suggested change
Specify the Git repositories containing your deployment manifests or Helm charts. For hello world, example you need:
Specify the Git repository containing your deployment manifests or Helm charts. For hello world, example you need:

* deployment.yaml for defining workload
* fleet.yaml for how should Fleet control the deployment
* Gitrepo.yaml for where to find your git repo, which branch and sub-path to monitor.
* (optionally) You can also add credentials
Comment on lines +52 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* deployment.yaml for defining workload
* fleet.yaml for how should Fleet control the deployment
* Gitrepo.yaml for where to find your git repo, which branch and sub-path to monitor.
* (optionally) You can also add credentials
* deployment.yaml for defining your workload
* fleet.yaml providing configuration instructing Fleet on how to control the deployment
* Gitrepo.yaml referencing your git repo, which branch and sub-path to monitor.
* (optionally) You can also add credentials


```bash
cat > example.yaml << "EOF"
Structure your repository like this:

![Screenshot displaying the file directory](../static/img/file-structure-sample-ss.png)
Comment on lines +57 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not suggest to have the gitrepo.yaml in the repository being deployed.

The reason why is because the GitRepo can be considered as just another resource by Fleet and can add confusion.

For example... lets say you have a git repository with some YAML fields and that one of them is a GitRepo.

Fleet will deploy that GitRepo, which means it will create another GitRepo (you are nesting GitRepos).
You might want to do that, but I don't think that's the case in this example.

I would take the GitRepo out of the git repository here to avoid confusions and unexpected behaviour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

It was confusing to me as well the first time I deploy an application using Fleet
I think I would also add a warning about this bad approach


**deployment.yaml**

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
```

**fleet.yaml**
```yaml
defaultNamespace: hello-world
targets:
- name: all-dev-clusters
clusterSelector:
matchLabels:
env: dev
```
Your fleet.yaml can use:
* clusterSelector: target clusters by labels (e.g., env=dev)
* targetCustomizations: override values or files per cluster.

This gives fine-grained control over how workloads are rolled out. For more information, refer to [fleet-yaml](ref-fleet-yaml.md).

**gitrepo.yaml**

```yaml
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
name: hello-world-repo
namespace: cattle-fleet-system
spec:
# Everything from this repo will be run in this cluster. You trust me right?
repo: "https://github.com/rancher/fleet-examples"
repo: https://github.com/<your-org>/my-fleet-repo
branch: main
paths:
- simple
EOF

kubectl apply -f example.yaml
- ./hello-world
# clientSecretName: my-ssh-key-secret (optional: for private repos)
```

## Get Status
You can define a GitRepo in YAML, then apply it using kubectl.

Get status of what fleet is doing
`kubectl apply -f gitrepo.yaml`

```shell
kubectl -n fleet-local get fleet
```
Fleet now watches that path for changes and automatically applies the manifests.

You should see something like this get created in your cluster.
To verify, you can either go to Rancher Desktop. Select **Continuous Delivery > Port Forwarding** to view deployment bundles.

![Screenshot displaying the Rancher Desktop ](../static/img/rancher-gitrepos-ss.png)

Or you can run the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two commands are listed here ;)

Suggested change
Or you can run the following command:
Or you can run the following commands:


```bash
kubectl get gitrepos -n fleet-default
kubectl get bundles -A
```
kubectl get deploy frontend
```
```
NAME READY UP-TO-DATE AVAILABLE AGE
frontend 3/3 3 3 116m
## Automating Deployments and Scaling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Automating Deployments and Scaling
## Automating Deployments and Scaling


As your Kubernetes environments grow, you can scale deployments across multiple clusters without increasing pipeline complexity. Use Fleet to automate deployments, apply region-specific configurations, and monitor deployments across environments.

### Scale with Labels and Targeting

To target specific clusters, apply labels such as `env=qa` or `region=eu` to your clusters. Use the `clusterSelector` and `targetCustomizations` fields in your `fleet.yaml` file to define which clusters receive which configurations.

![Diagram displaying flow of target specific clusters](../static/img/Flow-clusterSelector-targetCustomizations.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of having a diagram here, but in my web browser at least, it reads pretty small compared to the rest of the page contents. We may need to increase the font size and/or change its style to make it comfortable to read to as many readers as possible.


Fleet follows a GitOps model, allowing you to track who made changes and when using your Git history. When you push changes to your Git repository:

1. Fleet detects the change and evaluates `fleet.yaml` to determine which clusters to target.
1. It deploys the updated resources automatically.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. It deploys the updated resources automatically.
2. It deploys the updated resources automatically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numbering shouldn't matter much here, as indexes of numbered lists are computed when rendering Markdown into HTML.


For example, consider you are deploying hello world to QA environments in Europe and the US. Your clusters are labeled as follows:

| Cluster Name | Labels |
| ----- | ----- |
| `qa-eu-cluster` | `env=qa`, `region=eu` |
| `qa-us-cluster` | `env=qa`, `region=us` |

You define deployment logic in `fleet.yaml`:
```yaml
targets:
- name: qa-eu
clusterSelector:
matchLabels:
env: qa
region: eu
helm:
values:
image:
tag: 1.0.0-eu

- name: qa-us
clusterSelector:
matchLabels:
env: qa
region: us
helm:
values:
image:
tag: 1.0.0-us

```

When you push to Git, Fleet:

* Deploys version `1.0.0-eu` to `qa-eu-cluster`
* Deploys version `1.0.0-us` to `qa-us-cluster`

## Next steps

Do you need to...
Expand Down
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
docs: [
'index',
'persona',
{
type: 'category',
label: 'Tutorials',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/file-structure-sample-ss.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could perhaps be replaced with a text block, which would be easier to edit.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/rancher-gitrepos-ss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.