OpenShift Project Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[OpenShift_Operations#Subjects|OpenShift Operations]]
* [[OpenShift_Operations#Subjects|OpenShift Operations]]
* [[oadm]]
=Overview=
{{Internal|OpenShift_Concepts#Project|OpenShift Concepts - Projects}}


=List All Projects=
=List All Projects=
Line 11: Line 16:
  oc describe project <''project-name''>
  oc describe project <''project-name''>


=c=
=List All Components of a Project=
 
oc get all
 
=Create a new Project=
 
[[oc new-project]] --display-name='Dev Lab 2' --description='A project created during the Advanced Development Class lab section' devlab2
 
oadm new-project --display-name='Isolated Lab' --description='An isolated Lab Client'  lab
 
=Per-Project Node Selector=
 
In order to [[OpenShift_Node_Selector_Operations#Configuring_a_Per-Project_Node_Selector|set up a per-project node selector]], use:
 
oadm new-project --node-selector='keyA=valueA,keyB=valueB'
 
While the "new-project" subcommand is available for both [[oadm]] and [[oc]], creating a new project with a node selector is only available with the oadm command. The new-project subcommand is not available to project developers when self-provisioning projects.
 
=Modify the Template for New Projects=
 
{{Internal|OpenShift_Template_Operations#Modify_the_Template_for_New_Projects|Template Operations - Modify the Template for New Projects}}
 
=Monitor Project's Event Log=
 
Project events give hints about how the project's application are doing: whether the build or deployment succeeds or fails, details about failures, etc. It is a good idea to monitor the project event's logs when the application goes through build and deployment life cycles.
 
oc get events -w
 
=Deploy a Simple Pod that Allows Arbitrary Commands in a Project=
 
{{Internal|OpenShift Simple Pod Running inside an OpenShift Project|Simple Pod Running inside an OpenShift Project}}
 
=Delete a Project=
 
{{Warn|Deleting a project deletes ''all'' resources associated with the project, even if they are associated with more than one application. If a project includes multiple applications, deleting the project deletes resources for all applications.}}
 
oc delete project <''project-name''>
 
Once deleted, a project goes through a "termination" phase, where all associated resources (pods, etc.) are being deleted and then it disappears from the environment's state.
 
To delete an individual application, see: {{Internal|OpenShift_Application_Operations#Remove_an_Application|Remove an Application}}

Latest revision as of 22:03, 8 December 2017

Internal

Overview

OpenShift Concepts - Projects

List All Projects

oc get projects

Describe a Project

oc describe project <project-name>

List All Components of a Project

oc get all

Create a new Project

oc new-project --display-name='Dev Lab 2' --description='A project created during the Advanced Development Class lab section' devlab2 
oadm new-project --display-name='Isolated Lab' --description='An isolated Lab Client'  lab

Per-Project Node Selector

In order to set up a per-project node selector, use:

oadm new-project --node-selector='keyA=valueA,keyB=valueB'

While the "new-project" subcommand is available for both oadm and oc, creating a new project with a node selector is only available with the oadm command. The new-project subcommand is not available to project developers when self-provisioning projects.

Modify the Template for New Projects

Template Operations - Modify the Template for New Projects

Monitor Project's Event Log

Project events give hints about how the project's application are doing: whether the build or deployment succeeds or fails, details about failures, etc. It is a good idea to monitor the project event's logs when the application goes through build and deployment life cycles.

oc get events -w

Deploy a Simple Pod that Allows Arbitrary Commands in a Project

Simple Pod Running inside an OpenShift Project

Delete a Project


Deleting a project deletes all resources associated with the project, even if they are associated with more than one application. If a project includes multiple applications, deleting the project deletes resources for all applications.

oc delete project <project-name>

Once deleted, a project goes through a "termination" phase, where all associated resources (pods, etc.) are being deleted and then it disappears from the environment's state.

To delete an individual application, see:

Remove an Application