Accessing the Lab
| Refer back to this page if you need the login info |
The bastion provided with the workshop has the aws and rosa command line tools already installed and logged in. The oc command is installed, but not authenticated.
Use this command to login to the PROD environment:
oc login -u {rosa_prod_openshift_admin_user} -p {rosa_prod_openshift_admin_password} {rosa_prod_openshift_api_url}
Use this command for the DR environment:
oc login -u rosa_dr_openshift_admin_user -p rosa_dr_openshift_admin_password rosa_dr_openshift_api_url
OpenShift context management
At this point, you are logged in both ROSA clusters on the command line.
When using the oc tool, you can easily switch between clusters, by using the command oc config use-context.
However, as the context names are pretty long, it is a good practice to rename them with the oc config rename-context command to avoid typing errors.
oc config rename-context $(oc config get-contexts | grep -E default.*api-prod | cut -c 11- | awk '{print $1}') PROD
oc config rename-context $(oc config get-contexts | grep -E default.*api-dr | cut -c 11- | awk '{print $1}') DR
Let’s quickly check this was succesfully applied:
oc config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* DR api-dr-p4p6h-t9k7-p1-openshiftapps-com:6443 cluster-admin/api-dr-p4p6h-t9k7-p1-openshiftapps-com:6443 default
PROD api-prod-p4p6h-jtx8-p1-openshiftapps-com:6443 cluster-admin/api-prod-p4p6h-jtx8-p1-openshiftapps-com:6443 default
You should alrady be logged into the DR environment, as indicated by the * in the first column of the output.
To swtich contexts, use the following command with the DR or PROD context name.
oc config use-context PROD
oc config use-context DR
| You will need to be in the DR context for the next part of the lab. |
OpenShift Console Login
| Environment | URL | User | Password |
|---|---|---|---|
PROD |
{rosa_prod_openshift_console_url}[window=_blank] |
|
|
DR |
rosa_dr_openshift_console_url[window=_blank] |
|
|
Terminal Management
As this lab environment is restricted to a single terminal, it is recommended to use the terminal multiplexer, tmux.
tmux is already installed and allows you to create and manage multiple, switchable terminal sessions, all within a single active window.
If the connection to the lab environment is interrupted, the session remains active, allowing you to reconnect and resume work.
You can run tmux at any time from the command line
Cheat Sheet
All tmux commands start with the Ctrl+b prefix key sequence, followed by the command key.
| Action | Command (Prefix + Key) | Purpose |
|---|---|---|
Create New Window |
|
Creates a new terminal tab (window) within your session. |
Switch to Next Window |
|
Moves to the next window/tab (e.g., from tab 0 to tab 1). |
Switch to Previous Window |
|
Moves back to the previous window/tab. |
Switch by Number |
|
Jumps directly to the window number (0 is the first window). |
List Windows |
|
Shows a full, selectable list of all windows in the current session. |
Detach Session |
|
Closes the terminal window but keeps the session running in the background. |
Re-attach Session |
|
Reconnects to the last active background session after a disconnect. |