Skip to content

Instantly share code, notes, and snippets.

@hemanth22
Forked from FreedomBen/oc-quick-reference.md
Created December 4, 2021 13:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemanth22/49dc089149f2f2d95066334a134a828b to your computer and use it in GitHub Desktop.
Save hemanth22/49dc089149f2f2d95066334a134a828b to your computer and use it in GitHub Desktop.

Quick Reference

  • Basic structure
    • oc [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
    • 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
    • oc get pods -o yaml
    • oc get pods -o json
    • oc describe pod
    • oc delete pod # see how a new one gets spun up
    • oc get deploy
    • oc get deploy
    • oc get deploy -o yaml
    • oc describe deploy
    • oc get services
    • oc get service -o yaml
    • oc get route
    • oc get route -o yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment