Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Openshift: Lab 1 – Use the terminal window within the Red Hat OpenShift web console

In this lesson, you will learn how to access the terminal window within the Red Hat OpenShift web console and use it to work with various OpenShift and Kubernetes resources that are available in the OpenShift cluster to which the web console is bound.

What you need to know

In order to get full benefit from taking this lesson, you need to:

  • Have a basic understanding of the nature and use of Kubernetes as aย containerย orchestration framework.
  • Understand the relationship between OpenShift and Kubernetes.
  • Have aย basic understanding of the nature and purpose of theย kubectlย CLI tool.
  • Know how to access your dedicated instance of theย Developer Sandbox.

What you will learn

In this lesson you will learn:

  • How to access the terminal window thatโ€™s embedded within the OpenShift web console.
  • How to use theย kubectlย andย ocย CLI tools to interact with the various Kubernetes resources within the OpenShift cluster.

Access the terminal window

To reach the OpenShift terminal window within your no-cost Developer Sandbox cluster, complete the following steps:

  1. Using your web browser, navigateย hereย (Figure 1, Callout 1).
  2. Selectย Start your sandbox for freeย (Figure 1, Callout 2).ย Figure 1: The entry point for access.
  3. Once you’re in the OpenShift web console, click theย terminal promptย icon in the upper right corner of the web page (Figure 2, Callout 1) to display the command-line terminal (Figure 2, Callout 2).ย You can use the terminal window to interact directly with the underlying Kubernetes cluster powering the OpenShift instance.ย Figure 2: The OpenShift web console can display a terminal window that enables direct interaction with the underlying Kubernetes cluster in the OpenShift instance.

Work with the oc and kubectl CLI tools from within the terminal window

The terminal window thatโ€™s embedded within the OpenShift web console is a full blown instance of aย Linuxย terminal. There, you can do the same command-line activities you would normally run in a standalone terminal. Also, the OpenShift web console terminal window allows you to work easily with the OpenShift instance and its underlying Kubernetes cluster.

OpenShift has both theย ocย andย kubectlย  CLI tools pre-installed and configured to access the underlying Kubernetes cluster within the OpenShift instance. Thus, you can interact with OpenShift and the underlying Kubernetes from the command line.

Theย ocย CLI tool has much of the same functionality thatย kubectlย provides. However,ย ocย can go a bit further and allow you to execute behavior that is special to OpenShift. For example, you can useย ocย to install an application into OpenShift without having to negotiate the complexities of application deployment in Kubernetes.

The following exercises demonstrate how to use theย ocย andย kubectlย CLI tools to execute basic tasks from the terminal windowโ€™s command line. The exercises also demonstrate the close relationship between OpenShift and Kubernetes.

Get version information

Run the following command in the OpenShift terminal to get version information aboutย ocย CLI tool:

oc version

You will see output similar to the following:

Client Version: 4.10.6

Server Version: 4.10.28

Kubernetes Version: v1.23.5+012e945Code language: CSS (css)

The results of theย ocย versionย command display the version numbers of theย ocย CLI client, the server powering the current OpenShift instance and as well as the version number of the underlying instance of Kubernetes used by the cluster.

View resources using oc or kubectl

Run the following command in the OpenShift terminal to get a list of pods running in the current instance of OpenShift using theย ocย CLI tool:ย 

oc get podsCode language: JavaScript (javascript)

You will receive output similar to the following:

NAME                                        READY   STATUS    RESTARTS   AGE

workspace1e8db31dd59c43ef-8585ff4cc-24ww6   2/2     Running   0          22s

Run the following command in the OpenShift terminal to get a list of pods running in the current instance of OpenShift using theย kubectlย CLI tool:ย 

kubectl get podsCode language: JavaScript (javascript)

You will receive output similar to the following:

NAME                                        READY   STATUS    RESTARTS   AGE

workspace1e8db31dd59c43ef-8585ff4cc-24ww6   2/2     Running   0          22s

Notice that the output from executingย oc get podsย andย kubectl get podsย is identical. This is because bothย ocย andย kubectlย are querying the same underlying Kubernetes cluster to get a list of pods. This is direct evidence of the tight relationship between OpenShift and Kubernetes.ย 

Remember, OpenShift is a layer of components that โ€œsit on topโ€ of an underlying Kubernetes cluster. The important thing to understand is that theย ocย CLI tool provides functionality available in theย kubectlย CLI tool. In many cases, you can useย ocย andย kubectlย interchangeably.

Summary

In this lesson, you learned how to access the terminal window embedded in the OpenShift web console. Also, you learned how to use the terminal window to execute commands using theย ocย andย kubectlย CLI tools. You executed bothย oc get podsย andย kubectl get podsย to list the same set of pods running in the Kubernetes cluster thatโ€™s foundational to OpenShift.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Best DevOps Tools in 2024

hereโ€™s a clear, structured breakdown of the Best DevOps Tools (grouped by categories), so you can use it for learning, training, or posts. ๐Ÿš€ Best DevOps Tools…

Read More

OpenShift Tutorial โ€“ Deploy and Access Your First Applications using OpenShift Local

How to install oc? OpenShift: How to Install OpenShift CLI oc How to login? Login to the Openshift using Web Console and CLI using oc Copy the admin…

Read More

OpenShift Lab 14: Setting Up and Using OpenShift Serverless Functions on OpenShift Local

Lab Objective In this lab, you will install and use OpenShift Serverless Functions on OpenShift Local. You will create a simple Node.js serverless function, deploy it to…

Read More

OpenShift Lab 13: Deploy a Java Spring Boot Application with MySQL Using the OpenShift Web Console

Lab Objective In this lab, you will deploy a Java Spring Boot application on OpenShift using the OpenShift web console. You will deploy two components: The Java…

Read More

OpenShift Lab 12: Deploy an Application from an Existing Container Image Using the OpenShift Web Console

Lab Objective In this lab, you will deploy an application on OpenShift from an existing container image. This lab is different from building an application from source…

Read More

OpenShift: How to Install OpenShift CLIย oc

Option – 1 – REDHAT Websites URL – https://access.redhat.com/downloads/content/290/ver=4.18/rhel—9/4.18.11/x86_64/product-software Option – 2 – OKD Websites The OKD (Origin Community Distribution of Kubernetes for OpenShift) is the open-source…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x