Skip to content

Commit

Permalink
Update README with reference to our documentation page
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil-Grigorev committed Sep 26, 2023
1 parent 77778a8 commit 092fd4b
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 65 deletions.
99 changes: 34 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,75 @@
# CAPI + Rancher = :cupid:

A project looking at various aspects of making Rancher :heart: Cluster API.
![image](./cupid.png)

A project looking at various aspects of making `Rancher` :heart: `Cluster API`.

## Documentation

Configuration steps, the quickstart guide and the architecture for this project can be found in our [documentation](https://docs.rancher-turtles.com/).

---

## What is covered in this project?

Currently this project has the following functionality:
Currently, this project has the following functionality:

- Automatically import CAPI created cluster into Rancher
- Automatically import CAPI-created cluster into `Rancher`.
- Install and configure the `Cluster API Operator` project.

## How to use this?

### Installation
### Quick start

```
Note: The following will only work after we release the first version of the extension.
```

Prerequisites:
#### Prerequisites:

- Running [Rancher Manager cluster](https://ranchermanager.docs.rancher.com/) with cert-manager
- [Helm](https://helm.sh/)

Quick start:
Additional details on the required `Rancher Manager` cluster setup can be found in [rancher qetting-started](https://docs.rancher-turtles.com/docs/getting-started/rancher) documentation section.

These commands will install: Rancher turtles extension, CAPI Operator, CAPI itself with kubeadmin bootstrap and control plane providers.
These commands will install:
- `Rancher Turtles` extension
- `CAPI Operator`
- `CAPI` itself with the kubeadm bootstrap and control plane providers.

```bash
helm repo add rancher-turtles https://rancher-sandbox.github.io/rancher-turtles
helm repo update
helm install rancher-turtles rancher-turtles/rancher-turtles --create-namespace -n rancher-turtles-system
```

For additional quickstart details please refer to the `Rancher Turtles` [quickstart](https://docs.rancher-turtles.com/docs/getting-started/install_turtles_operator#install-rancher-turtles-operator-with-cluster-api-operator-as-a-helm-dependency) documentation.

Customizing the deployment:

The Rancher turtles Helm chart supports the following values:
The `Rancher Turtles` Helm chart supports the following values:

```yaml
rancherTurtles:
image: controller # image to use for the extension
tag: v0.0.0 # tag to use for the extension
imagePullPolicy: Never # image pull policy to use for the extension
namespace: rancher-turtles-system # namespace to deploy to (default: rancher-turtles-system)
cluster-api-operator:
cluster-api-operator: # contains all values passed to the Cluster API Operator helm chart. Full list of values could be found in https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/hack/charts/cluster-api-operator/values.yaml
enabled: true # indicates if CAPI operator should be installed (default: true)
cert-manager:
enabled: true # indicates if cert-manager should be installed (default: true)
cluster-api:
enabled: true # indicates if core CAPI controllers should be installed (default: true)
version: v1.4.6 # version of CAPI to install (default: v1.4.6)
configSecret: # set the name/namespace of configuration secret. Leave empty unless you want to use your own secret.
name: "" # name of the config secret to use for core CAPI controllers, used by the CAPI operator. See [CAPI operator](https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs#installing-azure-infrastructure-provider) docs for more details.
name: "" # name of the config secret to use for core CAPI controllers, used by the CAPI operator. See CAPI operator: https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs#installing-azure-infrastructure-provider docs for more details.
namespace: "" # namespace of the config secret to use for core CAPI controllers, used by the CAPI operator.
defaultName: "capi-env-variables" # default name for the secret.
core:
namespace: capi-system
fetchConfig: # (only required for airgapped environments)
url: "" # url to fetch config from, used by the CAPI operator. See [CAPI operator](https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs#provider-spec) docs for more details.
url: "" # url to fetch config from, used by the CAPI operator. See CAPI operator: https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs#provider-spec docs for more details.
selector: "" # selector to use for fetching config, used by the CAPI operator.
kubeadmBootstrap:
namespace: capi-kubeadm-bootstrap-system
Expand All @@ -69,72 +83,27 @@ cluster-api-operator:
selector: ""

```
### Installing CAPI providers
#### Installing CAPI providers

The `Rancher Turtles` extension does not install any CAPI providers, you will need to install them yourself using [CAPI operator](https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs).

The Rancher turtles extension does not install any CAPI providers, you will need to install them yourself using [CAPI operator](https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs).

To quickly deploy docker infrastructure, kubeadm bootstrap and control plane providers, apply the following:

```
kubectl apply -f https://raw.githubusercontent.com/rancher-sandbox/rancher-turtles/main/test/e2e/resources/config/capi-providers-secret.yaml
kubectl apply -f https://raw.githubusercontent.com/rancher-sandbox/rancher-turtles/main/test/e2e/resources/config/capi-providers.yaml
```

---

## How to contribute?
See our [contributor guide](CONTRIBUTING.md) for more details on how to get involved.

### Development setup

Prerequisites:

- [kind](https://kind.sigs.k8s.io/)
- [helm](https://helm.sh/)
- [clusterctl](https://cluster-api.sigs.k8s.io/user/quick-start.html#install-clusterctl)
- [tilt](https://tilt.dev/)

To create a local development environment:

1. Create **tilt-settings.yaml** like this:

```yaml
{
"k8s_context": "k3d-rancher-test",
"default_registry": "ghcr.io/richardcase",
"debug": {
"turtles": {
"continue": true,
"port": 40000
}
}
}
```

2. Open a terminal in the root of the repo
3. 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
```

4. When tilt has started then start ngrok or inlets

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

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

1. A [kind](https://kind.sigs.k8s.io/) cluster is created with the following [configuration](./scripts/kind-cluster-with-extramounts.yaml)
2. [Cert manager](https://cert-manager.io/) is installed on the cluster, we require it for running `Rancher turtes` extension.
3. `clusterctl` is used to bootstrap CAPI components onto the cluster, we use a default configuraion that includes: core Cluster API controller, Kubeadm bootstrap and control plane providers, Docker infrastructure provider.
4. `Rancher manager` is installed using helm.
5. Run `tilt up` to start the development environment.
Details on setting up the development environment can be found [here](./development.md)

# Testing
## Testing

We are using a combination of unit tests and e2e tests both using ginkgo and gomega frameworks.

Expand All @@ -143,7 +112,7 @@ To run unit tests, execute:
make test
```

Detailed documentation on e2e tests architecture and usage could be found [here](./test/e2e/README.md#e2e-tests).
Detailed documentation on e2e tests architecture and usage can be found [here](./test/e2e/README.md#e2e-tests).

## Code of Conduct

Expand Down
Binary file added cupid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Development setup

Prerequisites:

- [kind](https://kind.sigs.k8s.io/)
- [helm](https://helm.sh/)
- [clusterctl](https://cluster-api.sigs.k8s.io/user/quick-start.html#install-clusterctl)
- [tilt](https://tilt.dev/)

To create a local development environment:

1. Create **tilt-settings.yaml** like this:

```yaml
{
"k8s_context": "k3d-rancher-test",
"default_registry": "ghcr.io/richardcase",
"debug": {
"turtles": {
"continue": true,
"port": 40000
}
}
}
```

2. Open a terminal in the root of the repo
3. 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
```

4. When tilt has started then start ngrok or inlets

```bash
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](https://kind.sigs.k8s.io/) cluster is created with the following [configuration](./scripts/kind-cluster-with-extramounts.yaml)
2. [Cert manager](https://cert-manager.io/) is installed on the cluster, we require it for running `Rancher turtes` extension.
3. `clusterctl` is used to bootstrap CAPI components onto the cluster, we use a default configuraion that includes: core Cluster API controller, Kubeadm bootstrap and control plane providers, Docker infrastructure provider.
4. `Rancher manager` is installed using helm.
5. Run `tilt up` to start the development environment.

0 comments on commit 092fd4b

Please sign in to comment.