Skip to content

CLI reference

The platform is driven with oc, the OpenShift CLI. There is no bespoke GRN CLI to install.

oc is a superset of kubectl — every kubectl command works under oc, plus the OpenShift-specific ones. These docs use oc throughout, and so do the GRN cluster repositories.

Tool What it is for
oc The primary CLI — workloads, projects, routes, RBAC, oc adm
virtctl Virtual machine operations — console, VNC, start/stop, image upload
helm Standard charts, no platform-specific packaging
argocd GitOps reconciliation, when you drive Argo CD from a terminal

Installation instructions are in Access the platform.

Everyday commands

# Where am I?
oc whoami
oc project
oc config current-context

# What exists here?
oc get all -n <project>
oc get pvc,secret,networkpolicy -n <project>

# What went wrong?
oc get events -n <project> --sort-by=.lastTimestamp
oc describe pod <pod> -n <project>
oc logs <pod> -n <project> --previous     # logs from the crashed instance

Projects

oc new-project <project>
oc project <project>                      # switch
oc get projects

Virtual machines

virtctl start <vm> -n <project>
virtctl console <vm> -n <project>
virtctl stop <vm> -n <project>
oc get vmi -n <project> -o wide           # running instances and their IPs

Applying manifests

oc apply -f manifest.yaml -n <project>
oc apply -k .                             # a kustomization directory
oc diff -f manifest.yaml -n <project>     # what would change, before it changes

oc diff before oc apply

On anything you did not write five minutes ago, diff first. It reads the live object and shows you exactly what your apply would alter.

Administration

oc adm policy add-role-to-user edit <user> -n <project>
oc adm top nodes
oc adm top pods -n <project>

Scaffold status

Platform-specific commands will be generated from source once the command surface is stable, rather than transcribed by hand.