Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com> |
||
|---|---|---|
| .github | ||
| bootstrap | ||
| controlplane | ||
| docs | ||
| hack | ||
| pkg | ||
| samples | ||
| scripts | ||
| version | ||
| .dockerignore | ||
| .gitignore | ||
| Dockerfile | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| go.mod | ||
| go.sum | ||
| metadata.yaml | ||
| tilt-provider.json | ||
README.md
Cluster API Provider RKE2
❗ This project is early in development
What is Cluster API Provider RKE2
The [Cluster API][cluster_api] brings declarative, Kubernetes-style APIs to cluster creation, configuration and management.
Cluster API Provider RKE2 is a combination of 2 provider types, a Cluster API Control Plane Provider for provisioning Kubernetes control plane nodes and a Cluster API Bootstrap Provider for bootstrapping Kubernetes on a machine where RKE2 is used as the Kubernetes distro.
Getting Started
These instructions are for development purposes initially and will be changed in the future for user facing instructions.
- Clone the Cluster API Repo into the GOPATH
Why clone into the GOPATH? There have been historic issues with code generation tools when they are run outside the go path
- Fork the Cluster API Provider RKE2 repo
- Clone your new repo into the GOPATH (i.e.
~/go/src/github.com/myname/cluster-api-provider-rke2) - Ensure Tilt and kind are installed
- Create a
tilt-settings.jsonfile in the root of your forked/clonedcluster-apidirectory. - Add the following contents to the file (replace "yourname" with your github account name):
{
"default_registry": "ghcr.io/rancher-sandox",
"provider_repos": ["../../github.com/rancher-sandbox/cluster-api-provider-rke2"],
"enable_providers": ["docker", "rke2-bootstrap", "rke2-control-plane"],
"kustomize_substitutions": {
"EXP_MACHINE_POOL": "true",
"EXP_CLUSTER_RESOURCE_SET": "true"
},
"extra_args": {
"rke2-bootstrap": ["-zap-log-level=debug"],
"rke2-control-plane": ["-zap-log-level=debug"],
"core": ["-zap-log-level=debug"]
},
"debug": {
"rke2-bootstrap": {
"continue": true,
"port": 30001
},
"rke2-control-plane": {
"continue": true,
"port": 30002
}
}
}
NOTE: Until this bug merged in CAPI you will have to make the changes locally to your clone of CAPI.
- Open another terminal (or pane) and go to the
cluster-apidirectory. - Run the following to create a configuration for kind:
cat > kind-cluster-with-extramounts.yaml <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: capi-test
nodes:
- role: control-plane
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
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
- Run the following command to create a local kind cluster:
kind create cluster --config kind-cluster-with-extramounts.yaml
- Now start tilt by running the following:
tilt up
- Press the space key to see the Tilt web ui and check that everything goes green.