turtles-docs/docs/developer-guide/development.md

2.1 KiB

sidebar_position
3

Development setup

Prerequisites:

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 cluster with the following configuration. 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 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 repository locally.

  2. Create tilt-settings.yaml:

{
    "default_registry": "ghcr.io/turtles-dev",
    "debug": {
        "turtles": {
            "continue": true,
            "port": 40000
        }
    }
}
  1. Open a terminal in the root of the Rancher Turtles repository.
  2. Run the following:
# Rancher hostname can be configured using ngrok.
RANCHER_HOSTNAME=my.customhost.dev NGROK_API_KEY="<api-key>" NGROK_AUTHTOKEN="<api-authtoken>" make dev-env