This is a cache of https://docs.openshift.com/container-platform/4.1/applications/projects/working-with-projects.html. It is a snapshot of the page at 2024-11-23T02:48:31.285+0000.
Working with projects - Projects | Applications | OpenShift Container Platform 4.1
×

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 default projects. These projects host cluster components that run as Pods and other infrastructure components. 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.

Creating a project using the web console

If allowed by your cluster administrator, you can create a new project.

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- using the web console.

Procedure
  1. Navigate to HomeProjects.

  2. click Create Project.

  3. Enter your project details.

  4. click Create.

Creating a project using the cli

If allowed by your cluster administrator, you can create a new project.

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.

Procedure
  1. Run:

$ 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"

The number of projects you are allowed to create may be limited by the system administrator. After your limit is reached, you might have to delete an existing project in order to create a new one.

Viewing a project using the web console

Procedure
  1. Navigate to HomeProjects.

  2. Select a project to view.

    On this page, click the Resources button to see workloads in the project and click the Dashboard button to see metrics and details about the project.

Viewing a project using the cli

When viewing projects, you are restricted to seeing only the projects you have access to view based on the authorization policy.

Procedure
  1. To view a list of projects, run:

    $ oc get projects
  2. 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>

Adding to a project

Procedure
  1. Navigate to HomeProjects.

  2. Select a project.

  3. In the upper right-hand corner of the Project Status menu, click Add, then choose from the provided options.

Checking project status using the web console

Procedure
  1. Navigate to HomeProjects.

  2. Select a project to see its status.

Checking project status using the cli

Procedure
  1. Run:

    $ oc status

    This command provides a high-level overview of the current project, with its components and their relationships.

Deleting a project using the web console

Procedure
  1. Navigate to HomeProjects.

  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 menu. If you do not have permissions to delete the project, the Delete Project option is grayed out and the option is not clickable.

Deleting a project using the cli

When you delete a project, the server updates the project status to Terminating from Active. Then, the server clears all content from a project that is in the Terminating state before finally removing the project. While a project is in Terminating status, you cannot add new content to the project. Projects can be deleted from the cli or the web console.

Procedure
  1. Run:

    $ oc delete project <project_name>