You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a management cluster using the [Quick Start Guide.](https://cluster-api-aws.sigs.k8s.io/quick-start)
6
+
7
+
8
+
2. 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).
9
+
10
+
Once these steps are complete, you are ready to create a ROSA HCP cluster.
11
+
12
+
13
+
## Authentication
14
+
The CAPA controller requires service account credentials to provision ROSA HCP clusters.
15
+
If you already have a service account, you can skip these steps.
16
+
1. Create a service account by visiting [https://console.redhat.com/iam/service-accounts](https://console.redhat.com/iam/service-accounts).
17
+
18
+
19
+
2. For every newly created service account, make sure to activate the account using the [ROSA command line tool](https://github.com/openshift/rosa).
20
+
First, log in using your newly created service account:
21
+
```shell
22
+
rosa login --client-id ... --client-secret ...
23
+
```
24
+
3. Then activate your service account:
25
+
```shell
26
+
rosa whoami
27
+
```
3
28
## Permissions
4
-
### Authentication using service account credentials
5
-
CAPA controller requires service account credentials to be able to provision ROSA HCP clusters:
6
-
1. Visit [https://console.redhat.com/iam/service-accounts](https://console.redhat.com/iam/service-accounts) and create a service account. If you already have a service account, you can skip this step.
7
-
8
-
For every newly created service account, make sure to activate the account using the [ROSA command line tool](https://github.com/openshift/rosa). First, log in using your newly created service account
9
-
```shell
10
-
rosa login --client-id ... --client-secret ...
11
-
```
12
-
Then activate your service account
13
-
```shell
14
-
rosa whoami
15
-
```
16
-
17
-
1. Create a new kubernetes secret with the service account credentials to be referenced later by `ROSAControlPlane`
29
+
30
+
31
+
1. Create a new kubernetes secret with the service account credentials to be referenced later by the `ROSAControlPlane`
Note: to consume the secret without the need to reference it from your `ROSAControlPlane`, name your secret as `rosa-creds-secret` and create it in the CAPA manager namespace (usually `capa-system`)
38
+
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`)
and remove the `OCM_TOKEN` and `OCM_API_URL` variables, followed by `kubectl -n capa-system rollout restart deploy capa-controller-manager`. Then create the new default secret in the `capa-system` namespace with
Verify the `ROSARoleConfig` was successfully created. The status should contain the `accountRolesRef`, `oidcID`, `oidcProviderARN` and `operatorRolesRef`:
87
90
88
-
## Prerequisites
89
-
90
-
Follow the guide [here](https://docs.aws.amazon.com/ROSA/latest/userguide/getting-started-hcp.html) up until ["Create a ROSA with HCP Cluster"](https://docs.aws.amazon.com/ROSA/latest/userguide/getting-started-hcp.html#create-hcp-cluster-cli) to install the required tools and setup the prerequisite infrastructure. Once Step 3 is done, you will be ready to proceed with creating a ROSA HCP cluster using cluster-api.
91
-
92
-
Note; Skip the "Create the required IAM roles and OpenID Connect configuration" step from the prerequisites url above and use the templates/cluster-template-rosa-role-config.yaml to generate a ROSARoleConfig CR to create the required account roles, operator roles & managed OIDC provider.
93
-
94
-
## Creating the cluster
95
-
96
-
1. Prepare the environment:
97
-
```bash
98
-
export OPENSHIFT_VERSION="4.19.0"
99
-
export AWS_REGION="us-west-2"
100
-
export AWS_AVAILABILITY_ZONE="us-west-2a"
101
-
export AWS_ACCOUNT_ID="<account_id>"
102
-
export AWS_CREATOR_ARN="<user_arn>"# can be retrieved e.g. using `aws sts get-caller-identity`
103
-
104
-
# Note: if using templates/cluster-template-rosa.yaml set the below env variables
105
-
export OIDC_CONFIG_ID="<oidc_id>"# OIDC config id creating previously with `rosa create oidc-config`
106
-
export ACCOUNT_ROLES_PREFIX="ManagedOpenShift-HCP"# prefix used to create account IAM roles with `rosa create account-roles`
107
-
export OPERATOR_ROLES_PREFIX="capi-rosa-quickstart"# prefix used to create operator roles with `rosa create operator-roles --prefix <PREFIX_NAME>`
108
-
109
-
# Note: if using templates/cluster-template-rosa-role-config.yaml set the below env variables
110
-
export ACCOUNT_ROLES_PREFIX="capa"# prefix can be change to preferable prefix with max 4 chars
111
-
export OPERATOR_ROLES_PREFIX="capa" # prefix can be change to preferable prefix with max 4 chars
@@ -165,11 +183,34 @@ Note; Skip the "Create the required IAM roles and OpenID Connect configuration"
165
183
allowedNamespaces: {} # matches all namespaces
166
184
```
167
185
186
+
```shell
187
+
kubectl apply -f <filename>.yaml
188
+
```
189
+
168
190
see [Multi-tenancy](../multitenancy.md) for more details
169
191
170
-
1. Finally apply the manifest to create your ROSA cluster:
192
+
1. Check the `ROSAControlPlane` status:
193
+
171
194
```shell
172
-
kubectl apply -f rosa-capi-cluster.yaml
195
+
kubectl get ROSAControlPlane rosa-hcp-1-control-plane
196
+
197
+
NAME CLUSTER READY
198
+
rosa-hcp-1-control-plane rosa-hcp-1 true
173
199
```
174
200
201
+
The ROSA HCP cluster can take around 40 minutes to be fully provisioned.
202
+
203
+
1. After provisioning has completed, verify the `ROSAMachinePool` resources were successfully created:
204
+
205
+
```shell
206
+
kubectl get ROSAMachinePool
207
+
208
+
NAME READY REPLICAS
209
+
workers-0 true 1
210
+
workers-1 true 1
211
+
workers-2 true 1
212
+
```
213
+
214
+
**Note:** The number of default `ROSAMachinePool` resources corresponds to the number of availability zones configured.
215
+
175
216
see [ROSAControlPlane CRD Reference](https://cluster-api-aws.sigs.k8s.io/crd/#controlplane.cluster.x-k8s.io/v1beta2.ROSAControlPlane) for all possible configurations.
0 commit comments