Skip to content

Instantly share code, notes, and snippets.

View brandonwilliamsised's full-sized avatar

Brandon Williams brandonwilliamsised

  • Innovation, Science and Economic Development Canada
  • Ottawa, ON, Canada
View GitHub Profile
@brandonwilliamsised
brandonwilliamsised / openshift_cli_tricks.MD
Created September 8, 2021 15:56 — forked from tuxfight3r/openshift_cli_tricks.MD
openshift cli tricks - using go templates

openshift list all pods and thier specs (requests/limits)

oc get pod -o jsonpath='{range .items[*]}{"SPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'

openshift list all pods and thier specs with name (requests /limits)

oc get pod -o jsonpath='{range .items[*]}{"NAME:  "}{.metadata.name}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile