Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 37 ยท Architecture and Concepts

OpenShift vs Kubernetes: What Is Different

A practical comparison of OpenShift and Kubernetes: Projects, Routes, ImageStreams, BuildConfigs, SCCs, the oc CLI and install model, with a runnable translator stand-in.

If you already know Kubernetes, learning OpenShift is mostly learning a short list of differences. If you are new to both, this lesson shows which names belong to which system, so you read documentation without confusion. The summary: OpenShift is a Kubernetes distribution. It is certified conformant, so Kubernetes workloads run, and it adds opinions and features.

Same API, extra APIs

OpenShift exposes the standard Kubernetes API (apps/v1, v1, batch/v1, networking.k8s.io/v1) and adds its own groups such as route.openshift.io, build.openshift.io, image.openshift.io, project.openshift.io, security.openshift.io and config.openshift.io. Because these are ordinary API extensions, oc get routes feels exactly like oc get pods.

The main differences

Topic Kubernetes OpenShift
Namespaces Namespace Project (a namespace plus annotations and self-service creation)
Exposing HTTP Ingress (needs a controller you install) Route plus a built-in router; Ingress also works and is converted to Routes
Building images Not included BuildConfig, Source-to-Image, Tekton Pipelines
Image tracking Image string in the Pod ImageStream with triggers (redeploy when a tag changes)
Pod security Pod Security Admission levels Security Context Constraints (SCCs), with Pod Security Admission alongside
Default user in containers Whatever the image says Random non-root UID from the project's range
Authentication You configure it Built-in OAuth server and identity providers
CLI kubectl oc (a superset of kubectl)
Upgrades Per-component, many methods Cluster Version Operator updates the whole stack
Node OS Your choice RHCOS, managed by the Machine Config Operator
Add-ons Helm charts, manual installs Operators and OperatorHub
Web UI Optional dashboard Full console
Networking Choose a CNI OVN-Kubernetes by default, managed by the Cluster Network Operator

Projects vs namespaces

A Project wraps a Namespace. On plain Kubernetes only administrators normally create namespaces. On OpenShift, a normal user can often run oc new-project, and the platform creates the namespace, makes you its admin and applies a project template (for example default quotas and network policies). This self-service model is a big reason OpenShift suits multi-team use. See Projects and namespaces.

Routes vs Ingress

An Ingress describes HTTP rules but requires you to install an ingress controller. OpenShift ships one, HAProxy-based, and its native object is the Route. Routes support edge, passthrough and re-encrypt TLS, weighted traffic splitting for blue/green and canary, and per-route timeouts. Ingress objects still work: OpenShift creates a managed Route for each rule. Details come in the networking chapter.

Security: the biggest day-one difference

On a default Kubernetes cluster you can run a container as root and bind to port 80. On OpenShift the default restricted security context constraint forces:

  • a non-root, randomly assigned user ID,
  • no privilege escalation,
  • dropped Linux capabilities,
  • a read-only requirement for some host features, and no host networking or host paths.

This is why recipes that deploy nginx unchanged often fail, and why you meet images such as nginxinc/nginx-unprivileged. The lesson is not "OpenShift is stricter and annoying"; it is "OpenShift makes the secure choice the default".

Builds and ImageStreams

Kubernetes expects images to be built elsewhere (CI) and pulled by name. OpenShift can build them inside the cluster and stores the results in an integrated registry. An ImageStream is a pointer to tags in some registry; when the tag's digest changes, the stream can trigger a build or a new rollout. This is optional: you can use plain image names from any registry too.

DeploymentConfig and Deployment

Early OpenShift had DeploymentConfig before Kubernetes had Deployments. Kubernetes Deployment is now the standard, and DeploymentConfig is deprecated in OpenShift 4. New work should use Deployment; the deployments lesson covers migration ideas.

Where Kubernetes knowledge transfers

Nearly everything else transfers directly: Pods, Services, ConfigMaps, Secrets, PersistentVolumeClaims, Jobs, RBAC, taints, probes and Helm charts. A good test is that a Kubernetes manifest with a Deployment and a Service applies unchanged, as long as the image runs under the restricted security rules.

Stand-in: a vocabulary translator

The program below is a lookup table you can extend. It is a study aid, not an official mapping tool, and some mappings are approximate (a Project is a Namespace with extras).

Python Stand-in: Kubernetes to OpenShift vocabulary

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Stand-in: will this Pod pass the restricted rules?

The next stand-in checks a simplified Pod description against three rules from the restricted policy. The real admission logic has many more checks.

Python Stand-in: simplified restricted-policy check

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Should you learn Kubernetes first?

Not strictly, but the concepts of Pods, Services, Deployments and labels are shared. This track explains each as it appears and links the OpenShift-specific view. If you later work with a different distribution or a managed cloud service, the Kubernetes parts carry over unchanged.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which OpenShift object corresponds most closely to a Kubernetes Namespace?

    A Project is a Namespace with extra metadata and a self-service creation workflow.
  2. 2. What does a default OpenShift cluster do with a container that wants to run as root?

    The restricted SCC assigns an unprivileged UID from the project's range; images that require root will fail unless an administrator grants a different SCC.
  3. 3. What happens to a Kubernetes Ingress on OpenShift?

    The Ingress Operator and router support Ingress objects by generating Routes.
  4. 4. Which is the recommended workload object for new applications?

    Deployment is the standard; DeploymentConfig is deprecated in OpenShift 4.
  5. 5. Which statement about Kubernetes manifests on OpenShift is the most accurate?

    OpenShift is a conformant Kubernetes distribution, so standard objects apply. The usual failures come from security assumptions such as root or low ports.

Summary

  • OpenShift is a conformant Kubernetes distribution with extra APIs and opinions.
  • Differences: Projects, Routes, BuildConfigs, ImageStreams, SCCs, OAuth, RHCOS, Operators and the console.
  • The restricted security default is the most common surprise for new users.
  • Prefer Deployment over the deprecated DeploymentConfig.
  • Standard Kubernetes skills and manifests mostly transfer.

Next: Cluster Operators and Machine Config