This is a complete, hands-on Red Hat OpenShift cheat sheet: install, configure, operate, automate and secure it - with copy-paste commands grouped by task. Bookmark it for day-to-day work, incidents and interviews alike.
OpenShift is Red Hat's enterprise Kubernetes distribution, adding integrated CI/CD (Pipelines/Tekton), image builds, stricter security defaults (SCCs), a developer console and a curated operator ecosystem.
Why you reach for it
- Batteries-included enterprise Kubernetes
- Stronger secure-by-default posture (SCCs, non-root)
- Integrated builds, pipelines and a developer console
Installation
# Local single-node cluster
crc setup && crc start
oc login -u developer https://api.crc.testing:6443Configuration reference
A Route exposing a Service over HTTPS.
apiVersion: route.openshift.io/v1
kind: Route
metadata: { name: web }
spec:
to: { kind: Service, name: web }
port: { targetPort: 3000 }
tls: { termination: edge }Core commands you use daily
oc new-app ghcr.io/acme/web:1.0
oc expose svc/web
oc get routesProjects & apps
oc login -u developer https://api.crc.testing:6443
oc new-project demo
oc new-app ghcr.io/acme/web:1.0
oc expose svc/web
oc get routes
oc rollout status deploy/webAdmin & debug
oc get pods -o wide
oc logs -f deploy/web
oc adm policy add-scc-to-user anyuid -z default
oc describe route webUse it in CI/CD
Build from source in-cluster with a BuildConfig.
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata: { name: web }
spec:
source: { git: { uri: https://github.com/acme/web } }
strategy: { type: Docker }
output: { to: { kind: ImageStreamTag, name: 'web:latest' } }Best-practice checklist
- Work with SCCs - run non-root and drop capabilities
- Use ImageStreams + DeploymentConfigs/Deployments for rollouts
- Adopt OpenShift Pipelines (Tekton) for CI/CD
Common pitfalls to avoid
- Fighting Security Context Constraints by running privileged
- Ignoring ImageStreams and losing automatic rollouts
- Treating it exactly like vanilla k8s and skipping oc tooling
Security quick wins
- Keep the restrictive default SCC; avoid privileged pods
- Use built-in OAuth and per-project RBAC
Works well with
- Kubernetes - Declarative orchestration for containers at scale - self-healing, rolling updates and service discovery.
- Helm - The package manager for Kubernetes - template, version and release your manifests as charts.
- Argo CD - GitOps continuous delivery for Kubernetes - Git is the source of truth, the cluster is reconciled to match.
A cheat sheet is muscle memory on paper - keep it close until the commands live in your fingers.
Want senior help putting Red Hat OpenShift to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.