Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev and architecture sections #171

Merged
merged 2 commits into from
Oct 31, 2024
Merged
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
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.
Binary file modified docs/reference-guides/architecture/30000ft_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/reference-guides/architecture/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ following functionalities:

- **Importing CAPI clusters into Rancher:** installing Rancher Cluster Agent in
CAPI provisioned clusters.
- **CAPI Operator Configuration:** Configuration support for the CAPI Operator.
- **Manage lifecycle of CAPI providers:** managing the lifecycle of CAPI providers with [CAPIProvider](../../tasks/capi-operator/capiprovider_resource.md) API
by leveraging [Cluster API Operator](https://github.com/kubernetes-sigs/cluster-api-operator).
Loading