|
| 1 | +# Kamaji Control Plane Provider |
| 2 | + |
| 3 | +Kamaji can act as a Cluster API Control Plane provider via usage of the `KamajiControlPlane`, custom resource that defines the control plane of a Tenant Cluster. |
| 4 | + |
| 5 | +Here an example of a `KamajiControlPlane`: |
| 6 | + |
| 7 | +```yaml |
| 8 | +kind: KamajiControlPlane |
| 9 | +apiVersion: controlplane.cluster.x-k8s.io/v1alpha1 |
| 10 | +metadata: |
| 11 | + name: '${CLUSTER_NAME}' |
| 12 | + namespace: '${CLUSTER_NAMESPACE}' |
| 13 | +spec: |
| 14 | + apiServer: |
| 15 | + extraArgs: |
| 16 | + - --cloud-provider=external |
| 17 | + controllerManager: |
| 18 | + extraArgs: |
| 19 | + - --cloud-provider=external |
| 20 | + dataStoreName: default |
| 21 | + addons: |
| 22 | + coreDNS: {} |
| 23 | + kubeProxy: {} |
| 24 | + konnectivity: {} |
| 25 | + kubelet: |
| 26 | + cgroupfs: systemd |
| 27 | + preferredAddressTypes: |
| 28 | + - InternalIP |
| 29 | + - ExternalIP |
| 30 | + - Hostname |
| 31 | + network: |
| 32 | + serviceAddress: '${CONTROL_PLANE_ENDPOINT_IP}' |
| 33 | + serviceType: LoadBalancer |
| 34 | + version: ${KUBERNETES_VERSION} |
| 35 | +``` |
| 36 | +
|
| 37 | +You can use it as reference in a standard `Cluster` custom resource as controlplane provider: |
| 38 | + |
| 39 | +```yaml |
| 40 | +kind: Cluster |
| 41 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 42 | +metadata: |
| 43 | + labels: |
| 44 | + cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}' |
| 45 | + name: '${CLUSTER_NAME}' |
| 46 | + namespace: '${CLUSTER_NAMESPACE}' |
| 47 | +spec: |
| 48 | + controlPlaneRef: |
| 49 | + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 50 | + kind: KamajiControlPlane |
| 51 | + name: '${CLUSTER_NAME}' |
| 52 | + clusterNetwork: |
| 53 | + pods: |
| 54 | + cidrBlocks: |
| 55 | + - '${PODS_CIDR}' |
| 56 | + services: |
| 57 | + cidrBlocks: |
| 58 | + - '${SERVICES_CIDR}' |
| 59 | + infrastructureRef: |
| 60 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 61 | + kind: ... # your infrastructure kind may vary |
| 62 | + name: '${CLUSTER_NAME}' |
| 63 | +``` |
| 64 | + |
| 65 | +!!! info "Full Reference" |
| 66 | + For a full reference of the `KamajiControlPlane` custom resource, please see the [Reference APIs](reference/api.md). |
| 67 | + |
| 68 | +## Getting started with the Kamaji Control Plane Provider |
| 69 | + |
| 70 | +Cluster API Provider Kamaji is compliant with the `clusterctl` contract, which means you can use it with the `clusterctl` CLI to create and manage your Kamaji-based clusters. |
| 71 | + |
| 72 | +!!! info "Options for install Cluster API" |
| 73 | + There are two ways to getting started with Cluster API: |
| 74 | + * using `clusterctl` to install the Cluster API components as stated in this guide |
| 75 | + * using the Cluster API Operator. Please refer to the [Cluster API Operator](https://cluster-api-operator.sigs.k8s.io/) guide for this option. |
| 76 | + |
| 77 | +### Prerequisites |
| 78 | + |
| 79 | +* [`clusterctl`](https://cluster-api.sigs.k8s.io/user/quick-start#install-clusterctl) installed in your workstation to handle the lifecycle of your Kamaji-based clusters. |
| 80 | +* [`kubectl`](https://kubernetes.io/docs/tasks/tools/) installed in your workstation to interact with your Kamaji-based clusters. |
| 81 | +* [Kamaji](../getting-started/getting-started.md) installed in your Management Cluster. |
| 82 | + |
| 83 | +### Initialize the Management Cluster |
| 84 | + |
| 85 | +Using `clusterctl` to initialize the Management Cluster. When executed for the first time, `clusterctl init` will fetch and install the Cluster API components in the Management Cluster |
| 86 | + |
| 87 | +```bash |
| 88 | +clusterctl init --control-plane kamaji |
| 89 | +``` |
| 90 | + |
| 91 | +As result, `clusterctl` the following Cluster API components will be installed: |
| 92 | + |
| 93 | +* Cluster API Provider in `capi-system` namespace |
| 94 | +* Bootstrap Provider in `capi-kubeadm-bootstrap-system` namespace |
| 95 | +* Kamaji Control Plane Provider in `kamaji-system` namespace |
| 96 | + |
| 97 | +We're still missing the infrastructure provider of choice, which is required to create a Kamaji-based cluster. And this is the next step. |
| 98 | + |
0 commit comments