Bootstrap FreeKB - OpenShift - Difference between Deployment, StatefulSet, DaemonSet and Rollout
OpenShift - Difference between Deployment, StatefulSet, DaemonSet and Rollout

Updated:   |  OpenShift articles

Typically, with most modern OpenShift deployments, a deployment is used to manage the pods that are created to run an application. The deployment ensures that the desired number of pod replicas are running and can handle updates to the application by rolling out new versions of the pods. The deployment creates and manages a replica set, which in turn manages the pods.

flowchart TB
    subgraph Project["OpenShift Project/Namespace"]
        Deployment[Deployment]
        Replica_Set[Replica Set]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Container]
            Pod2[Pod 2<br/>Container]
            Pod3[Pod 3<br/>Container]
        end
    end
    
    Deployment -->|Creates/Manages| Replica_Set
    Replica_Set -->|Manages| Pod1
    Replica_Set -->|Manages| Pod2
    Replica_Set -->|Manages| Pod3
       
    style Deployment fill:#90CAF9
    style Replica_Set fill:#FFE082
    style Pods fill:#FFCCBC

 

Prior to the introduction of deployments in OpenShift, a deployment config was used to manage the pods that run an application. A deployment config uses a replication controller to manage the pods.

flowchart TB
    subgraph Project["OpenShift Project/Namespace"]
        DC[Deployment Config]
        Replication_Controller[Replication Controller]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Container]
            Pod2[Pod 2<br/>Container]
            Pod3[Pod 3<br/>Container]
        end
    end
    
    DC -->|Creates/Manages| Replication_Controller
    Replication_Controller -->|Manages| Pod1
    Replication_Controller -->|Manages| Pod2
    Replication_Controller -->|Manages| Pod3
       
    style DC fill:#90CAF9
    style Replication_Controller fill:#FFE082
    style Pods fill:#FFCCBC

 

A Rollout is typically used with ArgoCD, to support advanced deployment strategies, such as Blue/Green and Canary deployment strategies.

flowchart LR
    subgraph Project["OpenShift Project/Namespace"]
        Rollout[Rollout]
        Replica_Set[Replica Set]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Container]
            Pod2[Pod 2<br/>Container]
            Pod3[Pod 3<br/>Container]
        end
    end
    
    ArgoCD--> Rollout -->|Creates/Manages| Replica_Set
    Replica_Set -->|Manages| Pod1
    Replica_Set -->|Manages| Pod2
    Replica_Set -->|Manages| Pod3
       
    style Rollout fill:#90CAF9
    style Replica_Set fill:#FFE082
    style Pods fill:#FFCCBC

 

A StatefulSet creates and manages one or more pods running a stateful application (an application that keeps track of the state of something), such as the state of a connection to some backend, such as a SQL database.

flowchart TB
    subgraph Project["OpenShift Project/Namespace"]
        SS[StatefulSet]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Container]
            Pod2[Pod 2<br/>Container]
            Pod3[Pod 3<br/>Container]
        end
    end
    
    SS -->|Creates/Manages| Pod1
    SS -->|Creates/Manages| Pod2
    SS -->|Creates/Manages| Pod3
       
    style SS fill:#90CAF9
    style Pods fill:#FFCCBC

 

A DaemonSet creates and manages pods running on all nodes, such as all worker nodes, all master nodes, or certain nodes, making them ideal for system-level tasks like monitoring agents, log collectors, or networking drivers

flowchart TB
    subgraph Project["OpenShift Cluster"]
        DS[DaemonSet]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Node 1]
            Pod2[Pod 2<br/>Node 2]
            Pod3[Pod 3<br/>Node 3]
        end
    end
    
    DS -->|Creates/Manages| Pod1
    DS -->|Creates/Manages| Pod2
    DS -->|Creates/Manages| Pod3
       
    style DS fill:#90CAF9
    style Pods fill:#FFCCBC

 

It is also noteworthy that a route provides a URL that can be used to access the application from outside the OpenShift cluster. For example, if the route is configured to use the hostname myapp.mydomain.com, then users can access the application by navigating to http://myapp.mydomain.com. The route will forward the request to the service, which will then forward the request to one of the pods that are running the application.

flowchart LR
    subgraph Project["OpenShift Project/Namespace"]
        subgraph Pods["Pod Replicas"]
            Pod1[Pod 1<br/>Container]
            Pod2[Pod 2<br/>Container]
            Pod3[Pod 3<br/>Container]
        end
        
        SVC[Service]
        Route[Route]
    end
      
    USER[External User] --> Route --> SVC
    SVC --> Pod1
    SVC --> Pod2
    SVC --> Pod3
    style SVC fill:#A5D6A7
    style Pods fill:#FFCCBC
    style USER fill:#CE93D8

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 00083c in the box below so that we can be sure you are a human.