Skip to content

Commit 19f249d

Browse files
make powervs cluster setup with external cloud provider as default (kubernetes-sigs#2168)
Signed-off-by: Prajyot Parab <[email protected]>
1 parent 0d51c86 commit 19f249d

File tree

11 files changed

+32
-90
lines changed

11 files changed

+32
-90
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ generate-go-conversions: $(CONVERSION_GEN) ## Generate conversions go code
181181
.PHONY: generate-templates
182182
generate-templates: $(KUSTOMIZE) ## Generate cluster templates
183183
$(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template.yaml
184-
$(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs-cloud-provider --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs-cloud-provider.yaml
184+
$(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs.yaml
185185
$(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs-clusterclass --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs-clusterclass.yaml
186186
$(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-vpc-clusterclass --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-vpc-clusterclass.yaml
187187

docs/book/src/developer/tilt.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ enable_providers:
8484
- kubeadm-control-plane
8585
kustomize_substitutions:
8686
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
87+
EXP_CLUSTER_RESOURCE_SET: "true"
8788
```
8889
8990
Add following extra_args to log PowerVS REST API Requests/Responses
@@ -96,29 +97,11 @@ extra_args:
9697
---
9798
## Different flavors of deploying workload clusters using CAPIBM.
9899
99-
> **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.
100-
101-
### 1. Configuration to deploy workload cluster with external cloud controller manager
102-
103-
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.
104-
105-
```yaml
106-
default_registry: "gcr.io/you-project-name-here"
107-
provider_repos:
108-
- ../cluster-api-provider-ibmcloud
109-
enable_providers:
110-
- ibmcloud
111-
- kubeadm-bootstrap
112-
- kubeadm-control-plane
113-
kustomize_substitutions:
114-
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
115-
PROVIDER_ID_FORMAT: "v2"
116-
EXP_CLUSTER_RESOURCE_SET: "true"
117-
```
100+
> **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. By default, the workload cluster is deployed using the external Cloud Controller Manager (CCM).
118101
119-
### 2. Configuration to deploy workload cluster from ClusterClass template
102+
### 1. Configuration to deploy workload cluster from ClusterClass template
120103
121-
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.
104+
To deploy workload cluster with [clusterclass-template](/topics/powervs/clusterclass-cluster.html), enable the feature gates `EXP_CLUSTER_RESOURCE_SET` and `CLUSTER_TOPOLOGY` to `true` under kustomize_substitutions.
122105

123106
```yaml
124107
default_registry: "gcr.io/you-project-name-here"
@@ -130,12 +113,11 @@ enable_providers:
130113
- kubeadm-control-plane
131114
kustomize_substitutions:
132115
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
133-
PROVIDER_ID_FORMAT: "v2"
134116
EXP_CLUSTER_RESOURCE_SET: "true"
135117
CLUSTER_TOPOLOGY: "true"
136118
```
137119

138-
### 3. Configuration to deploy workload cluster with Custom Service Endpoint
120+
### 2. Configuration to deploy workload cluster with Custom Service Endpoint
139121

140122
To deploy workload cluster with Custom Service Endpoint, Set `SERVICE_ENDPOINT` environmental variable in semi-colon separated format: `${ServiceRegion}:${ServiceID1}=${URL1},${ServiceID2}=${URL2...}`
141123
```yaml
@@ -152,7 +134,7 @@ kustomize_substitutions:
152134
IBMCLOUD_AUTH_URL: "https://iam.test.cloud.ibm.com"
153135
```
154136

155-
### 4. Configuration to use observability tools
137+
### 3. Configuration to use observability tools
156138

157139
- cluster-api provides support for deploying observability tools, More information about it is available in cluster-api [book](https://cluster-api.sigs.k8s.io/developer/logging#developing-and-testing-logs).
158140

@@ -171,7 +153,6 @@ enable_providers:
171153
- kubeadm-control-plane
172154
kustomize_substitutions:
173155
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
174-
PROVIDER_ID_FORMAT: "v2"
175156
EXP_CLUSTER_RESOURCE_SET: "true"
176157
extra_args:
177158
core:

docs/book/src/topics/powervs/creating-a-cluster.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
> **Note:**
44
> 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.
5-
> - [PowerVS cluster with user provided resources](#deploy-a-powervs-cluster-with-user-provided-resources)
65
> - [PowerVS cluster with infrastructure creation](#deploy-a-powervs-cluster-with-infrastructure-creation)
7-
> - [PowerVS cluster with external cloud provider](#deploy-a-powervs-cluster-with-external-cloud-provider)
86
> - [PowerVS cluster with cluster class](#deploy-a-powervs-cluster-with-cluster-class)
97
108
Now that we have a management cluster ready, you can create your workload cluster by
@@ -40,7 +38,8 @@ following the steps below.
4038
**Replace the following snippet with the template of your choice.**
4139

4240
> **Note:**
43-
> 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.
41+
> - 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.
42+
> - The `IBMPOWERVS_IMAGE_NAME` value below should reflect the name of the custom image and the `kubernetes-version` value below should reflect the kubernetes version of the custom image.
4443

4544
```console
4645
IBMPOWERVS_SSHKEY_NAME="my-pub-key" \
@@ -50,6 +49,10 @@ following the steps below.
5049
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \
5150
IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \
5251
IBMPOWERVS_NETWORK_NAME="capi-test" \
52+
IBMACCOUNT_ID="ibm-accountid" \
53+
IBMPOWERVS_REGION="osa" \
54+
IBMPOWERVS_ZONE="osa21" \
55+
BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \
5356
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \
5457
--target-namespace default \
5558
--control-plane-machine-count=3 \
@@ -131,31 +134,10 @@ following the steps below.
131134
ibm-powervs-1-md-0-4dc5c Ready <none> 41h v1.26.2
132135
ibm-powervs-1-md-0-dbxb7 Ready <none> 20h v1.26.2
133136

134-
### Deploy a PowerVS cluster with user provided resources
135-
136-
```
137-
IBMPOWERVS_SSHKEY_NAME="my-pub-key" \
138-
IBMPOWERVS_VIP="192.168.167.6" \
139-
IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \
140-
IBMPOWERVS_VIP_CIDR="29" \
141-
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \
142-
IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \
143-
IBMPOWERVS_NETWORK_NAME="capi-test" \
144-
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \
145-
--target-namespace default \
146-
--control-plane-machine-count=3 \
147-
--worker-machine-count=1 \
148-
--flavor=powervs | kubectl apply -f -
149-
```
150-
151137
### Deploy a PowerVS cluster with infrastructure creation
152138

153139
#### Prerequisites:
154-
- 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.
155-
- 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.
156140
- 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`.
157-
```
158-
```
159141

160142
```
161143
IBMCLOUD_API_KEY=XXXXXXXXXXXX \
@@ -176,37 +158,10 @@ following the steps below.
176158
--flavor=powervs-create-infra | kubectl apply -f -
177159
```
178160
179-
### Deploy a PowerVS cluster with external cloud provider
180-
181-
#### Prerequisites:
182-
- 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.
183-
- 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.
184-
185-
```
186-
IBMPOWERVS_SSHKEY_NAME="my-pub-key" \
187-
IBMPOWERVS_VIP="192.168.167.6" \
188-
IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \
189-
IBMPOWERVS_VIP_CIDR="29" \
190-
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \
191-
IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \
192-
IBMPOWERVS_NETWORK_NAME="capi-test" \
193-
IBMACCOUNT_ID="ibm-accountid" \
194-
IBMPOWERVS_REGION="osa" \
195-
IBMPOWERVS_ZONE="osa21" \
196-
BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \
197-
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \
198-
--target-namespace default \
199-
--control-plane-machine-count=3 \
200-
--worker-machine-count=1 \
201-
--flavor=powervs-cloud-provider | kubectl apply -f -
202-
```
203-
204161
### Deploy a PowerVS cluster with cluster class
205162
206163
#### Prerequisites:
207164
- 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`.
208-
- 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.
209-
- 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.
210165
211166
```
212167
IBMPOWERVS_CLUSTER_CLASS_NAME="powervs-cc" \

docs/book/src/topics/vpc/creating-a-cluster.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ following the steps below.
55

66
> **Note**:
77
> 1. The cluster will be deployed with [cloud controller manager](https://kubernetes.io/docs/concepts/architecture/cloud-controller/)
8-
> 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.
9-
> 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.
10-
> 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`.
11-
> 5. The list of IBM Cloud VPC Regions and Zones can be found [here](../../reference/regions-zones-mapping.md).
8+
> 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`.
9+
> 3. 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 addition to the above flags, set `CLUSTER_TOPOLOGY` environment variable to `true`.
10+
> 4. The list of IBM Cloud VPC Regions and Zones can be found [here](../../reference/regions-zones-mapping.md).
1211
1312

1413
1. Using clusterctl, render the yaml through templates and deploy the cluster

templates/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Render the template via clusterctl
22
==================================
33

4+
> **Note:**
5+
> Set `EXP_CLUSTER_RESOURCE_SET` to `true` as the cluster will be deployed with external cloud provider for both VPC and PowerVS, which will create the resources to run the cloud controller manager.
6+
47
## VPC
58

69
```
@@ -20,15 +23,19 @@ clusterctl generate cluster ibm-vpc-1 --kubernetes-version v1.14.3 \
2023

2124
## Power VS
2225

23-
```shell
24-
IBMPOWERVS_SSHKEY_NAME="mkumatag-pub-key" \
25-
IBMPOWERVS_VIP="192.168.150.125" \
26-
IBMPOWERVS_VIP_EXTERNAL="158.175.161.125" \
26+
```
27+
IBMPOWERVS_SSHKEY_NAME="my-pub-key" \
28+
IBMPOWERVS_VIP="192.168.167.6" \
29+
IBMPOWERVS_VIP_EXTERNAL="163.68.65.6" \
2730
IBMPOWERVS_VIP_CIDR="29" \
28-
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-8-1-22-4" \
29-
IBMPOWERVS_SERVICE_INSTANCE_ID="e449d86e-c3a0-4c07-959e-8557fdf55482" \
30-
IBMPOWERVS_NETWORK_NAME="capi-test-3" \
31-
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.21.2 \
31+
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-streams8-1-26-2" \
32+
IBMPOWERVS_SERVICE_INSTANCE_ID="3229a94c-af54-4212-bf60-6202b6fd0a07" \
33+
IBMPOWERVS_NETWORK_NAME="capi-test" \
34+
IBMACCOUNT_ID="ibm-accountid" \
35+
IBMPOWERVS_REGION="osa" \
36+
IBMPOWERVS_ZONE="osa21" \
37+
BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \
38+
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.26.2 \
3239
--target-namespace default \
3340
--control-plane-machine-count=3 \
3441
--worker-machine-count=1 \
File renamed without changes.

templates/cluster-template-powervs-cloud-provider/cluster.yaml renamed to templates/cluster-template-powervs/cluster.yaml

File renamed without changes.
File renamed without changes.

templates/cluster-template-powervs-cloud-provider/kubeadm-config.yaml renamed to templates/cluster-template-powervs/kubeadm-config.yaml

File renamed without changes.

templates/cluster-template-powervs-cloud-provider/kustomization.yaml renamed to templates/cluster-template-powervs/kustomization.yaml

File renamed without changes.

0 commit comments

Comments
 (0)