Skip to content

Commit f21d69f

Browse files
committed
Update ROSA HCP cluster creation and IAM role instructions:
- Add ROSA and MachinePool feature gate requirements before clusterctl init - Add note about rosa-creds-secret namespace matching resource namespace - Add note about ROSARoleConfig prefix max length (4 characters) - Update OpenShift version from 4.19.0 to 4.20.11 with version check hint - Update Cluster and MachinePool API version from v1beta1 to v1beta2
1 parent 338243d commit f21d69f

2 files changed

Lines changed: 36 additions & 13 deletions

File tree

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
1. Install the required tools and set up the prerequisite infrastructure using the [ROSA Setup guide](https://docs.aws.amazon.com/rosa/latest/userguide/set-up.html).
66

77

8-
2. Create a management cluster using the [Quick Start Guide.](https://cluster-api-aws.sigs.k8s.io/quick-start)
8+
2. Export the following:
9+
```shell
10+
export EXP_ROSA=true
11+
export EXP_MACHINE_POOL=true
12+
```
13+
14+
3. Create a management cluster using the [Quick Start Guide.](https://cluster-api-aws.sigs.k8s.io/quick-start)
915

1016

1117
## IAM Role Configuration
@@ -38,7 +44,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
3844
--from-literal=ocmClientSecret='eyJhbGciOiJIUzI1NiIsI....' \
3945
--from-literal=ocmApiUrl='https://api.openshift.com'
4046
```
41-
Note: to consume the secret without the need to reference it from your `ROSAControlPlane`, name your secret `rosa-creds-secret` and create it in the CAPA manager namespace (usually `capa-system`)
47+
**Note:** The secret must be created in the same namespace where your ROSA resources will be deployed. Alternatively, to consume the secret without the need to reference it from your `ROSAControlPlane`, name your secret `rosa-creds-secret` and create it in the CAPA manager namespace (usually `capa-system`)
4248
```shell
4349
kubectl -n capa-system create secret generic rosa-creds-secret \
4450
--from-literal=ocmClientID='....' \
@@ -51,7 +57,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
5157

5258
1. Prepare the environment:
5359
```bash
54-
export OPENSHIFT_VERSION="4.19.0"
60+
export OPENSHIFT_VERSION="4.20.11" # check available versions with: rosa list versions --hosted-cp
5561
export AWS_REGION="us-west-2"
5662
export AWS_AVAILABILITY_ZONE="us-west-2a"
5763
export AWS_ACCOUNT_ID="<account_id>"
@@ -70,6 +76,8 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
7076
- Public and private subnet pairs for each availability zone
7177
- Associated networking resources (internet gateway, NAT gateways, route tables)
7278

79+
**Note:** The `prefix` field has a maximum length of 4 characters.
80+
7381
Save the following to a file `rosa-role-network.yaml`:
7482

7583
```yaml
@@ -80,7 +88,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
8088
spec:
8189
accountRoleConfig:
8290
prefix: "rosa"
83-
version: "4.19.0"
91+
version: "4.20.11"
8492
operatorRoleConfig:
8593
prefix: "rosa"
8694
credentialsSecretRef:
@@ -187,7 +195,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
187195
1. Save the following to a file `rosa-cluster.yaml`:
188196

189197
```yaml
190-
apiVersion: cluster.x-k8s.io/v1beta1
198+
apiVersion: cluster.x-k8s.io/v1beta2
191199
kind: Cluster
192200
metadata:
193201
name: "rosa-hcp-1"
@@ -196,11 +204,11 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
196204
pods:
197205
cidrBlocks: ["192.168.0.0/16"]
198206
infrastructureRef:
199-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
207+
apiGroup: infrastructure.cluster.x-k8s.io
200208
kind: ROSACluster
201209
name: "rosa-hcp-1"
202210
controlPlaneRef:
203-
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
211+
apiGroup: controlplane.cluster.x-k8s.io
204212
kind: ROSAControlPlane
205213
name: "rosa-hcp-1-control-plane"
206214
---
@@ -221,7 +229,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
221229
domainPrefix: rosa-hcp
222230
rosaRoleConfigRef:
223231
name: role-config # reference to the ROSARoleConfig created above
224-
version: "4.19.0"
232+
version: "4.20.11"
225233
region: "us-west-2"
226234
rosaNetworkRef:
227235
name: "rosa-vpc" # reference to the ROSANetwork created above
@@ -302,7 +310,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
302310
1. To add an additional `ROSAMachinePool`, save the following to a file `rosa-machinepool-extra.yaml`:
303311

304312
```yaml
305-
apiVersion: cluster.x-k8s.io/v1beta1
313+
apiVersion: cluster.x-k8s.io/v1beta2
306314
kind: MachinePool
307315
metadata:
308316
name: "rosa-hcp-1-workers-extra"
@@ -315,7 +323,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
315323
bootstrap:
316324
dataSecretName: ""
317325
infrastructureRef:
318-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
326+
apiGroup: infrastructure.cluster.x-k8s.io
319327
kind: ROSAMachinePool
320328
name: "workers-extra"
321329
---
@@ -325,7 +333,7 @@ The CAPA controller requires service account credentials to provision ROSA HCP c
325333
name: "workers-extra"
326334
spec:
327335
nodePoolName: "workers-extra"
328-
version: "4.19.0"
336+
version: "4.20.11"
329337
instanceType: "m5.xlarge"
330338
autoRepair: true
331339
```

docs/book/src/topics/rosa/specify-management-iam-role.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ When using a management cluster (OCP or ROSA-HCP) created using AWS credentials
6060
6161
aws iam attach-role-policy --role-name capa-manager-role \
6262
--policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess
63+
64+
aws iam attach-role-policy --role-name capa-manager-role \
65+
--policy-arn arn:aws:iam::aws:policy/IAMFullAccess
6366
```
6467

68+
**Note:** The `IAMFullAccess` policy is required for the CAPA controller to create and manage the ROSA account roles, operator roles, and OIDC providers via the `ROSARoleConfig` resource.
69+
6570
## Annotate the Service Account
6671

6772
1. Retrieve the IAM role ARN:
@@ -77,10 +82,20 @@ When using a management cluster (OCP or ROSA-HCP) created using AWS credentials
7782
eks.amazonaws.com/role-arn=$APP_IAM_ROLE_ARN
7883
```
7984

80-
3. Restart the CAPA controller to pick up the new role:
85+
3. Remove the bootstrap AWS credentials from the CAPA controller so it uses the IAM role instead of static credentials. First, delete the secret:
86+
87+
```shell
88+
kubectl delete secret -n capa-system capa-manager-bootstrap-credentials
89+
```
90+
91+
Then remove the credentials volume and volume mount from the deployment:
8192

8293
```shell
83-
kubectl rollout restart deployment capa-controller-manager -n capa-system
94+
kubectl patch deployment capa-controller-manager -n capa-system --type='json' \
95+
-p='[{"op": "remove", "path": "/spec/template/spec/volumes/1"},
96+
{"op": "remove", "path": "/spec/template/spec/containers/0/volumeMounts/1"}]'
8497
```
8598

99+
**Note:** The volume indices above (`/1`) assume the default deployment configuration. Verify the correct indices by inspecting the deployment if you have customized it.
100+
86101
After this configuration, the CAPA controller will use the IAM role to manage AWS resources, and you can provision ROSA HCP clusters without storing AWS credentials in the management cluster.

0 commit comments

Comments
 (0)