Setup
This tutorial was developed and tested with:
|
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 |
---|---|---|---|
|
|||
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|
||
nodeJS |
|||
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.
|
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
|
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:
git clone https://github.com/kameshsampath/rosa-tutorial.git rosa-demos
export TUTORIAL_HOME="$(pwd)/rosa-demos"
cd $TUTORIAL_HOME