Development setup

Prerequisites:

Create a local development environment

  1. Clone the Rancher Turtles repository locally

  2. Create tilt-settings.yaml:

    {
        "k8s_context": "k3d-rancher-test",
        "default_registry": "ghcr.io/turtles-dev",
        "debug": {
            "turtles": {
                "continue": true,
                "port": 40000
                "insecure_skip_verify": "true"
            }
        }
    }
  3. Open a terminal in the root of the Rancher Turtles repository

  4. Run the following:

    make dev-env
    
    # Or if you want to use a custom hostname for Rancher and your ngrok credentials
    NGROK_API_KEY=`key` NGROK_AUTHTOKEN=`token` RANCHER_HOSTNAME=my.customhost.dev make dev-env
  5. If you don’t have ngrok credentials and have not provided them in earlier step, you can also open a new terminal and start ngrok or inlets after tilt has started:

    kubectl port-forward --namespace cattle-system svc/rancher 10000:443
    ngrok http https://localhost:10000

What happens when you run make dev-env?

  1. A kind cluster will be created using the following configuration.

  2. The following prerequisite components will be installed using Helm:

    • Rancher manager.

    • Cert manager.

    • ngrok Kubernetes Operator.

  3. Docker images will be built locally, and Helm will deploy the following controllers in the cluster:

    • Core Cluster API controller.

    • RKE2 Bootstrap/Control Plane Provider controllers.

    • Docker Infrastructure Provider controller.

    • CAPI Add-on Provider for Fleet controller.

    • Rancher Turtles controller.

    • Rancher Turtles Cluster API Operator controller.

    • Rancher Turtles ClusterClass controller.

    • Rancher Turtles Day 2 operations controller.

  4. The development environment will be started using tilt up.