Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Setting up the environment
After you meet the AWS prerequisites, set up your environment and install Red Hat OpenShift Service on AWS.
5.1. Installing and configuring the required CLI tools Copiar enlaceEnlace copiado en el portapapeles!
Several command-line interface (CLI) tools are required to deploy and work with your cluster.
Prerequisites
- You have an AWS account.
- You have a Red Hat account.
Procedure
Log in to your Red Hat and AWS accounts to access the download page for each required tool.
- Log in to your Red Hat account at console.redhat.com.
- Log in to your AWS account at aws.amazon.com.
Install and configure the latest AWS CLI (
aws).- Install the AWS CLI by following the AWS Command Line Interface documentation appropriate for your workstation.
Configure the AWS CLI by specifying your
aws_access_key_id,aws_secret_access_key, andregionin the.aws/credentialsfile. For more information, see AWS Configuration basics in the AWS documentation.NoteYou can optionally use the
AWS_DEFAULT_REGIONenvironment variable to set the default AWS region.Query the AWS API to verify if the AWS CLI is installed and configured correctly:
$ aws sts get-caller-identity --output textFor example:
<aws_account_id> arn:aws:iam::<aws_account_id>:user/<username> <aws_user_id>
Install and configure the latest ROSA CLI.
- Navigate to Downloads.
Find Red Hat OpenShift Service on AWS command line interface (
rosa) in the list of tools and click Download.The
rosa-linux.tar.gzfile is downloaded to your default download location.Extract the
rosabinary file from the downloaded archive. The following example extracts the binary from a Linux tar archive:$ tar xvf rosa-linux.tar.gzMove the
rosabinary file to a directory in your execution path. In the following example, the/usr/local/bindirectory is included in the path of the user:$ sudo mv rosa /usr/local/bin/rosaVerify that the ROSA CLI is installed correctly by querying the
rosaversion:$ rosa versionFor example:
1.2.47 Your ROSA CLI is up to date.
Log in to the ROSA CLI using an offline access token.
Run the login command:
$ rosa loginFor example:
To login to your Red Hat account, get an offline access token at https://console.redhat.com/openshift/token/rosa ? Copy the token and paste it here:- Navigate to the URL listed in the command output to view your offline access token.
Enter the offline access token at the command-line prompt to log in.
? Copy the token and paste it here: ******************* [full token length omitted]NoteIn the future you can specify the offline access token by using the
--token="<offline_access_token>"argument when you run therosa logincommand.Verify that you are logged in and confirm that your credentials are correct before proceeding:
$ rosa whoamiFor example:
AWS Account ID: <aws_account_number> AWS Default Region: us-east-1 AWS ARN: arn:aws:iam::<aws_account_number>:user/<aws_user_name> OCM API: https://api.openshift.com OCM Account ID: <red_hat_account_id> OCM Account Name: Your Name OCM Account Username: you@domain.com OCM Account Email: you@domain.com OCM Organization ID: <org_id> OCM Organization Name: Your organization OCM Organization External ID: <external_org_id>
Install and configure the latest OpenShift CLI (
oc).Use the ROSA CLI to download the
ocCLI.The following command downloads the latest version of the CLI to the current working directory:
$ rosa download openshift-clientExtract the
ocbinary file from the downloaded archive. The following example extracts the files from a Linux tar archive:$ tar xvf openshift-client-linux.tar.gzMove the
ocbinary to a directory in your execution path. In the following example, the/usr/local/bindirectory is included in the path of the user:$ sudo mv oc /usr/local/bin/ocVerify that the
ocCLI is installed correctly:$ rosa verify openshift-clientFor example:
I: Verifying whether OpenShift command-line tool is available... I: Current OpenShift Client Version: 4.17.3