You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,14 +166,26 @@ path that it ran (i.e. `out/kubeconfig`). This is the **admin** kubeconfig file
166
166
going forward to spin up multiple clusters using Cluster API, however, it is recommended that you create dedicated roles
167
167
with limited access before doing so.
168
168
169
+
Note that from this point forward, you no longer need to use `clusterctl` to provision clusters since your management cluster
170
+
(the cluster used to manage workload clusters) has been created. Workload clusters should be provisioned by applying Cluster API resources
171
+
directly on the management cluster using `kubectl`. More on this below.
172
+
169
173
## Managing Workload Clusters using the Management Cluster
170
174
171
175
With your management cluster bootstrapped, it's time to reap the benefits of Cluster API. From this point forward,
172
176
clusters and machines (belonging to a cluster) are simply provisioned by creating `cluster`, `machine` and `machineset` resources.
173
177
174
-
Taking the generated `out/cluster.yaml` and `out/machine.yaml` file from earlier as a reference, you can create a cluster with the
175
-
initial control plane node by just editing the name of the cluster and machine resource. For example, the following cluster and
176
-
machine resource will provision a cluster named "prod-workload" with 1 initial control plane node:
178
+
Using the same `prod-yaml` make target, generate Cluster API resources for a new cluster, this time with a different name:
179
+
```
180
+
$ CLUSTER_NAME=prod-workload make prod-yaml
181
+
```
182
+
183
+
**NOTE**: The `make prod-yaml` target is not required to manage your Cluster API resources at this point but is used to simplify this guide.
184
+
You should manage your Cluster API resources in the same way you would manage your application yaml files for Kubernetes. Use the
185
+
generated yaml files from `make prod-yaml` as a reference.
186
+
187
+
The Cluster and Machine resource in `out/prod-workload/cluster.yaml` and `out/prod-workload/machines.yaml` defines your workload
188
+
cluster with the initial control plane.
177
189
178
190
```yaml
179
191
---
@@ -227,7 +239,7 @@ spec:
227
239
controlPlane: "1.13.6"
228
240
```
229
241
230
-
To add 3 additional worker nodes to your cluster, create a machineset like the following:
242
+
To add 3 additional worker nodes to your cluster, see the generated machineset file `out/prod-workload/machineset.yaml`:
231
243
232
244
```yaml
233
245
apiVersion: "cluster.k8s.io/v1alpha1"
@@ -269,7 +281,17 @@ spec:
269
281
controlPlane: "1.13.6"
270
282
```
271
283
272
-
Run `kubectl apply -f` to apply the above files on your management cluster and it should start provisioning the new cluster.
284
+
Run `kubectl apply -f` to apply the above files on your management cluster and it should start provisioning the new cluster:
285
+
```bash
286
+
$ cd out/prod-workload
287
+
$ kubectl apply -f cluster.yaml
288
+
cluster.cluster.k8s.io/prod-workload created
289
+
$ kubectl apply -f machines.yaml
290
+
machine.cluster.k8s.io/prod-workload-controlplane-1 created
291
+
$ kubectl apply -f machineset.yaml
292
+
machineset.cluster.k8s.io/prod-workload-machineset-1 created
293
+
```
294
+
273
295
Clusters that are provisioned by the management cluster that run your application workloads are called [Workload Clusters](https://github.com/kubernetes-sigs/cluster-api/blob/master/docs/book/GLOSSARY.md#workload-cluster).
274
296
275
297
The `kubeconfig` file to access workload clusters should be accessible as a Kubernetes Secret on the management cluster. As of today, the
@@ -286,3 +308,7 @@ $ kubectl get secret prod-workload-kubeconfig -o=jsonpath='{.data.value}' | base
286
308
```
287
309
288
310
Now that you have the `kubeconfig` for your Workload Cluster, you can start deploying your applications there.
311
+
312
+
**NOTE**: workload clusters do not have any addons applied aside from those added by kubeadm. Nodes in your workload clusters
313
+
will be in the `NotReady` state until you apply a CNI addon. The `addons.yaml` file generated from `make prod-yaml` has a default calico
314
+
addon which you can use, otherwise apply custom addons based on your use-case.
0 commit comments