Skip to content

Commit

Permalink
Update developer setup docs with relevant information
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <[email protected]>
  • Loading branch information
alexander-demicev committed Oct 30, 2024
1 parent 654552c commit be16ec9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
46 changes: 21 additions & 25 deletions docs/developer-guide/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,31 @@ sidebar_position: 3
- [helm](https://helm.sh/)
- [tilt](https://tilt.dev/)

## Environment description

The Turtles development environment relies on Tilt for hot-reloading and a Kind cluster with Rancher and Turtles installed. We also use ngrok to expose the Rancher server to the internet.
The environment can be provisioned using the `make dev-env` command. However, there are some prerequisites that need to be met before running this command. Executing the command will perform the following actions:

1. Create a [kind](https://kind.sigs.k8s.io/) cluster with the following [configuration](https://github.com/rancher/turtles/blob/main/scripts/kind-cluster-with-extramounts.yaml). This cluster will be used to run
Rancher and Turtles and will also be prepared to work with CAPD (CAPI Provider Docker).
2. In this setup, we will install the [Cluster API Operator](../developer-guide/install_capi_operator.md) separately from Turtles for a decentralized development environment.
The CAPI Operator will be installed using a Helm chart and will include the following providers:
- Core Cluster API
- Kubeadm Bootstrap and Control Plane Providers
- Docker Infrastructure Provider
- Cert Manager
3. Install the ngrok ingress controller to expose the Rancher server to the internet.
4. Install the `Rancher manager` using Helm.
5. Run `tilt up` to install Turtles and enable hot-reloading of containers.

## Create a local development environment

1. Clone the [Rancher Turtles](https://github.com/rancher/turtles) repository locally
1. Clone the [Rancher Turtles](https://github.com/rancher/turtles) repository locally.

2. Create **tilt-settings.yaml**:

```yaml
{
"k8s_context": "k3d-rancher-test",
"default_registry": "ghcr.io/turtles-dev",
"debug": {
"turtles": {
Expand All @@ -29,30 +45,10 @@ sidebar_position: 3
}
```

3. Open a terminal in the root of the Rancher Turtles repository
3. Open a terminal in the root of the Rancher Turtles repository.
4. Run the following:

```bash
make dev-env

# Or if you want to use a custom hostname for Rancher
RANCHER_HOSTNAME=my.customhost.dev make dev-env
```

5. When tilt has started, open a new terminal and start ngrok or inlets

```bash
kubectl port-forward --namespace cattle-system svc/rancher 10000:443
ngrok http https://localhost:10000
# Rancher hostname can be configured using ngrok.
RANCHER_HOSTNAME=my.customhost.dev NGROK_API_KEY="<api-key>" NGROK_AUTHTOKEN="<api-authtoken>" make dev-env
```

## What happens when you run `make dev-env`?

1. A [kind](https://kind.sigs.k8s.io/) cluster is created with the following [configuration](https://github.com/rancher/turtles/blob/main/scripts/kind-cluster-with-extramounts.yaml).
1. [Cluster API Operator](../developer-guide/install_capi_operator.md) is installed using helm, which includes:
- Core Cluster API controller
- Kubeadm Bootstrap and Control Plane Providers
- Docker Infrastructure Provider
- Cert manager
1. `Rancher manager` is installed using helm.
1. `tilt up` is run to start the development environment.
2 changes: 1 addition & 1 deletion docs/developer-guide/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sidebar_position: 0

# Introduction

Everything you need to know about developing Rancher Turtles.
This section contains information about setting up a development environment for Rancher Turtles. For architecture and design information, see the [architecture](../reference-guides/architecture/intro.md) section.

0 comments on commit be16ec9

Please sign in to comment.