RKE2 bootstrap and control-plane Cluster API providers.
Go to file
Mohamed Belgaied Hassine e2c134c69b
Fixes for PR #60
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-17 18:52:14 +00:00
.github Merge pull request #63 from alexander-demicev/dependabot 2023-01-10 15:10:55 +01:00
bootstrap Fixes for PR #60 2023-01-17 18:52:14 +00:00
controlplane Fixes for PR #60 2023-01-17 18:52:14 +00:00
docs Fixes for PR #60 2023-01-17 18:52:14 +00:00
hack chore: scaffolding of the provider 2022-11-02 10:07:26 +00:00
pkg Fixes for PR #60 2023-01-17 18:52:14 +00:00
samples fixed issue with providerID and added handling of ClusterCIDR and ServiceCIDR 2023-01-11 15:52:21 +00:00
scripts chore: scaffolding of the provider 2022-11-02 10:07:26 +00:00
version Fix license year and add where its missing 2022-11-24 16:52:38 +01:00
.dockerignore chore: scaffolding of the provider 2022-11-02 10:07:26 +00:00
.gitignore chore: readme and tailt changes 2022-11-03 07:59:02 +00:00
Dockerfile chore: scaffolding of the provider 2022-11-02 10:07:26 +00:00
LICENSE chore: readme and tailt changes 2022-11-03 07:59:02 +00:00
Makefile feat: github repo setup 2022-11-02 14:21:13 +00:00
README.md Fix repo link in readme 2022-11-24 16:26:27 +01:00
go.mod prepare for rebase on main 2023-01-11 15:50:38 +00:00
go.sum chore(deps): Bump github.com/onsi/gomega from 1.24.1 to 1.24.2 2023-01-10 14:11:33 +00:00
metadata.yaml chore: scaffolding of the provider 2022-11-02 10:07:26 +00:00
tilt-provider.json Fixing 1 node initialization 2023-01-11 15:50:39 +00:00

README.md

Cluster API Provider RKE2

GitHub


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.

  1. 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

  1. Fork the Cluster API Provider RKE2 repo
  2. Clone your new repo into the GOPATH (i.e. ~/go/src/github.com/myname/cluster-api-provider-rke2)
  3. Ensure Tilt and kind are installed
  4. Create a tilt-settings.json file in the root of your forked/cloned cluster-api directory.
  5. 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.

  1. Open another terminal (or pane) and go to the cluster-api directory.
  2. 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

  1. Run the following command to create a local kind cluster:
kind create cluster --config kind-cluster-with-extramounts.yaml
  1. Now start tilt by running the following:
tilt up
  1. Press the space key to see the Tilt web ui and check that everything goes green.