Skip to content

Commit a5dba4f

Browse files
committed
make powervs cluster setup with external cloud provider as default
Signed-off-by: Prajyot Parab <Prajyot.Parab2@ibm.com>
1 parent 2c4dc73 commit a5dba4f

File tree

11 files changed

+28
-69
lines changed

11 files changed

+28
-69
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: 3 additions & 5 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
@@ -100,7 +101,7 @@ extra_args:
100101
101102
### 1. Configuration to deploy workload cluster with external cloud controller manager
102103
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+
To deploy workload cluster with cloud controller manager, enable cluster resourceset feature gate by setting `EXP_CLUSTER_RESOURCE_SET` to `true` under kustomize_substitutions.
104105

105106
```yaml
106107
default_registry: "gcr.io/you-project-name-here"
@@ -112,13 +113,12 @@ enable_providers:
112113
- kubeadm-control-plane
113114
kustomize_substitutions:
114115
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
115-
PROVIDER_ID_FORMAT: "v2"
116116
EXP_CLUSTER_RESOURCE_SET: "true"
117117
```
118118

119119
### 2. Configuration to deploy workload cluster from ClusterClass template
120120

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.
121+
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.
122122

123123
```yaml
124124
default_registry: "gcr.io/you-project-name-here"
@@ -130,7 +130,6 @@ enable_providers:
130130
- kubeadm-control-plane
131131
kustomize_substitutions:
132132
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
133-
PROVIDER_ID_FORMAT: "v2"
134133
EXP_CLUSTER_RESOURCE_SET: "true"
135134
CLUSTER_TOPOLOGY: "true"
136135
```
@@ -171,7 +170,6 @@ enable_providers:
171170
- kubeadm-control-plane
172171
kustomize_substitutions:
173172
IBMCLOUD_API_KEY: "XXXXXXXXXXXXXXXXXX"
174-
PROVIDER_ID_FORMAT: "v2"
175173
EXP_CLUSTER_RESOURCE_SET: "true"
176174
extra_args:
177175
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: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,22 @@ clusterctl generate cluster ibm-vpc-1 --kubernetes-version v1.14.3 \
2020

2121
## Power VS
2222

23+
> **Note:**
24+
> 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.
25+
2326
```shell
24-
IBMPOWERVS_SSHKEY_NAME="mkumatag-pub-key" \
25-
IBMPOWERVS_VIP="192.168.150.125" \
26-
IBMPOWERVS_VIP_EXTERNAL="158.175.161.125" \
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)