Kubectl and OpenShift are the two tools at the center of modern Kubernetes operations. Kubectl is the CLI for Kubernetes. OpenShift is Red Hat’s Kubernetes distribution with built-in security, multi-tenancy, and developer tooling. Knowing how they work together means faster deployments, cleaner workflows, and fewer production surprises.
Kubectl connects directly to the Kubernetes API. It lets you create, update, inspect, and delete resources in a cluster. Pods, deployments, services—all managed in seconds. OpenShift enhances this with its own CLI, oc, which builds on kubectl commands and adds OpenShift-specific features. You can run most kubectl commands in OpenShift because oc supports the same syntax, but it also handles OpenShift objects like Routes, Projects, and BuildConfigs.
Basic kubectl commands for OpenShift:
kubectl get podschecks running workloads.kubectl apply -f resource.yamlapplies changes from a manifest.kubectl logs pod-namestreams container logs.
In OpenShift, these work with the same underlying Kubernetes API. But you’ll often use oc to manage OpenShift’s custom resources or to log into the cluster using OAuth. You can switch between kubectl and oc without losing context, as both respect the kubeconfig file and current namespace.