Last active
April 8, 2019 15:15
-
-
Save gyfoster/092463dd15ab1e6514f21fefa9464ba3 to your computer and use it in GitHub Desktop.
A list of commonly used OpenShift CLI commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Roll back deployment to previous version: | |
$ oc rollback <app-name> --to-version=<deployment-num> | |
Get access to pod where it fails: | |
$ oc debug <pod-name> | |
Create image stream from image in external registry: | |
$ oc import-image <image-name> --from=nexus.my-domain.com:5000/<image-name> --confirm | |
View logs relating to build: | |
$ oc logs build/<build-name> | |
SSH into pod remotely: | |
$ oc rsh <pod> | |
List pods: | |
$ oc get pods | |
List all resources containing text: | |
$ oc get all -o name | grep <text> | |
List all resources pertaining to app: | |
$ oc get all -l app=<app-name> | |
Delete all resources pertaining to app: | |
$ oc delete all -l app=<app-name> | |
Deploy image from remote registry: | |
$ oc new-app my-registry:5000/<image-name> | |
Expose route: | |
$ oc expose svc/<image-name> --hostname=<image-name>.my-domain.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment