diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 899ccc543..1522796be 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -10,14 +10,9 @@ - [Prerequisites](./topics/vpc/prerequisites.md) - [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) - - [Creating a cluster with External Cloud Provider](./topics/powervs/external-cloud-provider.md) - - [Creating a cluster from ClusterClass](./topics/powervs/clusterclass-cluster.md) - - [Creating a cluster by auto creating required resources](./topics/powervs/create-resources.md) - [Using autoscaler with scaling from 0 machine](./topics/powervs/autoscaler-scalling-from-0.md) - [capibmadm CLI](./topics/capibmadm/index.md) - [PowerVS Commands](./topics/capibmadm/powervs/index.md) diff --git a/docs/book/src/developer/tilt.md b/docs/book/src/developer/tilt.md index 68323811c..500a08517 100644 --- a/docs/book/src/developer/tilt.md +++ b/docs/book/src/developer/tilt.md @@ -55,7 +55,8 @@ podman machine start ## Create a kind cluster -First, make sure you have a kind cluster and that your `KUBECONFIG` is set up correctly: +First, make sure you have a kind cluster and that your `KUBECONFIG` is set up correctly. +> **Note:** Execute the following from the `cluster-api-provider-ibmcloud` respository. ``` bash make kind-cluster @@ -97,11 +98,9 @@ extra_args: > **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 features. -### 1. Configuration to deploy PowerVS workload cluster with external cloud controller manager +### 1. Configuration to deploy workload cluster with external cloud controller manager -To deploy workload cluster with [PowerVS cloud controller manager](/topics/powervs/external-cloud-provider.html)(experimental) or to deploy workload cluster with [cloud controller manager](/topics/vpc/load-balancer.html)(experimental), set `PROVIDER_ID_FORMAT` to `v2` and enable cluster resourceset feature gate under kustomize_substitutions. - -This requires setting the feature gate `EXP_CLUSTER_RESOURCE_SET` to `true` under kustomize_substitutions. +To deploy workload cluster with cloud controller manager, set `PROVIDER_ID_FORMAT` to `v2` and enable cluster resourceset feature gate by setting `EXP_CLUSTER_RESOURCE_SET` to `true under kustomize_substitutions. ```yaml default_registry: "gcr.io/you-project-name-here" @@ -119,9 +118,7 @@ kustomize_substitutions: ### 2. Configuration to deploy workload cluster from ClusterClass template -To deploy workload cluster with [clusterclass-template](/topics/powervs/clusterclass-cluster.html), set the `PROVIDER_ID_FORMAT` to `v2` under kustomize_substitutions. - -This requires setting the feature gates `EXP_CLUSTER_RESOURCE_SET` and `CLUSTER_TOPOLOGY` to `true` under kustomize_substitutions. +To deploy workload cluster with [clusterclass-template](/topics/powervs/clusterclass-cluster.html), set the `PROVIDER_ID_FORMAT` to `v2` and enable the feature gates `EXP_CLUSTER_RESOURCE_SET` and `CLUSTER_TOPOLOGY` to `true`under kustomize_substitutions. ```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 a1f7e6069..708eb9f6f 100644 --- a/docs/book/src/getting-started.md +++ b/docs/book/src/getting-started.md @@ -87,29 +87,3 @@ it into a management cluster using `clusterctl`. ``` 6. Once the management cluster is ready with the required providers up and running, proceed to provisioning the workload cluster. Check the respective sections for [VPC](/topics/vpc/creating-a-cluster.html) and [PowerVS](/topics/powervs/creating-a-cluster.html) to deploy the cluster. - -7. For deploying with your workload cluster with Cloud Controller manager or Cluster Class template, refer to [deploy with cloud controller manager](#deploy-with-cloud-controller-manager) and [deploy PowerVS cluster with cluster class template](#deploy-powervs-cluster-with-clusterclass-template) sections respectively. - - -### Deploy with Cloud Controller manager - - To deploy VPC workload cluster with [IBM cloud controller manager](/topics/vpc/load-balancer.html), or with [PowerVS cloud controller manager](/topics/powervs/external-cloud-provider.html), set the `PROVIDER_ID_FORMAT` environmental variable to `v2`. - - ```console - export PROVIDER_ID_FORMAT=v2 - export EXP_CLUSTER_RESOURCE_SET=true - ``` - - > Note: `EXP_CLUSTER_RESOURCE_SET` should be set for deploying workload cluster with Cloud Controller manager. - -### Deploy PowerVS cluster or VPC cluster with ClusterClass template - - To deploy workload cluster with [PowerVS clusterclass-template](/topics/powervs/clusterclass-cluster.html) or [VPC clusterclass-template](/topics/VPC/clusterclass-cluster.html). Set the following environmental variables. - - ```console - export PROVIDER_ID_FORMAT=v2 - export EXP_CLUSTER_RESOURCE_SET=true - 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/powervs/autoscaler-scalling-from-0.md b/docs/book/src/topics/powervs/autoscaler-scalling-from-0.md index 7b4405c80..a68e795a8 100644 --- a/docs/book/src/topics/powervs/autoscaler-scalling-from-0.md +++ b/docs/book/src/topics/powervs/autoscaler-scalling-from-0.md @@ -45,8 +45,8 @@ go build . ``` Note: -1. autoscaler can be run in different ways the possible ways are described [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#connecting-cluster-autoscaler-to-cluster-api-management-and-workload-clusters). -2. autoscaler supports various command line flags and more details about it can be found [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca). +1. Autoscaler can be run in different ways, the possible ways are described [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#connecting-cluster-autoscaler-to-cluster-api-management-and-workload-clusters). +2. Autoscaler supports various command line flags and more details about it can be found [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca). ## Use case of cluster-autoscaler @@ -97,17 +97,17 @@ busybox-deployment-7c87788568-t26bb 0/1 Pending 0 5s 5. On the management cluster verify that the new machine creation is being triggered by autoscaler ``` NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION -karthik-ibm-powervs-control-plane-smvf7 karthik-ibm-powervs karthik-ibm-powervs-control-plane-pgwmz ibmpowervs://osa/osa21/3229a-af54-4212-bf60-6202b6fd0a07/809cd0f2-7502-4112-bf44-84d178020d8a Running 82m v1.24.2 -karthik-ibm-powervs-md-0-6b4d67ccf4-npdbm karthik-ibm-powervs karthik-ibm-powervs-md-0-qch8f ibmpowervs://osa/osa21/3229a-af54-4212-bf60-6202b6fd0a07/50f841e5-f58c-4569-894d-b40ba0d2696e Running 76m v1.24.2 -karthik-ibm-powervs-md-0-6b4d67ccf4-v7xv9 karthik-ibm-powervs Provisioning 3m19s v1.24.2 +ibm-powervs-control-plane-smvf7 ibm-powervs ibm-powervs-control-plane-pgwmz ibmpowervs://osa/osa21/3229a-af54-4212-bf60-6202b6fd0a07/809cd0f2-7502-4112-bf44-84d178020d8a Running 82m v1.24.2 +ibm-powervs-md-0-6b4d67ccf4-npdbm ibm-powervs ibm-powervs-md-0-qch8f ibmpowervs://osa/osa21/3229a-af54-4212-bf60-6202b6fd0a07/50f841e5-f58c-4569-894d-b40ba0d2696e Running 76m v1.24.2 +ibm-powervs-md-0-6b4d67ccf4-v7xv9 ibm-powervs Provisioning 3m19s v1.24.2 ``` 6. After sometime verify that the new node being added to the cluster and pod is in running state ``` kubectl get nodes NAME STATUS ROLES AGE VERSION -karthik-ibm-powervs-control-plane-pgwmz Ready control-plane 92m v1.24.2 -karthik-ibm-powervs-md-0-n8c6d Ready 42s v1.24.2 -karthik-ibm-powervs-md-0-qch8f Ready 85m v1.24.2 +ibm-powervs-control-plane-pgwmz Ready control-plane 92m v1.24.2 +ibm-powervs-md-0-n8c6d Ready 42s v1.24.2 +ibm-powervs-md-0-qch8f Ready 85m v1.24.2 kubectl get pods NAME READY STATUS RESTARTS AGE @@ -120,7 +120,7 @@ kubectl delete deployment/busybox-deployment kubectl get nodes NAME STATUS ROLES AGE VERSION -karthik-ibm-powervs-control-plane-pgwmz Ready control-plane 105m v1.24.2 -karthik-ibm-powervs-md-0-qch8f Ready 98m v1.24.2 +ibm-powervs-control-plane-pgwmz Ready control-plane 105m v1.24.2 +ibm-powervs-md-0-qch8f Ready 98m v1.24.2 ``` diff --git a/docs/book/src/topics/powervs/clusterclass-cluster.md b/docs/book/src/topics/powervs/clusterclass-cluster.md deleted file mode 100644 index 5459c455b..000000000 --- a/docs/book/src/topics/powervs/clusterclass-cluster.md +++ /dev/null @@ -1,28 +0,0 @@ -# Create IBM PowerVS Cluster Using ClusterClass -## Steps - -- To deploy PowerVS 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 PowerVS cluster will use [external cloud provider](https://kubernetes.io/docs/concepts/architecture/cloud-controller/). -- 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 PowerVS cluster with IBM PowerVS cloud provider - - ``` - IBMPOWERVS_CLUSTER_CLASS_NAME="powervs-cc" \ - IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ - IBMPOWERVS_VIP="192.168.167.6" \ - IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \ - IBMPOWERVS_VIP_CIDR="29" \ - IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \ - IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \ - IBMPOWERVS_NETWORK_NAME="capi-test" \ - IBMACCOUNT_ID="ibm-accountid" \ - IBMPOWERVS_REGION="osa" \ - IBMPOWERVS_ZONE="osa21" \ - BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ - clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \ - --target-namespace default \ - --control-plane-machine-count=3 \ - --worker-machine-count=1 \ - --flavor=powervs-clusterclass | kubectl apply -f - - ``` \ No newline at end of file diff --git a/docs/book/src/topics/powervs/create-resources.md b/docs/book/src/topics/powervs/create-resources.md deleted file mode 100644 index e99799b85..000000000 --- a/docs/book/src/topics/powervs/create-resources.md +++ /dev/null @@ -1,28 +0,0 @@ -# Create required resources for IBM PowerVS cluster - -## Steps - -- To deploy cluster which creates required resources, set ```powervs.cluster.x-k8s.io/create-infra:true``` annotation to IBMPowerVSCluster resource. -- The cluster will be configured with IBM PowerVS external [cloud provider](https://kubernetes.io/docs/concepts/architecture/cloud-controller/) -- The [create_infra template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-powervs-create-infra.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 PowerVS cluster with IBM PowerVS cloud provider - - ``` -IBMCLOUD_API_KEY=> \ -IBMPOWERVS_SSHKEY_NAME="karthik-ssh" \ -COS_BUCKET_REGION="us-south" \ -COS_BUCKET_NAME="power-oss-bucket" \ -COS_OBJECT_NAME=capibm-powervs-centos-streams8-1-28-4-1707287079.ova.gz \ -IBMACCOUNT_ID="" \ -IBMPOWERVS_REGION="wdc" \ -IBMPOWERVS_ZONE="wdc06" \ -IBMVPC_REGION="us-east" \ -IBM_RESOURCE_GROUP="ibm-hypershift-dev" \ -BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ -clusterctl generate cluster capi-powervs- --kubernetes-version v1.28.4 \ ---target-namespace default \ ---control-plane-machine-count=3 \ ---worker-machine-count=1 \ ---from ./cluster-template-powervs-create-infra.yaml | kubectl apply -f - - ``` diff --git a/docs/book/src/topics/powervs/creating-a-cluster.md b/docs/book/src/topics/powervs/creating-a-cluster.md index 17148cdbb..2148133d0 100644 --- a/docs/book/src/topics/powervs/creating-a-cluster.md +++ b/docs/book/src/topics/powervs/creating-a-cluster.md @@ -1,5 +1,12 @@ ### Provision workload cluster in IBM Cloud PowerVS +> **Note:** +> A PowerVS cluster can be deployed with different customisations. Pick one of the following templates as per your need and fulfill the [prerequisites](prerequisites.md) before proceeding with cluster creation. +> - [PowerVS cluster with user provided resources](#deploy-a-powervs-cluster-with-user-provided-resources) +> - [PowerVS cluster with infrastructure creation](#deploy-a-powervs-cluster-with-infrastructure-creation) +> - [PowerVS cluster with external cloud provider](#deploy-a-powervs-cluster-with-external-cloud-provider) +> - [PowerVS cluster with cluster class](#deploy-a-powervs-cluster-with-cluster-class) + Now that we have a management cluster ready, you can create your workload cluster by following the steps below. @@ -29,11 +36,11 @@ following the steps below. capi-test-port 163.68.65.6 192.168.167.6 fa:16:3e:89:c8:80 c7e7b6e0-0b0d-4a11-a90b-6ea293deb5ac DOWN ``` -2. Use clusterctl to render the yaml through templates and deploy the cluster - - **Note:** To deploy workload cluster with PowerVS cloud controller manager which is currently in experimental stage follow [these](/topics/powervs/external-cloud-provider.html) steps. +2. Use clusterctl to render the yaml through templates and deploy the cluster. + **Replace the following snippet with the template of your choice.** - **Note:** the `IBMPOWERVS_IMAGE_ID` value below should reflect the ID of the custom qcow2 image, the `kubernetes-version` value below should reflect the kubernetes version of the custom qcow2 image. + > **Note:** + > The `IBMPOWERVS_IMAGE_ID` value below should reflect the ID of the custom image and the `kubernetes-version` value below should reflect the kubernetes version of the custom image. ```console IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ @@ -123,4 +130,100 @@ following the steps below. ibm-powervs-1-control-plane-rg6xv Ready master 41h v1.26.2 ibm-powervs-1-md-0-4dc5c Ready 41h v1.26.2 ibm-powervs-1-md-0-dbxb7 Ready 20h v1.26.2 - ``` + +### Deploy a PowerVS cluster with user provided resources + + ``` + IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ + IBMPOWERVS_VIP="192.168.167.6" \ + IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \ + IBMPOWERVS_VIP_CIDR="29" \ + IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \ + IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \ + IBMPOWERVS_NETWORK_NAME="capi-test" \ + clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \ + --target-namespace default \ + --control-plane-machine-count=3 \ + --worker-machine-count=1 \ + --flavor=powervs | kubectl apply -f - + ``` + +### Deploy a PowerVS cluster with infrastructure creation + +#### Prerequisites: +- Set `EXP_CLUSTER_RESOURCE_SET` to true as the cluster will be deployed with external cloud provider which will create the resources to run the cloud controller manager. +- Set the `provider-id-fmt` [flag](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/5e7f80878f2252c6ab13c16102de90c784a2624d/main.go#L168-L173) to `v2` via `PROVIDER_ID_FORMAT` environment variable. +- Already existing infrasturcture resources can be used for cluster creation by setting either the ID or name in spec. If neither are specified, the cluster name will be used for constructing the resource name. For example, if cluster name is `capi-powervs`, PowerVS workspace will be created with name `capi-powervs-serviceInstance`. + ``` + ``` + + ``` + IBMCLOUD_API_KEY=XXXXXXXXXXXX \ + IBMPOWERVS_SSHKEY_NAME="my-ssh-key" \ + COS_BUCKET_REGION="us-south" \ + COS_BUCKET_NAME="power-oss-bucket" \ + COS_OBJECT_NAME=capibm-powervs-centos-streams8-1-28-4-1707287079.ova.gz \ + IBMACCOUNT_ID="" \ + IBMPOWERVS_REGION="wdc" \ + IBMPOWERVS_ZONE="wdc06" \ + IBMVPC_REGION="us-east" \ + IBM_RESOURCE_GROUP="ibm-resource-group" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ + clusterctl generate cluster capi-powervs --kubernetes-version v1.28.4 \ + --target-namespace default \ + --control-plane-machine-count=3 \ + --worker-machine-count=1 \ + --flavor=powervs-create-infra | kubectl apply -f - + ``` + +### Deploy a PowerVS cluster with external cloud provider + +#### Prerequisites: +- Set `EXP_CLUSTER_RESOURCE_SET` to true as the cluster will be deployed with external cloud provider which will create the resources to run the cloud controller manager. +- Set the `provider-id-fmt` [flag](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/5e7f80878f2252c6ab13c16102de90c784a2624d/main.go#L168-L173) to `v2` via `PROVIDER_ID_FORMAT` environment variable. + + ``` + IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ + IBMPOWERVS_VIP="192.168.167.6" \ + IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \ + IBMPOWERVS_VIP_CIDR="29" \ + IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \ + IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \ + IBMPOWERVS_NETWORK_NAME="capi-test" \ + IBMACCOUNT_ID="ibm-accountid" \ + IBMPOWERVS_REGION="osa" \ + IBMPOWERVS_ZONE="osa21" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ + clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \ + --target-namespace default \ + --control-plane-machine-count=3 \ + --worker-machine-count=1 \ + --flavor=powervs-cloud-provider | kubectl apply -f - + ``` + +### Deploy a PowerVS cluster with cluster class + +#### Prerequisites: +- To deploy a cluster using [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/index.html), set `CLUSTER_TOPOLOGY` environment variable to `true`. +- Set `EXP_CLUSTER_RESOURCE_SET` to true as the cluster will be deployed with external cloud provider which will create the resources to run the cloud controller manager. +- Set the `provider-id-fmt` [flag](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/5e7f80878f2252c6ab13c16102de90c784a2624d/main.go#L168-L173) to `v2` via `PROVIDER_ID_FORMAT` environment variable. + + ``` + IBMPOWERVS_CLUSTER_CLASS_NAME="powervs-cc" \ + IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ + IBMPOWERVS_VIP="192.168.167.6" \ + IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \ + IBMPOWERVS_VIP_CIDR="29" \ + IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \ + IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \ + IBMPOWERVS_NETWORK_NAME="capi-test" \ + IBMACCOUNT_ID="ibm-accountid" \ + IBMPOWERVS_REGION="osa" \ + IBMPOWERVS_ZONE="osa21" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ + clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \ + --target-namespace default \ + --control-plane-machine-count=3 \ + --worker-machine-count=1 \ + --flavor=powervs-clusterclass | kubectl apply -f - + ``` \ No newline at end of file diff --git a/docs/book/src/topics/powervs/external-cloud-provider.md b/docs/book/src/topics/powervs/external-cloud-provider.md deleted file mode 100644 index ac62df045..000000000 --- a/docs/book/src/topics/powervs/external-cloud-provider.md +++ /dev/null @@ -1,31 +0,0 @@ -# IBM PowerVS External Cloud Provider -> ⚠️ **WARNING**: This feature is currently in experimental stage - -## Steps - -- To deploy a PowerVS workload cluster with IBM PowerVS external [cloud provider](https://kubernetes.io/docs/concepts/architecture/cloud-controller/), create a cluster configuration with the [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-powervs-cloud-provider.yaml) -- The [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-powervs-cloud-provider.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 PowerVS cluster with IBM PowerVS cloud provider - - ``` - IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ - IBMPOWERVS_VIP="192.168.167.6" \ - IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \ - IBMPOWERVS_VIP_CIDR="29" \ - IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \ - IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \ - IBMPOWERVS_NETWORK_NAME="capi-test" \ - IBMACCOUNT_ID="ibm-accountid" \ - IBMPOWERVS_REGION="osa" \ - IBMPOWERVS_ZONE="osa21" \ - BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ - clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \ - --target-namespace default \ - --control-plane-machine-count=3 \ - --worker-machine-count=1 \ - --flavor=powervs-cloud-provider | kubectl apply -f - - ``` - -When the cluster is created with above parameters, The IBM PowerVS cloud provider will -1. Initialize the node by fetching appropriate VM information such as IP, zone, region from Power Cloud. \ 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 567fe8394..677ae2755 100644 --- a/docs/book/src/topics/powervs/index.md +++ b/docs/book/src/topics/powervs/index.md @@ -3,7 +3,4 @@ ## Contents - [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) -- [Creating a cluster by auto creating required resources](/topics/powervs/create-resources.html) - [Using autoscaler with scaling from 0 machine](/topics/powervs/autoscaler-scalling-from-0.html) \ No newline at end of file diff --git a/docs/book/src/topics/powervs/prerequisites.md b/docs/book/src/topics/powervs/prerequisites.md index 422922135..8b6c32da1 100644 --- a/docs/book/src/topics/powervs/prerequisites.md +++ b/docs/book/src/topics/powervs/prerequisites.md @@ -27,7 +27,7 @@ Please refer to the following [documentation](https://cloud.ibm.com/docs/account After you have an active IBM Cloud account, you can create a Power Systems Virtual Server service. To do so, perform the following steps: -1. ***TO-DO*** +> **Note:** If you are deploying a [PowerVS cluster with infrastructure creation](./creating-a-cluster.md#deploy-a-powervs-cluster-with-infrastructure-creation), you can diretly proceed to the step 2 of cluster creation [here](./creating-a-cluster.md#provision-workload-cluster-in-ibm-cloud-powervs) as creating network resources and importing boot images is not required. ## Create Network diff --git a/docs/book/src/topics/vpc/clusterclass-cluster.md b/docs/book/src/topics/vpc/clusterclass-cluster.md deleted file mode 100644 index f026f9d28..000000000 --- a/docs/book/src/topics/vpc/clusterclass-cluster.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/creating-a-cluster.md b/docs/book/src/topics/vpc/creating-a-cluster.md index 45f1192a5..66fb8ac3a 100644 --- a/docs/book/src/topics/vpc/creating-a-cluster.md +++ b/docs/book/src/topics/vpc/creating-a-cluster.md @@ -1,13 +1,23 @@ ### Provision workload Cluster in IBM Cloud VPC Now that we have a management cluster ready, you can create your workload cluster by -following the steps below. +following the steps below. + +> **Note**: +> 1. The cluster will be deployed with [cloud controller manager](https://kubernetes.io/docs/concepts/architecture/cloud-controller/) +> 2. The [template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template.yaml) uses the experimental feature gate [clusterresourceset](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-resource-set.html) which will create the necessary config map, secret and roles to run the cloud controller manager. Set `EXP_CLUSTER_RESOURCE_SET` to true. +> 3. As a prerequisite, set the `provider-id-fmt` [flag](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/bfb33f159d5edd87dcbbb45942a6ffdc3aedb067/main.go#L137) to `v2` via `PROVIDER_ID_FORMAT` environment variable. +> 4. To deploy a cluster using [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/index.html), refer [here](#deploy-a-cluster-using-ibm-cloud-vpc-infrastructure-using-clusterclass). In additional to the above flags, set `CLUSTER_TOPOLOGY` environment variable to `true`. +> 5. The list of IBM Cloud VPC Regions and Zones can be found [here](../../reference/regions-zones-mapping.md). + 1. Using clusterctl, render the yaml through templates and deploy the cluster - **Note:** the `IBMVPC_IMAGE_NAME` value below should reflect the Name of the custom qcow2 image + + **Note:** the `IBMVPC_IMAGE_NAME` value below should reflect the name of the custom qcow2 image ```console + IBMCLOUD_API_KEY="XXXXXXXXXXXXXXXXXX" \ IBMVPC_REGION=us-south \ IBMVPC_ZONE=us-south-1 \ IBMVPC_RESOURCEGROUP=4f15679623607b855b1a27a67f20e1c7 \ @@ -15,6 +25,8 @@ following the steps below. IBMVPC_IMAGE_NAME=capibm-vpc-ubuntu-2004-kube-v1-26-2 \ IBMVPC_PROFILE=bx2-4x16 \ IBMVPC_SSHKEY_NAME=capi-vpc-key \ + IBMACCOUNT_ID="ibm-accountid" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ clusterctl generate cluster ibm-vpc-0 --kubernetes-version v1.26.2 \ --target-namespace default \ --control-plane-machine-count=1 \ @@ -30,6 +42,10 @@ following the steps below. machinedeployment.cluster.x-k8s.io/ibm-vpc-0-md-0 created ibmvpcmachinetemplate.infrastructure.cluster.x-k8s.io/ibm-vpc-0-md-0 created kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/ibm-vpc-0-md-0 created + clusterresourceset.addons.cluster.x-k8s.io/crs-cloud-conf created + configmap/ibm-cfg created + secret/ibm-credential created + configmap/cloud-controller-manager-addon created ``` **Note:** Refer below for more detailed information on VPC variables. @@ -39,6 +55,7 @@ following the steps below. - [IBMVPC_IMAGE_NAME](https://cloud.ibm.com/docs/vpc?topic=vpc-planning-custom-images) - [IBMVPC_PROFILE](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui) - [IBMVPC_SSHKEY_NAME](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-ssh-keys&interface=ui) + - [IBMACCOUNT_ID](https://cloud.ibm.com/docs/account?topic=account-accountfaqs#account-details) 2. Check the state of the provisioned cluster and machine objects within the local management cluster @@ -82,3 +99,27 @@ following the steps below. ibm-vpc-0-md-0-4dc5c Ready 41h v1.26.2 ibm-vpc-0-md-0-dbxb7 Ready 20h v1.26.2 ``` + +**Change disk size for the boot volume** + +There are two following variables for controlling the volume size for the boot disk. +- `IBMVPC_CONTROLPLANE_BOOT_VOLUME_SIZEGIB`: Size of the boot volume for the control plane nodes, default set to 20GiB +- `IBMVPC_WORKER_BOOT_VOLUME_SIZEGIB`: Size of the boot volume for the worker nodes, default set to 20GiB +> **Note**: Default value is set to 20GiB because the images published for testing are of size 20GiB(default size in the image-builder scripts as well). + + +### Deploy a VPC cluster using ClusterClass + + IBMVPC_CLUSTER_CLASS_NAME=ibmvpc-clusterclass \ + IBMCLOUD_API_KEY="XXXXXXXXXXXXXXXXXX" \ + IBMVPC_REGION=us-south \ + IBMVPC_ZONE=us-south-1 \ + IBMVPC_RESOURCEGROUP=4f15679623607b855b1a27a67f20e1c7 \ + IBMVPC_NAME=ibm-vpc-0 \ + IBMVPC_IMAGE_NAME=capibm-vpc-ubuntu-2004-kube-v1-26-2 \ + IBMVPC_PROFILE=bx2-4x16 \ + IBMVPC_SSHKEY_NAME=capi-vpc-key \ + IBMACCOUNT_ID="ibm-accountid" \ + BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ + clusterctl generate cluster ibm-vpc-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 - + \ No newline at end of file diff --git a/docs/book/src/topics/vpc/index.md b/docs/book/src/topics/vpc/index.md index 1609fd3ab..4e015d3bb 100644 --- a/docs/book/src/topics/vpc/index.md +++ b/docs/book/src/topics/vpc/index.md @@ -3,6 +3,4 @@ ## Contents - [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 with Load Balancer and external cloud provider](/topics/vpc/load-balancer.md) -- [Creating a cluster from ClusterClass](/topics/vpc/clusterclass-cluster.md) \ No newline at end of file +- [Creating a cluster](/topics/vpc/creating-a-cluster.html) \ No newline at end of file diff --git a/docs/book/src/topics/vpc/load-balancer.md b/docs/book/src/topics/vpc/load-balancer.md deleted file mode 100644 index 4d46dc25e..000000000 --- a/docs/book/src/topics/vpc/load-balancer.md +++ /dev/null @@ -1,35 +0,0 @@ -## Provision workload Cluster with Load Balancer and external cloud provider in IBM Cloud VPC - -> ⚠️ **WARNING**: This feature is currently in experimental stage - -## Steps - -- To deploy a VPC workload cluster with Load Balancer IBM external [cloud provider](https://kubernetes.io/docs/concepts/architecture/cloud-controller/), create a cluster configuration with the [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-load-balancer.yaml) -- The [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-load-balancer.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 VPC cluster with Load Balancer and IBM cloud provider - -```console - IBMCLOUD_API_KEY="XXXXXXXXXXXXXXXXXX" \ - IBMVPC_REGION=us-south \ - IBMVPC_ZONE=us-south-1 \ - IBMVPC_RESOURCEGROUP_NAME="ibm-hypershift-dev" \ - IBMVPC_RESOURCEGROUP=4f15679623607b855b1a27a67f20e1c7 \ - IBMVPC_NAME=ibm-vpc-0 \ - IBMVPC_IMAGE_NAME=capibm-vpc-ubuntu-2004-kube-v1-26-2 \ - IBMVPC_PROFILE=bx2-4x16 \ - IBMVPC_SSHKEY_NAME=capi-vpc-key \ - IBMACCOUNT_ID="ibm-accountid" \ - BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ - clusterctl generate cluster ibm-vpc-0 --kubernetes-version v1.26.2 \ - --target-namespace default \ - --control-plane-machine-count=1 \ - --worker-machine-count=2 | kubectl apply -f - -``` - -**Change disk size for the boot volume** - -There are two following variables for controlling the volume size for the boot disk. -- `IBMVPC_CONTROLPLANE_BOOT_VOLUME_SIZEGIB`: Size of the boot volume for the control plane nodes, default set to 20GiB -- `IBMVPC_WORKER_BOOT_VOLUME_SIZEGIB`: Size of the boot volume for the worker nodes, default set to 20GiB -> **Note**: Default value is set to 20GiB because the images published for testing are of size 20GiB(default size in the image-builder scripts as well). \ No newline at end of file