Kahibaro
Discord Login Register

Application deployment concepts

Core Ideas of Application Deployment on OpenShift

In OpenShift, “deployment” is not just starting containers. It is a controlled, repeatable process of turning a desired application state (what should run, how many replicas, with what configuration) into an actual running workload in the cluster. This chapter focuses on the core concepts that underpin how you deploy applications on OpenShift, independent of any specific mechanism like S2I, Deployments, or CI/CD pipelines.

Desired State and Declarative Deployment

OpenShift (built on Kubernetes) uses a declarative model:

For application deployment, this usually includes:

You typically apply these definitions using the oc CLI or via the web console. Once created, controllers continuously enforce them, automatically redeploying or rescheduling pods as needed.

From Image to Running Application

At a conceptual level, deployment involves several stages:

  1. Application artifact
    • Source code or pre-built container image.
  2. Build (optional in deployment stage)
    • OpenShift can build images (e.g., S2I), but that is a separate phase from deployment itself.
  3. Deployment definition
    • A Kubernetes/OpenShift resource describing how to run the image (e.g., Deployment or DeploymentConfig).
  4. Scheduling and execution
    • The control plane schedules pods to nodes; kubelet starts containers.
  5. Exposure and access
    • Services, routes/ingress, and DNS expose the running pods to other workloads and to users.

In OpenShift, application deployment concepts center around how you define and manage step 3 so that steps 4 and 5 happen reliably and repeatably.

Key Deployment Concepts and Objects

Several resource types participate in application deployment. Details of each are covered elsewhere; here we focus on their conceptual role in deployments.

Workload Controllers

Workload controllers manage pods over time:

Common controllers for stateless applications:

For stateful applications, StatefulSet is used, but the conceptual ideas of desired state, rollout, and replica management are similar.

Pods and Replica Management

A pod is the smallest schedulable unit—one or more tightly coupled containers that share:

Deployment controllers rarely manage pods directly in a one-off way. Instead, they manage a template:

Conceptually:

Labels and Selectors

Labels are crucial to deployment concepts because they tie together controllers, services, and pods.

In deployments:

Consistent labeling is fundamental for clean, manageable deployments.

Deployment Lifecycle

Conceptually, the deployment lifecycle goes through these stages:

  1. Initial deployment
    • Define a deployment object and apply it.
    • Controller creates the first set of pods.
    • Service (if defined) routes traffic to these pods.
  2. Configuration or image change
    • You update the deployment spec (e.g., new image, env var, resource setting).
    • The controller detects the change and creates a new revision.
  3. Rollout
    • The controller incrementally replaces old pods with new ones, according to its strategy.
    • Rollout status indicates whether the deployment is progressing, complete, or failed.
  4. Steady state
    • Desired number of updated pods are running.
    • Controller maintains this state in the face of failures or cluster changes.
  5. Rollback (optional)
    • If the new version is problematic, you can roll back to a previous revision.
    • The controller reverts the pod template to an older version and rolls forward again.

Deployment Strategies (Conceptual)

How pods move from one version to another is often described as a strategy. OpenShift supports various strategies, but conceptually they fall into common patterns:

Recreate

Rolling / RollingUpdate

Blue-Green (Conceptual)

Often implemented via services/routes rather than a built-in strategy:

Canary (Conceptual)

A more granular, gradual rollout:

In OpenShift, canary is usually implemented by adjusting replica counts and routes/services, often assisted by CI/CD tools or service mesh.

Triggers and Automation

Deployments often respond automatically to changes:

OpenShift’s DeploymentConfig offers built-in image and config change triggers conceptually; Kubernetes Deployment can be integrated with CI/CD tools that act as “external triggers.”

Versioning and Revisions

Each significant change to a deployment’s pod template creates a revision:

Conceptually, think of revisions as a deployment’s internal history, separate from your source code or Git history, but related to them.

Readiness, Liveness, and Progressive Traffic

To ensure safe deployments, OpenShift relies on health information from your containers:

In deployment terms:

Resource Management and Scheduling Considerations

Deployment concepts also include where and how your pods run:

When designing deployment specs, you define not only what to run but also constraints on where and with what resources it should run.

Configuration as Part of Deployment

While configuration and secrets management are covered elsewhere, from a deployment perspective:

Good practice is to keep configuration external to the image so you can reuse the same image across environments (dev, test, prod) with different deployment specs.

Deploying Different Types of Applications

Conceptually, deployments can differ by application type:

When designing your deployment, you choose the appropriate controller and strategy for the workload’s characteristics.

Operational Observability of Deployments

From a conceptual standpoint, successful deployment processes are observable and inspectable:

Modern deployment practices treat rollouts as experiments that must be monitored; deployment concepts inherently include this feedback loop.

Policy, Governance, and Guard Rails

In a shared OpenShift cluster, deployments are constrained by policies:

From a conceptual point of view, deployment is not purely a developer concern; it is shaped by platform governance.

Putting It All Together

When you “deploy an application” on OpenShift, conceptually you are:

  1. Defining desired state via deployment resources (what runs, how many, where, and with what configuration).
  2. Choosing or inheriting a strategy for moving from the current version to the next (recreate, rolling, blue-green, canary).
  3. Integrating triggers so new versions or config changes lead to controlled rollouts.
  4. Using labels, selectors, and services to connect deployments to traffic and other services.
  5. Observing and iterating using status, logs, and metrics to validate each rollout.
  6. Operating within cluster policies and constraints that shape what is allowed and how resources are used.

Subsequent chapters will show how these concepts are realized concretely via Source-to-Image, container-based deployments, and specific OpenShift controllers like DeploymentConfig and Deployment, as well as how to manage rolling updates and rollbacks in practice.

Views: 10

Comments

Please login to add a comment.

Don't have an account? Register now!