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
, andregion
in the.aws/credentials
file. For more information, see AWS Configuration basics in the AWS documentation.NoteYou can optionally use the
AWS_DEFAULT_REGION
environment 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 text
$ aws sts get-caller-identity --output text
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
<aws_account_id> arn:aws:iam::<aws_account_id>:user/<username> <aws_user_id>
<aws_account_id> arn:aws:iam::<aws_account_id>:user/<username> <aws_user_id>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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.gz
file is downloaded to your default download location.Extract the
rosa
binary file from the downloaded archive. The following example extracts the binary from a Linux tar archive:tar xvf rosa-linux.tar.gz
$ tar xvf rosa-linux.tar.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the
rosa
binary file to a directory in your execution path. In the following example, the/usr/local/bin
directory is included in the path of the user:sudo mv rosa /usr/local/bin/rosa
$ sudo mv rosa /usr/local/bin/rosa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the ROSA CLI is installed correctly by querying the
rosa
version:rosa version
$ rosa version
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
1.2.47 Your ROSA CLI is up to date.
1.2.47 Your ROSA CLI is up to date.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Log in to the ROSA CLI using an offline access token.
Run the login command:
rosa login
$ rosa login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
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:
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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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]
? Copy the token and paste it here: ******************* [full token length omitted]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIn the future you can specify the offline access token by using the
--token="<offline_access_token>"
argument when you run therosa login
command.Verify that you are logged in and confirm that your credentials are correct before proceeding:
rosa whoami
$ rosa whoami
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install and configure the latest OpenShift CLI (
oc
).Use the ROSA CLI to download the
oc
CLI.The following command downloads the latest version of the CLI to the current working directory:
rosa download openshift-client
$ rosa download openshift-client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Extract the
oc
binary file from the downloaded archive. The following example extracts the files from a Linux tar archive:tar xvf openshift-client-linux.tar.gz
$ tar xvf openshift-client-linux.tar.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the
oc
binary to a directory in your execution path. In the following example, the/usr/local/bin
directory is included in the path of the user:sudo mv oc /usr/local/bin/oc
$ sudo mv oc /usr/local/bin/oc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
oc
CLI is installed correctly:rosa verify openshift-client
$ rosa verify openshift-client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
I: Verifying whether OpenShift command-line tool is available... I: Current OpenShift Client Version: 4.17.3
I: Verifying whether OpenShift command-line tool is available... I: Current OpenShift Client Version: 4.17.3
Copy to Clipboard Copied! Toggle word wrap Toggle overflow