LinuxCommandLibrary

oc

TLDR

Login to cluster

$ oc login [https://api.cluster:6443]
copy
Get resources
$ oc get [pods|services|deployments]
copy
Create from YAML
$ oc apply -f [manifest.yaml]
copy
Switch project
$ oc project [project_name]
copy
View logs
$ oc logs [pod_name]
copy
Execute in pod
$ oc exec -it [pod_name] -- [command]
copy

SYNOPSIS

oc [command] [options]

DESCRIPTION

oc is the OpenShift CLI. Manages OpenShift/Kubernetes clusters.
The tool extends kubectl with OpenShift features. Primary interface for OpenShift.
oc manages OpenShift clusters.

PARAMETERS

login URL

Authenticate to cluster.
get RESOURCE
List resources.
apply -f FILE
Apply configuration.
project NAME
Switch project/namespace.
logs POD
View pod logs.
exec POD
Execute in pod.
--help
Display help information.

CAVEATS

OpenShift specific extensions. Compatible with kubectl. Requires cluster access.

HISTORY

oc was developed by Red Hat as the command-line interface for OpenShift Container Platform.

SEE ALSO

kubectl(1), docker(1), podman(1)

Copied to clipboard