Working with projects in Openshift

Debjani Chatterjee
Tech4Noobs
Published in
3 min readJun 30, 2020

A project allows a community of users to organize and manage their content in isolation from other communities.

Projects starting with openshift- and kube- are considered critical by OpenShift Container Platform. As such, OpenShift Container Platform does not allow you to create Projects starting with openshift- or kube- using the oc new-project command. Cluster administrators can create these Projects using the oc adm new-project command.

If you are the cluster administrator, which in this case you are, you can create the projects using the following commands. More explanation on being an OpenShift admin/developer will be covered in another post and linked here. Read the explanation after the first 2 basic tutorials.

Create a project on console

Check your access from the cli

ibmcloud oc cluster ls

View project using the CLI

  1. To view a list of projects, run:

$ oc get projects

  1. You can change from the current project to a different project for CLI operations. The specified project is then used in all subsequent operations that manipulate project-scoped content:

oc project <project_name>

Create a project from CLI

oc new-project <project_name> \ --description="<description>" --display-name="<display_name>"

For example:

$ oc new-project hello-openshift \ --description="This is an example project" \ --display-name="Hello OpenShift"

Viewing a project using the web console

  1. Navigate to Home → Projects.
  2. Select a project to view.

On this page, click the Workloads button to see workloads in the project.

Delete a project using the console

  1. Navigate to Home → Projects.
  2. Locate the project that you want to delete from the list of projects.
  3. On the far right side of the project listing, select Delete Project from the Options menu.
  4. When the Delete Project pane opens, enter the name of the project that you want to delete in the field.
  5. Click Delete.

Delete a project from CLI

Run oc delete project <project_name>

Resources : https://cloud.ibm.com/docs/openshift?topic=openshift-deploy_app#app_cli

--

--