| Command
|
Used for...
|
Notes
|
| oc whoami
|
See who you are logged in as
|
|
| oc login
|
Log in to the cluster
|
Defaults to using a web login, but user/pass can be provided over the command line
|
| oc new-project
|
Create a new project (namespace)
|
|
| oc describe
|
Get detailed information on a resource instance
|
|
| oc explain
|
Get documentation on a resource object
|
|
| oc api-resources
|
Get a list of all API resources
|
--api-group can be used to limit to certain API groups
|
| oc adm top
|
Get resource usage on pods and similar
|
--sum will show a sum of resource usage
|
| oc events
|
Get high-level logs
|
Helpful for things like image pull or pvc issues
|
| oc debug
|
Open a shell session in the pod or node
|
Uses the first container by default, but as a copy; can also be used to log in to physical nodes
|
| oc rsh
|
Open a shell session in a pod
|
Simpler version of `oc exec`
|
| oc attach -it
|
Connect and create an interactive session with a pod
|
|
| oc port-forward
|
Expose a pod's port on the localhost
|
|
| oc image
|
Get info about an image
|
|
| oc edit
|
Make an edit to a resource's YAML and apply it
|
Useful for modifying the resource easily or in multiple ways
|
| oc patch
|
Make an edit to a resource's field and apply it
|
Useful for very specific edits
|
| oc cp
|
Copy a file into or out of a pod
|
|
| oc rsync
|
Copy a file into or out of a pod
|
Requires the rsync binary on both host and pod container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| skopeo list-tags
|
List all tags for a given image
|
|
| skopeo inspect
|
Get image info like env variables and tags
|
|