Skip to content

Commit b6ed0bc

Browse files
authored
Merge pull request #66 from alexander-demicev/docs
📖 Add getting started docs
2 parents faf6a1b + b50bb50 commit b6ed0bc

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

docs/getting-started.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Getting started
2+
3+
This document contains instructions on how to start with Cluster API operator.
4+
5+
## Prerequisites
6+
7+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) for interacting with the cluster.
8+
- [Kind](https://kind.sigs.k8s.io/#installation-and-usage) for creating a local cluster.
9+
10+
## Installation
11+
12+
Create a cluster using kind:
13+
14+
```bash
15+
kind create cluster
16+
```
17+
18+
Cluster API Operator doesn't manage cert-manager installations, you have to install it manually:
19+
20+
```bash
21+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
22+
```
23+
24+
Wait for the cert-manager to be ready.
25+
26+
Install the Cluster API operator:
27+
28+
```bash
29+
kubectl apply -f https://github.com/kubernetes-sigs/cluster-api-operator/releases/latest/download/operator-components.yaml
30+
```
31+
32+
***Note***: :warning: Take a look at RBAC permissions and adjust them, the operator will be creating and updating CRDs.
33+
We are still working on figuring out the best way to handle this.
34+
35+
## Usage
36+
37+
There are 4 types of objects that are managed by the Cluster API operator:
38+
39+
- CoreProvider
40+
- BootstrapProvider
41+
- ControlPlaneProvider
42+
- InfrastructureProvider
43+
44+
First, CoreProvider has to be installed. CoreProvider is responsible for managing the Cluster API CRDs and the Cluster API controller.
45+
46+
Example:
47+
```yaml
48+
apiVersion: operator.cluster.x-k8s.io/v1alpha1
49+
kind: CoreProvider
50+
metadata:
51+
name: cluster-api
52+
namespace: capi-system
53+
spec:
54+
version: v1.3.2
55+
```
56+
57+
**Note**: Only one CoreProvider can be installed at the same time on one cluster. Any namespace can be used for the CoreProvider.
58+
59+
Next, BootstrapProvider, ControlPlaneProvider and InfrastructureProvider can be installed. They are responsible for managing the CRDs and the controllers for the corresponding provider.
60+
61+
If provider requires variables to be set, a secret containing them has to be created and it has to be in the same namespace as the provider.
62+
63+
It's also recommended to include github-token in the secret. This token is used to fetch the provider repository and it is required for the provider to be installed.
64+
Operator might exceed the rate limit of the github API without the token.
65+
66+
Example:
67+
```yaml
68+
---
69+
apiVersion: v1
70+
kind: Secret
71+
metadata:
72+
name: azure-variables
73+
namespace: capz-system
74+
type: Opaque
75+
stringData:
76+
AZURE_CLIENT_ID_B64: Zm9vCg==
77+
AZURE_CLIENT_SECRET_B64: Zm9vCg==
78+
AZURE_SUBSCRIPTION_ID_B64: Zm9vCg==
79+
AZURE_TENANT_ID_B64: Zm9vCg==
80+
github-token: ghp_fff
81+
---
82+
apiVersion: management.cluster.x-k8s.io/v1alpha1
83+
kind: InfrastructureProvider
84+
metadata:
85+
name: azure
86+
namespace: capz-system
87+
spec:
88+
version: v1.7.2
89+
secretName: azure-variables
90+
```
91+
## Upgrading providers
92+
93+
To upgrade a provider, modify the `spec.Version` field of the provider object.
94+
95+
## Air gapped environment
96+
97+
In order to install Cluster API providers in an air-gapped environment the following steps are supported:
98+
99+
- If you need to provide image overrides for any provider modify `provider.Spec.Deployment.Containers[].Image`.
100+
- For reading provider components from an accessible location (e.g. an internal github repository) modify `provider.Spec.FetchConfig.Url`, or `provider.Spec.FetchConfig.Selector` for using a ConfigMap. The ConfigMap is expected to contain components and metadata for a specific version only.
101+
The name of the ConfigMap should be set to the provider version or to override this add a label like the following: `provider.cluster.x-k8s.io/version=v1.4.3`
102+

0 commit comments

Comments
 (0)