Kahibaro
Discord Login Register

Kubernetes Fundamentals

Why Kubernetes Matters for OpenShift

OpenShift is built on top of Kubernetes. To understand OpenShift, you must understand the core ideas, terminology, and behavior of Kubernetes. OpenShift adds opinionated defaults, security features, and additional components, but it does not replace the underlying Kubernetes model.

In this chapter you will:

Later chapters will dive into OpenShift-specific architecture and tools; here we focus on the Kubernetes foundation they rely on.

High-Level View of Kubernetes

Kubernetes is an orchestration platform for containers. At a high level, it provides:

OpenShift exposes all of this Kubernetes functionality, then adds:

When you interact with OpenShift (via the web console or oc CLI), you are ultimately working with Kubernetes concepts such as Pods, Deployments, Services, and the Kubernetes API.

The Cluster and Its Components (Conceptual Overview)

A Kubernetes cluster is a collection of machines (physical or virtual) that run two broad categories of components:

Later sections of the course will unpack the control plane and worker node components in detail. For now, you only need a conceptual picture:

OpenShift’s control plane is a specific, opinionated distribution of the Kubernetes control plane, with additional components and integrations.

Declarative Model and Desired State

A key idea in Kubernetes (and therefore OpenShift) is the declarative configuration model:

This is called desired state. The actual cluster state may drift (pods fail, nodes disappear, images are updated), but the control plane constantly works to drive the actual state back toward the desired state.

You express desired state using YAML or JSON resources that you submit to the API (e.g. via kubectl apply in Kubernetes or oc apply in OpenShift). Examples of desired state:

This declarative pattern underlies many OpenShift features like GitOps, pipelines, and Operators.

Kubernetes Objects and the API

Everything you manage in Kubernetes is represented as an API object (often just called a “resource”). Some common object types you will encounter in OpenShift include:

Each object has:

In YAML, a typical resource looks like:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-deployment
  labels:
    app: example
spec:
  replicas: 3
  selector:
    matchLabels:
      app: example
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
      - name: example
        image: quay.io/example/app:1.0
        ports:
        - containerPort: 8080

OpenShift fully understands these standard Kubernetes objects and adds its own custom resource types for platform-specific features.

Pods: The Basic Execution Unit

While you may think in terms of containers, Kubernetes thinks in terms of Pods:

Common patterns:

Kubernetes generally does not create pods directly in production; instead, higher-level controllers (such as Deployments) manage them. However, you can create a pod directly for simple tests or debugging.

In OpenShift, everything that runs in your project is ultimately a pod (including builds, Jobs, Deployments, etc.). Understanding pod behavior (scheduling, restart policies, status phases) is crucial for troubleshooting.

Controllers and Reconciliation

Most Kubernetes resources that represent “running things” are managed by controllers. A controller is a control loop that:

  1. Watches the desired state (spec) of objects.
  2. Observes the current state of the cluster.
  3. Takes actions to move current state toward desired state.

Examples:

This pattern of continuous reconciliation is fundamental. OpenShift extends it via Operators, which are essentially specialized controllers for more complex applications and platform components.

Key implications:

Namespaces and Multi-Tenancy

Kubernetes clusters are typically multi-tenant. Namespaces are a logical partitioning mechanism:

In OpenShift, a Project is a namespace with some extra metadata and management behaviors. When you create a project, you’re essentially creating a Kubernetes namespace with additional OpenShift integrations (like default network policies, quotas, etc.).

This isolation is central to how OpenShift supports multiple teams or applications on the same cluster.

Workload Patterns: Stateless vs Stateful, Batch vs Long-Running

Kubernetes supports several workload patterns, which OpenShift surfaces directly:

In the OpenShift context, these patterns map to typical application and infrastructure use cases, and later chapters (especially around HPC and batch, or stateful apps) build directly on these primitives.

Scheduling and Placement (Conceptual)

Kubernetes includes a scheduler that decides on which node each pod runs. The basic behavior:

Tools you can use to influence scheduling (all fully supported in OpenShift):

OpenShift adds opinionated defaults and policies (e.g. additional scheduling constraints from Operators), but the underlying scheduling model is pure Kubernetes.

Declarative Management Tools

In upstream Kubernetes, you commonly manage resources with the kubectl CLI and YAML manifests. In OpenShift:

Regardless of tool, the key pattern is:

  1. Define or edit a resource manifest (Deployment, Service, etc.).
  2. Apply it to the cluster.
  3. Kubernetes reconciles the cluster to match that definition.

This is the basis for CI/CD, GitOps, and many operational workflows you will encounter later in the course.

How Kubernetes Fundamentals Map to OpenShift

To connect these ideas back to OpenShift:

Once you’re comfortable with the Kubernetes mental model—API objects, pods, controllers, namespaces, and desired state—you’ll find that OpenShift’s added features are extensions rather than a completely different system.

Summary of Key Takeaways

By the end of this chapter, you should be able to:

Subsequent chapters will drill deeper into architecture details, specific components of the control plane and worker nodes, and how OpenShift extends these Kubernetes foundations.

Views: 16

Comments

Please login to add a comment.

Don't have an account? Register now!