2. First steps
In this lab, we will interact with the OpenShift cluster for the first time.
Warning
Please make sure you completed Setup before you continue with this lab.
Projects
As a first step on the cluster, we are going to create a new Project.
A Project is a logical design used in OpenShift to organize and separate your applications, Deployments, Pods, Ingresses, Services, etc. on a top-level basis. Authorized users inside a Project are able to manage those resources. Project names have to be unique in your cluster.
Task 2.2: Create a Project
Create a new Project in the lab environment. The oc help
output can help you figure out the right command.
Note
Please choose an identifying name for your Project, e.g. your initials or name as a prefix. We are going to use <namespace>
as a placeholder for your created Project.
Solution
To create a new Project on your cluster use the following command:
oc new-project <namespace>
Note
In order to declare what Project to use, you have several possibilities:
- Some prefer to explicitly select the Project for each
oc
command by adding--namespace <namespace>
or-n <namespace>
- By using the following command, you can switch into another Project instead of specifying it for each
oc
command
oc project <namespace>
Task 2.3: Discover the OpenShift web console
Discover the different menu entries in the two views, the Developer and the Administrator view.
Display all existing Pods in the previously created Project with oc
(there shouldn’t yet be any):
oc get pod --namespace <namespace>
Note
With the command oc get
you can display all kinds of resources.