From 78a4abafe8299fa9f792fec918782200c9d28f7c Mon Sep 17 00:00:00 2001 From: Karthik K N Date: Tue, 22 Nov 2022 17:50:52 +0530 Subject: [PATCH] Added documentaion for usage of ClusterClass to create Power VS cluster --- docs/book/src/SUMMARY.md | 1 + docs/book/src/developer/tilt.md | 25 ++++++++++++++++- docs/book/src/getting-started.md | 9 +++++- .../topics/powervs/clusterclass-cluster.md | 28 +++++++++++++++++++ docs/book/src/topics/powervs/index.md | 1 + 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 docs/book/src/topics/powervs/clusterclass-cluster.md diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 94ec584503..4e0010d6dd 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -15,6 +15,7 @@ - [Prerequisites](./topics/powervs/prerequisites.md) - [Creating a cluster](./topics/powervs/creating-a-cluster.md) - [Creating a cluster with External Cloud Provider](./topics/powervs/external-cloud-provider.md) + - [Creating a cluster from ClusterClass](./topics/powervs/clusterclass-cluster.md) - [Using autoscaler with scaling from 0 machine](./topics/powervs/autoscaler-scalling-from-0.md) - [Developer Guide](./developer/index.md) - [Rapid iterative development with Tilt](./developer/tilt.md) diff --git a/docs/book/src/developer/tilt.md b/docs/book/src/developer/tilt.md index 7c145c706e..bb4ec48c5b 100644 --- a/docs/book/src/developer/tilt.md +++ b/docs/book/src/developer/tilt.md @@ -55,8 +55,27 @@ extra_args: - '-v=5' ``` -To deploy workload cluster with [Power VS cloud controller manager](/topics/powervs/external-cloud-provider.html) which is currently in experimental stage, Set `POWERVS_PROVIDER_ID_FORMAT` to `v2` under kustomize_substitutions. +### 1. Configuration to deploy workload cluster with external cloud controller manager +To deploy workload cluster with [Power VS cloud controller manager](/topics/powervs/external-cloud-provider.html) which is currently in experimental stage, Set `POWERVS_PROVIDER_ID_FORMAT` to `v2` and enable cluster resourceset feature gateunder kustomize_substitutions. + +```yaml +default_registry: "gcr.io/you-project-name-here" +provider_repos: +- ../cluster-api-provider-ibmcloud +enable_providers: +- ibmcloud +- kubeadm-bootstrap +- kubeadm-control-plane +kustomize_substitutions: + IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX" + POWERVS_PROVIDER_ID_FORMAT: "v2" + EXP_CLUSTER_RESOURCE_SET: "true" +``` + +### 2. Configuration to deploy workload cluster from ClusterClass template + +To deploy workload cluster with [clusterclass-template](/topics/powervs/clusterclass-cluster.html) under kustomize_substitutions set `POWERVS_PROVIDER_ID_FORMAT` to `v2` and enable both cluster resourceset and cluster topology feature gate. ```yaml default_registry: "gcr.io/you-project-name-here" provider_repos: @@ -68,8 +87,12 @@ enable_providers: kustomize_substitutions: IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX" POWERVS_PROVIDER_ID_FORMAT: "v2" + EXP_CLUSTER_RESOURCE_SET: "true" + CLUSTER_TOPOLOGY: "true" ``` +### 3. Configuration to deploy workload cluster with Custom Service Endpoint + To deploy workload cluster with Custom Service Endpoint, Set `SERVICE_ENDPOINT` environmental variable in semi-colon separated format: `${ServiceRegion}:${ServiceID1}=${URL1},${ServiceID2}=${URL2...}` ```yaml default_registry: "gcr.io/you-project-name-here" diff --git a/docs/book/src/getting-started.md b/docs/book/src/getting-started.md index 350e53e9d1..9c7dee5926 100644 --- a/docs/book/src/getting-started.md +++ b/docs/book/src/getting-started.md @@ -48,9 +48,16 @@ it into a management cluster using `clusterctl`. > Note: Refer [Regions-Zones Mapping](/reference/regions-zones-mapping.html) for more information. - > Note: To deploy workload cluster with [Power VS cloud controller manager](/topics/powervs/external-cloud-provider.html) which is currently in experimental stage. Set the `POWERVS_PROVIDER_ID_FORMAT` environmental variable + > Note: To deploy workload cluster with [Power VS cloud controller manager](/topics/powervs/external-cloud-provider.html) which is currently in experimental stage. Set the `POWERVS_PROVIDER_ID_FORMAT` environmental variable and enable cluster resourceset feature gate. ```console export POWERVS_PROVIDER_ID_FORMAT=v2 + export EXP_CLUSTER_RESOURCE_SET=true + ``` + > Note: To deploy workload cluster with [Power VS clusterclass-template](/topics/powervs/clusterclass-cluster.html). Set the `POWERVS_PROVIDER_ID_FORMAT` environmental variable and enable both cluster resourceset and cluster topology feature gate. + ```console + export POWERVS_PROVIDER_ID_FORMAT=v2 + export EXP_CLUSTER_RESOURCE_SET=true + export CLUSTER_TOPOLOGY=true ``` > Note: To deploy workload cluster with Custom Service Endpoint, Set `SERVICE_ENDPOINT` environmental variable in semi-colon separated format: diff --git a/docs/book/src/topics/powervs/clusterclass-cluster.md b/docs/book/src/topics/powervs/clusterclass-cluster.md new file mode 100644 index 0000000000..20665ec0f0 --- /dev/null +++ b/docs/book/src/topics/powervs/clusterclass-cluster.md @@ -0,0 +1,28 @@ +# Create IBM Power VS Cluster Using ClusterClass +## Steps + +- To deploy Power VS 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-simple-powervs-clusterclass.yaml) +- The Power VS cluster will use [external cloud provider](https://kubernetes.io/docs/concepts/architecture/cloud-controller/). As a prerequisite set the `powervs-provider-id-fmt` [flag](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/64c9e1d17f1733c721f45a559edba3f4b712bcb0/main.go#L220) with value v2 +- The [clusterclass-template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-simple-powervs-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 + +### Deploy Power VS cluster with IBM Power VS cloud provider + + ``` + CLUSTER_CLASS_NAME="powervs-cc" \ + IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ + IBMPOWERVS_VIP="192.168.151.22" \ + IBMPOWERVS_VIP_EXTERNAL="158.175.162.22" \ + IBMPOWERVS_VIP_CIDR="29" \ + IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-8-1-22-4" \ + IBMPOWERVS_SERVICE_INSTANCE_ID="7845d372-d4e1-46b8-91fc-41051c984601" \ + IBMPOWERVS_NETWORK_NAME="capi-test-3" \ + IBMACCOUNT_ID="ibm-accountid" \ + IBMPOWERVS_REGION="powervs-region" \ + IBMPOWERVS_ZONE="powervs-zone" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ + clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.22.4 \ + --target-namespace default \ + --control-plane-machine-count=3 \ + --worker-machine-count=1 \ + --flavor=simple-powervs-clusterclass | kubectl apply -f - + ``` \ No newline at end of file diff --git a/docs/book/src/topics/powervs/index.md b/docs/book/src/topics/powervs/index.md index d0b1299c2e..5f03dfa490 100644 --- a/docs/book/src/topics/powervs/index.md +++ b/docs/book/src/topics/powervs/index.md @@ -4,4 +4,5 @@ - [Prerequisites](/topics/powervs/prerequisites.html) - [Creating a cluster](/topics/powervs/creating-a-cluster.html) - [Creating a cluster with external cloud provider](/topics/powervs/external-cloud-provider.html) +- [Creating a cluster from ClusterClass](/topics/powervs/clusterclass-cluster.html) - [Using autoscaler with scaling from 0 machine](/topics/powervs/autoscaler-scalling-from-0.html) \ No newline at end of file