Kubernetes Workload Resources: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* https://kubernetes.io/docs/concepts/workloads/pods/#workload-resources-for-managing-pods
=Internal=
=Internal=
* [[Kubernetes_Pod_and_Container_Concepts#Pod|Pod and Container Concepts]]
* [[Kubernetes_Pod_and_Container_Concepts#Pod|Pod and Container Concepts]]
 
=Overview=
=<span id='Workload_Resource'></span>Overview=
Workload resources exist to create and manage Pods, which should not usually be created directly. Various workload resources implement different operational patterns. The pod-managing resources described here are some times referred to as higher-level pod controllers or "templated controllers".
Workload resources exist to create and manage Pods, which should not usually be created directly. Various workload resources implement different pod operational patterns. The pod-managing resources described here are some times referred to as higher-level pod controllers or "templated controllers".


From the simplest to the most complex ones, the workload resources are Jobs, CronJobs, ReplicaSets, Deployments, DaemonSets and StatefulSets.
From the simplest to the most complex ones, the workload resources are Jobs, CronJobs, ReplicaSets, Deployments, DaemonSets and StatefulSets.


[[Kubernetes_Job#Overview|Jobs]] and CronJobs are aimed mainly at running individual pods, as part of one-off or repeated executions.
[[Kubernetes_Job#Overview|Jobs]] and [[Kubernetes_CronJob#Overview|CronJobs]] are aimed mainly at running individual pods, as part of one-off or repeated executions.


A [[Kubernetes_ReplicaSet|ReplicaSet]] is a workload resource aimed at maintaining a stable set of replica Pods running at any given time, guaranteeing the availability of a specified number of identical Pods.  
A [[Kubernetes_ReplicaSet|ReplicaSet]] is a workload resource aimed at maintaining a stable set of replica Pods running at any given time, guaranteeing the availability of a specified number of identical Pods.  


The [[Kubernetes_Deployments#Overview|Deployment]] is a resource that delegates to a ReplicaSet.
The [[Kubernetes_Deployments#Overview|Deployment]] is a resource that delegates to a ReplicaSet. The deployment enhances a ReplicaSet semantics with things like deployment strategy. An older, deprecated alternative to Deployments are [[Kubernetes_ReplicationController|ReplicationControllers]].
 
<font color=darkkhaki>These controllers are part of and supervised by the controller manager</font>.
 
<font color=darkkhaki>Describe the relationship between pod, deployment, ReplicaSet and workload resources. Which one are controllers and which are not?</font>
 
=Controller=
TODO: https://kubernetes.io/docs/concepts/workloads/pods/#pods-and-controllers
 


A workload resource has an associated controller. The controller handles replication, rollout and automatic healing in case of pod failure. For example if a node fails, a controller notices that the pods on that node have stopped working and creates replacement pods, which are scheduled on healthy nodes.
[[Kubernetes StatefulSet|StatefulSet]] is the workload API object used to manage stateful applications. [[Kubernetes DaemonSet|DaemonSet]] runs one instance of a pod on every node in the cluster.
=Workload Resources=
* [[Kubernetes_Job#Overview|Job]]
* [[Kubernetes_CronJob#Overview|CronJob]]
* [[Kubernetes_ReplicaSet|ReplicaSet]]
* [[Kubernetes_Deployments#Overview|Deployment]]
* [[Kubernetes_ReplicationController|ReplicationController]] (deprecated)
* [[Kubernetes StatefulSet|StatefulSet]]
* [[Kubernetes DaemonSet|DaemonSet]]


Workload resources:
=Controllers=
* <span id='Deployment'></span>[[Kubernetes Deployments|Deployment]]
{{External|https://kubernetes.io/docs/concepts/workloads/pods/#pods-and-controllers}}
* <span id='StatefulSet'></span>[[Kubernetes StatefulSet|StatefulSet]]
* <span id='DaemonSet'></span>[[Kubernetes DaemonSet|DaemonSet]]
* <span id='Job'></span>[[Kubernetes Job#Overview|Job]]
* <span id='CronJob'></span>[[Kubernetes CronJob#Overview|CronJob]]


=To Distribute=
Each of the workload resources specified above is backed by a controller and state reconciliation loop. The controller for the resource handles replication and rollout and automatic healing in case of Pod failure. For example, if a Node fails, the controller notices that Pods on that Node have stopped working and creates a replacement Pod. The scheduler places the replacement Pod onto a healthy Node. All these controllers are supervised by the controller manager.
====ReplicationController====
{{Internal|Kubernetes ReplicationController|ReplicationController}}

Latest revision as of 20:30, 13 July 2023

External

Internal

Overview

Workload resources exist to create and manage Pods, which should not usually be created directly. Various workload resources implement different operational patterns. The pod-managing resources described here are some times referred to as higher-level pod controllers or "templated controllers".

From the simplest to the most complex ones, the workload resources are Jobs, CronJobs, ReplicaSets, Deployments, DaemonSets and StatefulSets.

Jobs and CronJobs are aimed mainly at running individual pods, as part of one-off or repeated executions.

A ReplicaSet is a workload resource aimed at maintaining a stable set of replica Pods running at any given time, guaranteeing the availability of a specified number of identical Pods.

The Deployment is a resource that delegates to a ReplicaSet. The deployment enhances a ReplicaSet semantics with things like deployment strategy. An older, deprecated alternative to Deployments are ReplicationControllers.

StatefulSet is the workload API object used to manage stateful applications. DaemonSet runs one instance of a pod on every node in the cluster.

Workload Resources

Controllers

https://kubernetes.io/docs/concepts/workloads/pods/#pods-and-controllers

Each of the workload resources specified above is backed by a controller and state reconciliation loop. The controller for the resource handles replication and rollout and automatic healing in case of Pod failure. For example, if a Node fails, the controller notices that Pods on that Node have stopped working and creates a replacement Pod. The scheduler places the replacement Pod onto a healthy Node. All these controllers are supervised by the controller manager.