|
| 1 | +:_mod-docs-content-type: ASSEMBLY |
| 2 | +[id="cloud-experts-getting-started-setup"] |
| 3 | += Tutorial: Setup |
| 4 | +include::_attributes/attributes-openshift-dedicated.adoc[] |
| 5 | +:context: cloud-experts-getting-started-setup |
| 6 | + |
| 7 | +toc::[] |
| 8 | + |
| 9 | +//rosaworkshop.io content metadata |
| 10 | +//Brought into ROSA product docs 2023-11-13 |
| 11 | + |
| 12 | +There are currently two supported credential methods when creating a {product-title} (ROSA) cluster. One method uses an IAM user with the `AdministratorAccess` policy. The second and *recommended* method uses Amazon Web Services (AWS) Security Token Service (STS). |
| 13 | +//To be added when the ROSA with STS Explained tutorial is published: |
| 14 | +//For more information, see the xref../cloud_experts_tutorials/cloud_experts_rosa_with_sts_explained.adoc#id[ROSA with STS Explained] tutorial. This workshop uses the STS method. |
| 15 | + |
| 16 | +== Prerequisites |
| 17 | + |
| 18 | +Review the prerequisites listed in the xref:../../rosa_planning/rosa-cloud-expert-prereq-checklist.adoc#rosa-cloud-expert-prereq-checklist[Prerequisites for ROSA with STS] checklist. |
| 19 | + |
| 20 | +You will need the following information from your AWS account: |
| 21 | + |
| 22 | +* AWS IAM user |
| 23 | +* AWS access key ID |
| 24 | +* AWS secret access key |
| 25 | + |
| 26 | +== Setting up a Red Hat account |
| 27 | +. If you do not have a Red Hat account, create one on the link:https://console.redhat.com/[Red Hat console]. |
| 28 | +. Accept the required terms and conditions. |
| 29 | +. Then check your email for a verification link. |
| 30 | + |
| 31 | +== Installing the AWS CLI |
| 32 | +* Install the link:https://aws.amazon.com/cli/[AWS CLI] for your operating system. |
| 33 | + |
| 34 | +== Enabling ROSA |
| 35 | + |
| 36 | +[NOTE] |
| 37 | +==== |
| 38 | +Only complete this step if you have *not* enabled ROSA in your AWS account. |
| 39 | +==== |
| 40 | + |
| 41 | +. Visit the link:https://console.aws.amazon.com/rosa[AWS console] to enable your account to use ROSA. |
| 42 | +. Click the orange *Enable OpenShift* button. |
| 43 | ++ |
| 44 | +image::cloud-experts-getting-started-setup-enable.png[] |
| 45 | + |
| 46 | +. After about a minute, a green *service enabled* bar should appear. |
| 47 | ++ |
| 48 | +image::cloud-experts-getting-started-setup-enabled.png[] |
| 49 | + |
| 50 | +== Installing the ROSA CLI |
| 51 | +. Install the link:https://console.redhat.com/openshift/downloads[ROSA CLI] for your operating system. |
| 52 | +. Download and extract the relevant file for your operating system by using the following command: |
| 53 | ++ |
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +tar -xvf rosa-linux.tar.gz |
| 57 | +---- |
| 58 | +. Save the file to a location within your `PATH` by using the following command: |
| 59 | ++ |
| 60 | +[source,terminal] |
| 61 | +---- |
| 62 | +sudo mv rosa /usr/local/bin/rosa |
| 63 | +---- |
| 64 | +. Run `rosa version` to verify a successful installation. |
| 65 | + |
| 66 | +== Installing the OpenShift CLI |
| 67 | +There are a few ways to install the OpenShift CLI (`oc`): |
| 68 | + |
| 69 | +* *Option 1: Using the ROSA CLI:* |
| 70 | +.. Run `rosa download oc`. |
| 71 | +.. Once downloaded, unzip the file and move the executables into a directory in your `PATH`. |
| 72 | +* *Option 2: Using the Openshift documentation:* |
| 73 | +.. Follow the directions on the xref:../../cli_reference/openshift_cli/getting-started-cli.adoc#installing-openshift-cli[documentation page] |
| 74 | +* *Option 3: Using your OpenShift cluster:* |
| 75 | +.. If you already have an OpenShift cluster, you can access the CLI tools page by clicking the *Question mark*, then *Command Line Tools*. |
| 76 | ++ |
| 77 | +image::cloud_experts_getting_started_setup_cli_tools.png[] |
| 78 | + |
| 79 | +.. Then, download the relevant tool for your operating system. |
| 80 | + |
| 81 | +=== Using `oc` instead of `kubectl` |
| 82 | +While `kubectl` can be used with an OpenShift cluster, `oc` is specific to OpenShift. It includes the standard set of features from `kubectl` as well as additional support for OpenShift functionality. For more information, see xref:../../cli_reference/openshift_cli/usage-oc-kubectl.adoc#usage-oc-kubectl[Usage of oc and kubectl commands]. |
| 83 | + |
| 84 | +== Configuring the AWS CLI |
| 85 | +To configure the AWS CLI, follow these steps: |
| 86 | + |
| 87 | +. Enter `aws configure` in the terminal. |
| 88 | +. Enter your AWS access key ID and press enter. |
| 89 | +. Enter your AWS secret access key and press enter. |
| 90 | +. Enter the default region in which you want to deploy. |
| 91 | +. Enter the desired output format, specifying either `table` or `json`. |
| 92 | + |
| 93 | +.Example output |
| 94 | +[source, terminal] |
| 95 | +---- |
| 96 | +$ aws configure |
| 97 | +AWS Access Key ID: AKIA0000000000000000 |
| 98 | +AWS Secret Access Key: NGvmP0000000000000000000000000 |
| 99 | +Default region name: us-east-1 |
| 100 | +Default output format: table |
| 101 | +---- |
| 102 | + |
| 103 | +== Verifying the configuration |
| 104 | +Verify that the configuration is correct by following these steps: |
| 105 | + |
| 106 | +. Run the following command to query the AWS API: |
| 107 | ++ |
| 108 | +[source,terminal] |
| 109 | +---- |
| 110 | +aws sts get-caller-identity |
| 111 | +---- |
| 112 | +. You should see a table or JSON file. Verify that the account information is correct. |
| 113 | ++ |
| 114 | +.Example output |
| 115 | ++ |
| 116 | +[source, terminal] |
| 117 | +---- |
| 118 | +$ aws sts get-caller-identity |
| 119 | +------------------------------------------------------------------------------ |
| 120 | +| GetCallerIdentity | |
| 121 | ++--------------+----------------------------------------+--------------------+ |
| 122 | +| Account | Arn | UserId | |
| 123 | ++--------------+----------------------------------------+--------------------+ |
| 124 | +| 000000000000| arn:aws:iam::00000000000:user/myuser | AIDA00000000000000| |
| 125 | ++--------------+----------------------------------------+--------------------+ |
| 126 | +---- |
| 127 | +
|
| 128 | +== Ensuring the ELB service role exists |
| 129 | +[TIP] |
| 130 | +==== |
| 131 | +Make sure that the service role for the ELB already exists, otherwise cluster deployment could fail. |
| 132 | +==== |
| 133 | +
|
| 134 | +* Run the following command to check for the ELB service role and create it if it is missing: |
| 135 | ++ |
| 136 | +[source,terminal] |
| 137 | +---- |
| 138 | +aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing" || aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com" |
| 139 | +---- |
| 140 | +
|
| 141 | +=== Fixing ELB service role errors |
| 142 | +
|
| 143 | +. The following error during cluster creation means that an ELB service role does not exist: |
| 144 | ++ |
| 145 | +.Example output |
| 146 | ++ |
| 147 | +[source,terminal] |
| 148 | +---- |
| 149 | +Error: Error creating network Load Balancer: AccessDenied: User: arn:aws:sts::970xxxxxxxxx:assumed-role/ManagedOpenShift-Installer-Role/163xxxxxxxxxxxxxxxx is not authorized to perform: iam:CreateServiceLinkedRole on resource: arn:aws:iam::970xxxxxxxxx:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing" |
| 150 | +---- |
| 151 | +
|
| 152 | +. If you receive the above error during cluster creation, run the following command: |
| 153 | ++ |
| 154 | +[source,terminal] |
| 155 | +---- |
| 156 | +aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing" || aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com" |
| 157 | +---- |
| 158 | +
|
| 159 | +== Logging in to your Red Hat account |
| 160 | +. Enter `rosa login` in a terminal. |
| 161 | +. It will prompt you to open a web browser and go to the link:https://console.redhat.com/openshift/token/rosa[Red Hat console]. |
| 162 | +. Log in, if necessary. |
| 163 | +. Click *Load token*. |
| 164 | +. Copy the token, paste it into the CLI prompt, and press enter. Alternatively, you can copy the full `rosa login --token=abc...` command and paste it in the terminal. |
| 165 | ++ |
| 166 | +image::cloud-experts-getting-started-setup-token.png[] |
| 167 | +
|
| 168 | +== Verifying credentials |
| 169 | +Verify that all the credentials are correct. |
| 170 | +
|
| 171 | +. Run `rosa whoami` in the terminal. |
| 172 | ++ |
| 173 | +.Example output |
| 174 | +[source,terminal] |
| 175 | +---- |
| 176 | +AWS Account ID: 000000000000 |
| 177 | +AWS Default Region: us-east-2 |
| 178 | +AWS ARN: arn:aws:iam::000000000000:user/myuser |
| 179 | +OCM API: https://api.openshift.com |
| 180 | +OCM Account ID: 1DzGIdIhqEWy000000000000000 |
| 181 | +OCM Account Name: Your Name |
| 182 | +OCM Account Username: [email protected] |
| 183 | +OCM Account Email: [email protected] |
| 184 | +OCM Organization ID: 1HopHfA20000000000000000000 |
| 185 | +OCM Organization Name: Red Hat |
| 186 | +OCM Organization External ID: 0000000 |
| 187 | +---- |
| 188 | +. Check the information for accuracy before proceeding. |
| 189 | +
|
| 190 | +== Verifying quota |
| 191 | +Verify that your AWS account has ample quota in the region in which you will be deploying your cluster. |
| 192 | +
|
| 193 | +* Run the following command: |
| 194 | ++ |
| 195 | +[source,terminal] |
| 196 | +---- |
| 197 | +rosa verify quota |
| 198 | +---- |
| 199 | ++ |
| 200 | +.Example output |
| 201 | ++ |
| 202 | +[source,terminal] |
| 203 | +---- |
| 204 | +I: Validating AWS quota... |
| 205 | +I: AWS quota ok. |
| 206 | +---- |
| 207 | +
|
| 208 | +* If cluster installation fails, validate the actual AWS resource usage against the xref:../../rosa_planning/rosa-sts-required-aws-service-quotas.adoc#rosa-sts-required-aws-service-quotas[AWS service quotas]. |
| 209 | +
|
| 210 | +== Verifying the `oc` CLI |
| 211 | +Verify that the `oc` CLI is installed correctly: |
| 212 | +
|
| 213 | +[source,terminal] |
| 214 | +---- |
| 215 | +rosa verify openshift-client |
| 216 | +---- |
| 217 | +
|
| 218 | +You have now successfully set up you account and environment. You are ready to deploy your cluster. |
| 219 | +
|
| 220 | +//== Deploying a cluster |
| 221 | +//In the next section you will deploy your cluster. There are two mechanisms to do so: |
| 222 | +
|
| 223 | +//- Using the ROSA CLI |
| 224 | +//- Using the OCM Web User Interface |
| 225 | +
|
| 226 | +//Either way is perfectly fine for the purposes of this workshop. Though keep in mind that if you are using the OCM UI, there will be a few extra steps to set it up in order to deploy into your AWS account for the first time. This will not need to be repeated for subsequent deployments using the OCM UI for the same AWS account. |
| 227 | +
|
| 228 | +//Please select the desired mechanism in the left menu under "Deploy the cluster". |
| 229 | +
|
| 230 | +//*[ROSA]: Red Hat OpenShift Service on AWS |
| 231 | +//*[STS]: AWS Security Token Service |
| 232 | +//*[OCM]: OpenShift Cluster Manager |
0 commit comments