Created
October 5, 2021 23:46
-
-
Save FreedomBen/b4019ca24bf52f68684205d387f28c74 to your computer and use it in GitHub Desktop.
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
- Basic structure | |
- oc <verb> <noun> [name] | |
- There are some exceptions, like `oc help` or `oc logs <pod>` or `oc exec` | |
- Most commands support `oc <command> --help` | |
- Common resources (nouns) | |
- Pods | |
- Deployments | |
- Services | |
- Routes | |
- ConfigMaps | |
- Secrets | |
- Common actions (verbs) | |
- get | |
- get -o {yaml,json} | |
- describe | |
- create | |
- edit | |
- delete | |
- apply | |
- set | |
- patch | |
- label | |
- annotate | |
- expose | |
- scale | |
- autoscale | |
- Common commands that don't follow the verb/noun pattern | |
- oc help | |
- oc login | |
- oc new-project | |
- oc new-app | |
- oc status | |
- oc project | |
- oc explain | |
- Common command examples | |
- oc login -u <username> <apiurl> | |
- oc new-project basic-ocp-demo-development | |
- oc new-app https://github.com/FreedomBen/basic-ocp-demo#development | |
- oc expose svc basic-ocp-demo | |
- oc get pods | |
- oc get pods <podname> | |
- oc get pods <podname> -o yaml | |
- oc get pods <podname> -o json | |
- oc describe pod <podname> | |
- oc delete pod <podname> # see how a new one gets spun up | |
- oc get deploy | |
- oc get deploy <deployname> | |
- oc get deploy <deployname> -o yaml | |
- oc describe deploy <deployname> | |
- oc get services | |
- oc get service <servicename> -o yaml | |
- oc get route | |
- oc get route <routename> -o yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment