Container Service: Project Administration

Overview

OpenShift Project Administration Documentation

Adding Users To A Project

Additional users can be added to a project via the User Interface (UI).

  1. Within the project, navigate to the Resources menu in the left-hand navigation and select Membership.
  2. Click Edit Membership in the upper right-hand corner of the window.
  3. Add the user via their uniqname. The minimal role they will need to access the project is View.

Working With Project Artifacts Based On Names

The basic 'oc' commands of get, describe and delete are generally used directly against the name of the artifact being modified:

$ oc get service
NAME             TYPE
os-docker-svc    ClusterIP

$ oc describe service os-docker-svc

  • Name: os-docker-svc
  • Namespace: sample-project
  • Labels: app=os-docker-svc
  • Selector: app=os-docker-svc, deploymentconfig=os-docker-svc
  • Type: ClusterIP
  • IP: 172.30.72.129
  • Port: 80-tcp 80/TCP
  • Endpoints: <none>
  • Port: 443-tcp 443/TCP
  • Endpoints: <none>
  • Session Affinity: None

Working With Project Artifacts Based On Labels

The oc commands can also be used to work with project-level artifacts via labels. Labels can be used to categorize a group of artifacts so they can be administered together. Labels are useful here, because they allow you to get/delete all artifacts that have a certain label without deleting anything that doesn't have that label. To see what labels are affixed to a particular artifact, use the describe command:

$ oc describe rc/sampleapplication
...
Labels: app=somelabel

You can then delete all artifacts with that label--in this case builds--by running the following command:

$ oc delete builds -l app=somelabel
build "sampleapplication-1" deleted
build "sampleapplication-2" deleted

To delete everything with that label, run the following command.

WarningThis will delete all pods, services and deployment configurations. Do not do this in a running production application!

$ oc delete all -l app=somelabel
buildconfig "sampleapplication" deleted
build "sampleapplication-1" deleted
build "sampleapplication-2" deleted
imagestream "sampleapplication" deleted
deploymentconfig "sampleapplication" deleted
service "sampleapplication" deleted

Last Updated: 
Tuesday, June 2, 2020