Setup

This tutorial was developed and tested with:

  • OpenShift 4.7.2

  • ROSA CLI 1.0.4

  • AWS CLI v2 1.5.2

Prerequisite CLI tools

The following CLI tools are required for running the exercises in this tutorial. Please have them installed and configured before you get started with any of the tutorial chapters.

Tool macOS Fedora windows

Git

Download

Download

Download

Docker

Docker for Mac

dnf install docker

Docker for Windows

openshift-client 4.7.2

Download

Download

Download

rosa-cli 1.0.4

Download

Download

Download

stern

brew install stern

Download

Download

Apache Maven 3.6.3

Download

Download

Download

httpie

brew install httpie

dnf install httpie

https://httpie.org/doc#windows-etc

nodeJS 14.6.1.LTS

Download

Download

Download

jq

brew install jq

<package manager> jq e.g. For Fedora sudo dnf install jq

chocolatey install jq

ROSA Setup

We will setup ROSA cluster using ROSA CLI that you downloaded, if you have not done it yet please check Downloads.

Create Cluster

rosa create cluster --cluster-name="my-rosa-cluster"

The command above will create the ROSA cluster in your default AWS region, type rosa --help for more information.

More information and options for ROSA setup can be found in the official documentation.

  • It will take around 40 minutes for the cluster to be up and running. Please make sure the cluster is ready before you proceed further with the tutorial.

Create Admin User

You need to have cluster-admin to perform the exercises of this tutorial, to create the admin run:

rosa create admin --cluster=my-rosa-cluster
W: It is recommended to add an identity provider to login to this cluster. See 'rosa create
idp --help' for more information.
I: Admin account has been added to cluster 'my-rosa-cluster.
I: Please securely store this generated password. If you lose this password you can delete a
nd recreate the cluster admin user.
I: To login, run the following command:

   oc login https://api.my-rosa-cluster.vlsn.p1.openshiftapps.com:6443 --username cluster-admi
n --password #<generated password>#

I: It may take up to a minute for the account to become active.

For convenience set the OpenShift Admin username and password as environment variables

export OPENSHIFT_ADMIN='cluster-admin'
export OPENSHIFT_ADMIN_PASSWORD='<password from previous step>'

Use Web Console to Login

You can find the OpenShift Web Console URL using:

rosa describe --cluster=my-rosa-cluster

When you open the url in the web browser, click on "Cluster-Admin" realm and login using the user id $OPENSHIFT_ADMIN and password OPENSHIFT_ADMIN_PASSWORD

Configure KUBECONFIG

Setup KUBECONFIG variable, this variable will be used in by the setup scripts to connect to OpenShift cluster during setup.

mkdir -p "$TUTORIAL_HOME/.kube/config"
export KUBECONFIG="$TUTORIAL_HOME/.kube/config"

As the setup requires OpenShift user with ClusterAdmin privileges, try login with ClusterAdmin user :

# Line 8 of `rosa describe cluster --cluster=my-rosa-cluster` has the API URL
export OPENSHIFT_API_URL=$(rosa describe cluster --cluster=my-rosa-cluster | awk 'NR==8{print $3}')
oc login --server=$OPENSHIFT_ADMIN \
  --user $OPENSHIFT_ADMIN_PASSWORD \
  --password $OPENSHIFT_ADMIN_PASSWORD

You can also view details of the cluster using the details page URL

# Look for Details Page
rosa describe cluster --cluster=my-rosa-cluster

Get the Tutorial sources

Before we start setting up the environment, let’s clone the tutorial sources and set the TUTORIAL_HOME environment variable to point to the root directory of the tutorial:

export TUTORIAL_HOME="$(pwd)/rosa-demos"
cd $TUTORIAL_HOME