From 9ca8565b28742f65307ad4b55076b783689ae8ff Mon Sep 17 00:00:00 2001 From: Kishen V Date: Fri, 17 Nov 2023 20:12:51 +0530 Subject: [PATCH] Add documentation for VPC clusterclass --- docs/book/src/SUMMARY.md | 1 + docs/book/src/getting-started.md | 9 +++++++- .../src/topics/vpc/clusterclass-cluster.md | 23 +++++++++++++++++++ docs/book/src/topics/vpc/index.md | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 docs/book/src/topics/vpc/clusterclass-cluster.md diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index fb3696ecbc..f7400e0a2b 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -11,6 +11,7 @@ - [Uploading an image](topics/vpc/uploading-an-image.md) - [Creating a cluster](./topics/vpc/creating-a-cluster.md) - [Creating a cluster with Load Balancer and External Cloud Provider](./topics/vpc/load-balancer.md) + - [Creating a cluster from ClusterClass](./topics/vpc/clusterclass-cluster.md) - [PowerVS Cluster](./topics/powervs/index.md) - [Prerequisites](./topics/powervs/prerequisites.md) - [Creating a cluster](./topics/powervs/creating-a-cluster.md) diff --git a/docs/book/src/getting-started.md b/docs/book/src/getting-started.md index d8292e56c3..706ac1503b 100644 --- a/docs/book/src/getting-started.md +++ b/docs/book/src/getting-started.md @@ -106,7 +106,7 @@ it into a management cluster using `clusterctl`. ``` > Note: `EXP_CLUSTER_RESOURCE_SET` should be set for deploying workload cluster with Cloud Controller manager. -### Deploy PowerVS cluster with ClusterClass template +### Deploy PowerVS cluster or VPC cluster with ClusterClass template To deploy workload cluster with [PowerVS clusterclass-template](/topics/powervs/clusterclass-cluster.html). Set the following environmental variables. @@ -116,4 +116,11 @@ it into a management cluster using `clusterctl`. export CLUSTER_TOPOLOGY=true ``` + Similarly, to deploy workload cluster with [VPC clusterclass-template](/topics/VPC/clusterclass-cluster.html). Set the following environmental variables. + + ```console + export PROVIDER_ID_FORMAT=v2 + export CLUSTER_TOPOLOGY=true + ``` + > Note: Currently, both [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/index.html) and [ClusterResourceset](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-resource-set.html) are experimental feature so we need to enable the feature gate by setting `EXP_CLUSTER_RESOURCE_SET`, `CLUSTER_TOPOLOGY` environmental variables. \ No newline at end of file diff --git a/docs/book/src/topics/vpc/clusterclass-cluster.md b/docs/book/src/topics/vpc/clusterclass-cluster.md new file mode 100644 index 0000000000..194e671503 --- /dev/null +++ b/docs/book/src/topics/vpc/clusterclass-cluster.md @@ -0,0 +1,23 @@ +# Create IBM VPC Cluster Using ClusterClass + +## Preface +- To deploy IBM Cloud VPC workload cluster using [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/index.html), create a cluster configuration from the [clusterclass-template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-vpc-clusterclass.yaml). +- The [clusterclass-template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-vpc-clusterclass.yaml) will use [clusterresourceset](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-resource-set.html) and will create the necessary config map, secret and roles to run the cloud controller manager +- The flags EXP_CLUSTER_RESOURCE_SET and CLUSTER_TOPOLOGY need to be set to true. + +A comprehensive list of IBM Cloud VPC Regions and Zones can be found [here](/reference/regions-zones-mapping.html) + +## Deploy a cluster using IBM Cloud VPC infrastructure using ClusterClass +```shell +IBMVPC_CLUSTER_CLASS_NAME=ibmvpc-clusteclass \ +IBMVPC_REGION= \ +IBMVPC_ZONE= \ +IBMVPC_RESOURCEGROUP= \ +IBMVPC_NAME= \ +IBMVPC_IMAGE_NAME=capibm-vpc-ubuntu-2004-kube-v1-26-2 \ +IBMVPC_PROFILE=bx2-4x16 \ +IBMVPC_SSHKEY_NAME= \ +BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ +IBMACCOUNT_ID= \ +clusterctl generate cluster ibm-mix-clusterclass --kubernetes-version v1.26.2 --target-namespace default --control-plane-machine-count=1 --worker-machine-count=2 --from=./templates/cluster-template-vpc-clusterclass.yaml | kubectl apply -f - +``` diff --git a/docs/book/src/topics/vpc/index.md b/docs/book/src/topics/vpc/index.md index d8a0123a59..fa5e65cd6c 100644 --- a/docs/book/src/topics/vpc/index.md +++ b/docs/book/src/topics/vpc/index.md @@ -4,3 +4,4 @@ - [Prerequisites](/topics/vpc/prerequisites.html) - [Uploading an image](/topics/vpc/uploading-an-image.html) - [Creating a cluster](/topics/vpc/creating-a-cluster.html) +- [Creating a cluster from ClusterClass](/topics/vpc/clusterclass-cluster.md)