Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 37 ยท Architecture and Concepts

OpenShift Cluster Architecture

Understand control-plane and worker nodes, etcd, the API server, scheduler, CRI-O, Red Hat CoreOS and the infrastructure services of an OpenShift 4 cluster.

An OpenShift cluster is a group of machines that act as one big computer. This lesson walks through the parts, which machine runs what, and how a request travels from your oc command to a running container. Knowing this makes error messages and upgrade notes much easier to read.

Nodes and their roles

Every machine in the cluster is a node. Nodes have roles:

  • Control plane nodes (historically called masters) run the cluster's brain: the API server, controllers, scheduler and the etcd database. Production clusters have three.
  • Worker nodes run your application Pods.
  • Infrastructure nodes are workers set aside for platform services such as the router, the registry and monitoring. This is optional, and it can keep subscription-counted worker capacity for applications.
flowchart TB
  subgraph CP["Control plane (3 nodes)"]
    API["kube-apiserver<br/>openshift-apiserver"]
    ETCD["etcd"]
    SCH["scheduler"]
    CM["controller managers"]
  end
  subgraph W["Worker nodes"]
    K1["kubelet + CRI-O"] --> POD1["Pods"]
    K2["kubelet + CRI-O"] --> POD2["Pods"]
  end
  CLI["oc / console"] --> API
  API <--> ETCD
  SCH --> API
  CM --> API
  K1 --> API
  K2 --> API

Figure: the control plane stores desired state; workers run containers.

What runs on the control plane

Component Job
etcd A consistent key-value database that stores every API object. Lose it and you lose the cluster's memory, so it is backed up.
kube-apiserver The front door. All reads and writes go through it, with authentication, authorization and admission checks.
openshift-apiserver and OAuth server Serve OpenShift-specific APIs (routes, builds, image streams, projects) and sign-in tokens.
kube-scheduler Chooses a node for each new Pod based on resources, labels, taints and affinity.
controller managers Loops that compare desired and actual state and fix differences (for example, "3 replicas wanted, 2 exist, create one").

What runs on every node

  • kubelet: the agent that talks to the API server and makes the node match the Pods assigned to it.
  • CRI-O: the container runtime. OpenShift uses CRI-O, a lightweight runtime built for Kubernetes, rather than Docker.
  • The operating system: Red Hat Enterprise Linux CoreOS (RHCOS), a minimal, image-based operating system. You normally do not log in and install packages on it. Changes are applied through cluster configuration (see Operators) and nodes update themselves in a rolling fashion.
  • Network components such as the pod network (OVN-Kubernetes is the default) and kube-proxy-like service routing.

You can still reach a node for debugging with oc debug node/<name>, which starts a temporary privileged Pod and gives you a shell. Treat it as a break-glass tool, not routine maintenance.

The life of a request

Suppose you run oc new-app ... or scale a Deployment. What happens?

  1. oc sends an HTTPS request with your token to the API server.
  2. The API server authenticates you (token), authorizes you (RBAC: may this user create Deployments in this project?) and runs admission checks (quota, security constraints).
  3. The object is written to etcd.
  4. The Deployment controller notices and creates a ReplicaSet, which creates Pod objects.
  5. The scheduler picks a node for each unscheduled Pod and records it in the Pod.
  6. The kubelet on that node sees "a Pod is assigned to me", asks CRI-O to pull the image and start containers, and reports status back.
  7. The Endpoints controller adds ready Pods to the Service, and the router (see networking) sends traffic.

Nothing in this chain is a single big command. Each part watches the API and reacts, which is why Kubernetes is called a declarative, level-triggered system: you declare the goal and controllers keep working until reality matches.

Infrastructure services running as Pods

Most platform features are themselves Pods in namespaces that start with openshift-:

Namespace (examples) Service
openshift-ingress The router (HAProxy-based) that serves Routes
openshift-image-registry The integrated image registry
openshift-monitoring Prometheus, Alertmanager and Grafana-style dashboards
openshift-console The web console
openshift-authentication The OAuth server
openshift-etcd etcd

You can list them as an administrator with oc get pods -n openshift-ingress.

A small scheduler stand-in

The real scheduler filters nodes that cannot run a Pod and then scores the rest. The stand-in below does a toy version with CPU and memory. It is a teaching model, not the Kubernetes scheduler.

Python Stand-in: pick a node for a Pod

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.

A controller loop stand-in

Python Stand-in: a controller reconciling replicas

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.

The real controllers work the same way: observe, compare, act, repeat.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which component stores all cluster state?

    etcd is the consistent database behind the API server. Everything else reads and writes through the API.
  2. 2. What container runtime does OpenShift 4 use on its nodes?

    OpenShift uses CRI-O, a runtime designed for Kubernetes.
  3. 3. Which step comes first when you create a Deployment?

    Every request first passes the API server's authentication, authorization and admission checks; only then is it stored and acted upon.
  4. 4. What is an infrastructure node?

    Infrastructure nodes are ordinary workers labelled for platform components, keeping application capacity separate.

Summary

  • Control plane nodes run the API servers, controllers, scheduler and etcd; workers run application Pods.
  • Nodes run RHCOS with the kubelet and the CRI-O container runtime.
  • A request passes authentication, authorization and admission, is stored in etcd, then controllers, the scheduler and kubelets make it real.
  • Platform features such as the router, registry and console run as Pods in openshift-* namespaces.
  • The system is declarative: controllers keep reconciling actual state toward the desired state.

Next: OpenShift vs Kubernetes