-
Notifications
You must be signed in to change notification settings - Fork 17
Useful OpenShift Commands
UP https://github.com/CCI-MOC/moc-public/wiki/OpenShift
-
restarts the master service:
systemctl restart atomic-openshift-master
-
log in:
oc login -u <username>:<password>
-
list the projects:
oc projects
-
create a project:
oadm new-project <project name> --description="<project description>"
-
gets current project:
oc project
-
sets current project:
oc project <project name>
-
lists pods in current project:
oc get pods
-
describe a pod:
oc describe pod <a pod name from command 5>
-
cat log from a pod:
oc logs <a pod name from command 5>
-
list nodes:
oc get nodes
-
delete a node:
oc delete <node name>
-
Move the project over to a different region - also can be used to determine the region a project is currently running in.
- oc edit dc/[project name]
a) either add or edit
spec: template: spec: nodeSelector: region: [region name]
-
redeploy the project:
oc -n default rollout latest docker-registry
So far the only time we have had to do this is to move the docker-registry from the default region to the infra region.
Notes:
-
On project creation:
a) oadm new-project uses the default template
b) oc new-project and "Create New Project" (from the GUI) will allow the specification of one project template
c) Cluster admins can use: oc process ... | oc create -f ... (This is still a bit of a research project - haven't used this yet).
see: <https://github.com/openshift/origin/issues/4381>