Development document update and formatting

This commit is contained in:
Dharmit Shah 2025-02-05 16:26:06 +05:30
parent bedb8fd29a
commit 027fb31b3a
No known key found for this signature in database
GPG Key ID: 1086AC123836055B
2 changed files with 85 additions and 75 deletions

View File

@ -10,7 +10,7 @@ Cluster API Provider RKE2 is compliant with the `clusterctl` contract, which mea
## Management Cluster ## Management Cluster
In order to use this provider, you need to have a management cluster available to you and have your current KUBECONFIG context set to talk to that cluster. If you do not have a cluster available to you, you can create a `kind` cluster. These are the steps needed to achieve that: In order to use this provider, you need to have a management cluster available to you and have your current KUBECONFIG context set to talk to that cluster. If you do not have a cluster available to you, you can create a `kind` cluster. These are the steps needed to achieve that:
1. Ensure kind is installed (https://kind.sigs.k8s.io/docs/user/quick-start/#installation) 1. Ensure [kind is installed](https://kind.sigs.k8s.io/docs/user/quick-start/#installation).
2. Create a special `kind` configuration file if you intend to use the Docker infrastructure provider: 2. Create a special `kind` configuration file if you intend to use the Docker infrastructure provider:
```bash ```bash

View File

@ -9,13 +9,14 @@ The following instructions are for development purposes.
2. Fork the [Cluster API Provider RKE2](https://github.com/rancher/cluster-api-provider-rke2) repo 2. Fork the [Cluster API Provider RKE2](https://github.com/rancher/cluster-api-provider-rke2) repo
3. Clone your new repo into the **GOPATH** (i.e. `~/go/src/github.com/yourname/cluster-api-provider-rke2`) 3. Clone your new repo into the **GOPATH** (i.e. `~/go/src/github.com/yourname/cluster-api-provider-rke2`)
4. Ensure **Tilt** and **kind** are installed 4. Ensure **Tilt** and **kind** are installed
5. Create a `tilt-settings.json` file in the root of your forked/cloned `cluster-api` directory. 5. Create a `tilt-settings.json` file in the root of the directory where you cloned the Cluster API repo in step 1.
6. Add the following contents to the file (replace "yourname" with your github account name): 6. Add the following contents to the file (replace `/path/to/clone/of/` with appropriate file path and "yourname" with
your github account name):
```json ```json
{ {
"default_registry": "ghcr.io/yourname", "default_registry": "ghcr.io/yourname",
"provider_repos": ["../../github.com/yourname/cluster-api-provider-rke2"], "provider_repos": ["/path/to/clone/of/github.com/yourname/cluster-api-provider-rke2"],
"enable_providers": ["docker", "rke2-bootstrap", "rke2-control-plane"], "enable_providers": ["docker", "rke2-bootstrap", "rke2-control-plane"],
"kustomize_substitutions": { "kustomize_substitutions": {
"EXP_MACHINE_POOL": "true", "EXP_MACHINE_POOL": "true",
@ -39,8 +40,6 @@ The following instructions are for development purposes.
} }
``` ```
> NOTE: Until this [bug](https://github.com/kubernetes-sigs/cluster-api/pull/7482) merged in CAPI you will have to make the changes locally to your clone of CAPI.
7. Open another terminal (or pane) and go to the `cluster-api` directory. 7. Open another terminal (or pane) and go to the `cluster-api` directory.
8. Run the following to create a configuration for kind: 8. Run the following to create a configuration for kind:
@ -57,7 +56,8 @@ nodes:
EOF EOF
``` ```
> NOTE: if you are using Docker Desktop v4.13 or above then you will you will encounter issues from here. Until a permanent solution is found its recommended you use v4.12 > NOTE: if you are using Docker Desktop v4.13 or above then you will encounter issues from here. Until
> a permanent solution is found its recommended you use v4.12
9. Run the following command to create a local kind cluster: 9. Run the following command to create a local kind cluster:
@ -65,10 +65,20 @@ EOF
kind create cluster --config kind-cluster-with-extramounts.yaml kind create cluster --config kind-cluster-with-extramounts.yaml
``` ```
10. Now start tilt by running the following: 10. Now start tilt by running the following command in the directory where you cloned Cluster API repo in step 1:
```bash ```bash
tilt up tilt up
``` ```
11. Press the **space** key to see the Tilt web ui and check that everything goes green. 11. Press the **space** key to see the Tilt web ui and check that everything goes green.
### Troubleshooting
Doing `tilt up` should install a bunch of resources in the underlying kind cluster. If you don't see anything there,
run `tilt logs` in a separate terminal without stopping the `tilt up` command that you originally started.
#### Common Issues
1. Make sure you run the `kind` and `tilt` commands mentioned above from correct directory.
2. A `go mod vendor` might be required in your clone of CAPI repo. `tilt logs` should make this obvious.