Skip to content

Commit

Permalink
Update docs for testing Fleet in Rancher (#2966)
Browse files Browse the repository at this point in the history
This removes docs living in `docs` on this topic, as they are now
obsolete, and expands `dev/README.md` to cover specific values to set
when testing a custom Fleet build in Rancher.
---------

Co-authored-by: Mario Manno <[email protected]>
  • Loading branch information
weyfonk and manno authored Oct 24, 2024
1 parent ba017fc commit 8560a62
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 136 deletions.
42 changes: 38 additions & 4 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Instructions on writing useful, well-formatted log messages can be found [here](

# Testing: Dev Scripts

These scripts are used for running tests locally in k3d. Don't use these on
production systems.
These scripts are used for running tests locally in [k3d](https://github.com/rancher/k3d).
Don't use these on production systems.

## Requirements

Expand All @@ -18,6 +18,14 @@ production systems.
- kubectl
- ...

### For Mac users

On Mac OS, Docker runs in a virtual machine. This means the network setup is more complicated.

> If you are unsure about which method you would like use for tunneling to localhost, we recommend [ngrok](https://ngrok.com).
More info [here](https://github.com/rancher/rancher/wiki/Setting-Up-Rancher-Development-Environment#ngrok).

## Running Tests on K3D

These commands should set up k3d and the fleet standalone images for single
Expand Down Expand Up @@ -65,11 +73,37 @@ other existing Fleet chart versions.
export CHARTS_BRANCH=<branch_created_in_previous_step>
```
3. Ensuring you have access to a running cluster in which to install Rancher.

4. Running script `dev/setup-rancher-with-dev-fleet`, which will install Rancher
For instance, a set of k3d clusters (1 upstream + 1 downstream) can be created
on your local machine through `dev/setup-k3ds`.

4. Commenting out the pairs of lines (name + value) setting the following
values for installing Rancher through Helm in script
`dev/setup-rancher-with-dev-fleet`, to match the location and version of the
Fleet build generated in step 1:
* `--set extraEnv[0].name=CATTLE_FLEET_VERSION \` to use a custom Fleet version,
otherwise Rancher will use the version pinned in its
[settings](https://github.com/rancher/rancher/blob/main/build.yaml#L5).
* `--set extraEnv[0].value=999.9.9+up9.9.9 \` to match the version from step 1.
* `--set extraEnv[1].name=CATTLE_CHART_DEFAULT_URL \` to set a custom chart URL
* `--set extraEnv[1].value=https://github.com/fleetrepoci/charts \`: this is the
custom charts repository used in step 1 by default.
Change it to a different URL if you have specified one in that step.
* `--set extraEnv[2].name=CATTLE_CHART_DEFAULT_BRANCH \` to set a custom chart
repo branch.
* `--set extraEnv[2].value=$branch \`: this must match the branch name created
in step 1.
* `--set rancherImageTag=$tag \`: only needed for custom Rancher builds.
If you have not built Rancher yourself, this is typically not needed and you
can leave it commented out.

5. Running script `dev/setup-rancher-with-dev-fleet`, which will install Rancher
using Helm, including test Fleet charts generated earlier. Once it is done,
single- or multi-cluster test suites can be run against an actual Rancher setup.

This also enables use of the Rancher UI, after opening the URL output by Helm
when installing the Rancher chart, then logging in using the `bootstrapPassword`
set in that script.

## Configuration

### Running scripts manually
Expand Down
132 changes: 0 additions & 132 deletions docs/testing_fleet_in_rancher.md

This file was deleted.

0 comments on commit 8560a62

Please sign in to comment.