As a reminder, our goal (for now) is for each instance of a MongoDB to get a separate volume. 1. So we will create a headless service (service without endpoints) first. When we scale down StatefulSets, the last pod gets deleted. Ordered, graceful deployment and scaling. It is roughly analogous to a Deployment, but tailored to stateful rather than stateless processes. 3343 Perimeter Hill Drive. This can be extended to a scenario where different. 所有pod共享存储 3. Here are some main differences between Deployments and StatefulSets: Deployments are used for stateless applications whereas StatefulSets for stateful applications. You can use StatefulSets to deploy stateful applications and clustered applications that save data to persistent storage, such as Compute Engine persistent disks. Thus, you have one SQL Server instance deployed per pod in the Kubernetes cluster. a cache or database cluster even though it may solve your specific situation as. Examples include databases like MySQL, PostgreSQL, and Redis, HTTP servers like NGINX and Apache, and persistent brokers like Kafka and Zookeeper. . Kubernetes deployments manage stateless services running on your cluster (as opposed to for example StatefulSets which manage stateful services). Deployment. So by passing this flag to kubectl delete the Pods that are managed by. : Using StatefulSets. support@dzone. StatefulSet vs. Q6. StatefulSets. When a PVC or volumeClaimTemplate is requested, Kubernetes chooses an available PV in the system and allocates it to the Deployment or StatefulSets workload. Verify that the Pods are running using the kubectl get pods command. There seems to be a recurring bad practice among the charts in this repository: using a Deployment to manage pods using Persistent Volume Claims, rather than the proper StatefulSet. Kubernetes provides a variety of controllers that you can use to define how pods are set up and deployed within the Kubernetes cluster. Pricing. StatefulSet est l'objet de l'API de charge de travail utilisé pour gérer des applications avec état (stateful). Find a wide-ranging variety of Deployment Vs Statefulset In Kubernetes Statefulset In Kubernetes Explained Stateless Stateful classified ads on our high-quality marketplace. Let's see whether we can solve the problem with PersistentVolumes through a StatefulSet. For example, to create and check a service configuration for an Nginx application, use the following: kubectl expose deployment/nginx-app1. Open this file in a code-editor and write the following code into it: apiVersion: apps/v1. It dictates the needs of dedicated volumes, unique hostname records, and a specific order of deployment. First sentence in the documentation: "The Horizontal Pod Autoscaler automatically scales the number of Pods in a replication controller, deployment, replica set or stateful set". kubectl delete statefulsets <statefulset-name>. There are two primary options for deploying a database on Kubernetes: StatefulSets and custom. It allows you to define the Kubernetes Deployment or StatefulSet that you want KEDA to scale based on a scale trigger. Normally a pod would get a new name if it is killed and respawned by Kubernetes, but if it is managed by a Statefulset it respawns with the same name. That's what happens with Pods when you create a Deployment, and it's a pattern which scales well. DaemonSets replicate a Pod to every Node in your cluster, while StatefulSets provide persistent replica identities. A template describes a set of objects that can be parameterized and processed to…This task shows how to scale a StatefulSet. That's it! With these two commands, you have launched all the components required to run an highly available and redundant MongoDB replica set. It is generated by hashing the PodTemplate of the ReplicaSet and using the resulting hash as the label value that is. Some of the key features of StatefulSets are as follows: 1. This is the expected behavior. Ordered, automated rolling updates. Pods retain their identifiers even if they're restarted or scheduled onto another Node. A pod is a single entity, and if it fails, it cannot restart itself; this won’t suit most use cases, as we want our. In this article we examined how StatefulSets work, and how they differ from a Deployment. I want to deploy a single Pod on a Node to host my service (like GitLab for the example). Coordinators, brokers, and routers are stateless in nature, thus deployments make more sense and avoid complexities to manage statefulsets. Welcome to a comprehensive journey into the heart of Kubernetes deployment strategies – StatefulSets and Stateless Deployments. StatefulSets are a Kubernetes resource specifically designed to manage stateful applications. ReplicaSet vs. At this point we have a running MySQL server, let's use this guide to simulate failover of a node. Now run the kubectl apply command to create the secret in Kubernetes. Headless Services: For stateful applications, use headless services to create stable network identities for each pod. g. While StatefulSet is used for stateful applications, Deployment component is used to deploy stateless. Currently the StatefulSets support only two kinds of update strategies:. A Deployment, on the other hand, is. Similarly, the deployment script. StatefulSets are beneficial for apps that need: Steady and persistent storage. In the previous blog we created a stateless application, deployed with K8s resource Deployment, which allows one to replicate the application, but where data is lost when Pods are restarted, meaning there were no data consistency. Given this difference, Deployment is more suited to work with stateless applications. When you have an app which requires persistence, you should create a stateful set instead of deployment. A big advantage of Kubernetes and StatefulSets is that you can scale the number of MongoDB Replicas up and down with a single command! To scale up the number of replica set members from 3 to 5, run this command: kubectl scale --replicas=5 statefulset mongo. Pods created by a StatefulSet have a unique and stable network identity. Then, the second pod (2) does likewise. To provision a static PV for a Deployment workload, the procedure is as follows: Note: The examples in this section. But, how do you pick which one. I've installed these components in the k8s cluster using the mixin kube-prometheus. Like a Deployment, a StatefulSet. Unlike Deployments or StatefulSets, which manage the deployment of Pods on a per-replica basis, DaemonSets manage the deployment of Pods on a per-node basis. StatefulSets. $ kubectl apply -f secret. The problem is : a Pod will not be re-created after the Node failure (like a reboot). Kubernetes allows requesting and associating persistent storage with pods using persistent volumes and persistent volume claims. you can do that by entering the following command: touch example-statefulset. DaemonSets. The following brings up the StatefulSet including two pods (a leader and a follower), binds the persistent volumes to each pod as well as creates a headless service for it: $ kubectl create ns mehdb. The real distinctions of deployments vs statefulsets are: Ordering of pods. In a production environment it is better to use a declarative operation, e. This page describes the use of StatefulSet objects in Google Kubernetes Engine (GKE). StatefulSet (stable-GA in k8s v1. be/JGtJj_nAA2s Kubernetes Operator explained (manager for your stateful application 🚀) youtu. Perhaps the StatefulSets run some distributed ledger network and each StatefulSet has a different role (e. com. Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Manages the deployment and scaling. Persistent Storage: StatefulSets can manage the creation and deletion of PersistentVolumeClaims (PVCs), ensuring that each pod has a unique persistent storage. Each instance is created one by one, and Kubernetes waits for each one to be up and running before proceeding to the next. We will create the “ redis ” namespace then apply the file. 0. yaml with this way of working, it is easy to store the yaml-files in Git so you have full control of all changes and can revert/rollback. extensions/created. Stateful applications are those which required persistent storage to work aptly. StatefulSets are useful for stateful applications, which require a stable pod name. Statefulsets implement this sticky identity in two ways: Predictable Pod Names: Statefulsets have fixed ordered name in the form of: ${statefulset-name}-{ordinal}. 4. When to use StatefulSets. Requirements of Stateful Applications. To start one replica it needs around 5 Minutes. statefulSet {. Like a Deployment, a StatefulSet manages Pods. service都有ClusterIP,可以负载均衡 StatefulSet适合场景有状态的应用特点1. The StatefulSets are mostly used for deploying Stateful applications where we require a unique network identifier or Storage. Deployment; StatefulSets; DaemonSets “Hay otro, el ReplicationController pero Kubernetes ahora apunta a Deployment que automáticamente crea ReplicaSets. Hint: It starts at FREE. – Jakub. What is the difference between Deployment and StatefulSet components? 🤔 Deployment vs StatefulSet component Pods deployed by Deployment are identical and. If we deploy the statefulset from scratch, Kubernetes starts them one after another. Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. summary, it is possible to set min / max replicas for a statefulset using HPA. I have a kubernetes cluster and I have a simple deployment for mongodb with NFS persistent volume set. deployments should be should be used. You can also create Pods (containers) using the Deployment object in the Kubernetes cluster. As opposed to the Deployment, the StatefulSet creates pods directly. It makes sense for Operators to rely on them and benefit from the pod volume mapping handled by Kubernetes. Deployment. Read stories about Statefulsets on Medium. To our surprise, new pods are not created for the Statefulsets while in a similar scenario news replicas were spun up for deployment sets. Stable, unique network identifiers. also during upgrades and deployments. StatefulSets vs Deployments for stateless applications on Kubernetes. Of course, the scaling depends on the app you are deploying. As the world becomes increasingly digital, companies are turning to cloud-based solutions like Kubernetes to help manage their applications. Un StatefulSet es el objeto de la API workload que se usa para gestionar aplicaciones con estado. This isn't possible using a Deployment. Statefulsets are used for databases where the state of the application is the crucial part of the deployment. Stable Network Identities: StatefulSets provide stable network identities for each pod, making it easy to communicate with specific pods in the set. This page describes the use of StatefulSet objects in Google Kubernetes Engine (GKE). StatefulSets Example Step 1 - Create Kube Environment. I have chosen this option since we are using a single node MariaDB, which works better as a statefulset than as a deployment. StatefulSets are used to scale-out stateful workloads since you define volumeClaimTemplates which allow the K8s Controller to replicate PVCs as you increase replicas. As the Kubernetes manual states: StatefulSets are valuable for applications that require one or more of the following: Stable, unique network identifiers. It maintains order when starting and stopping the pods. If you want to delete just the StatefulSet and not the pods, use --cascade=false. First, we should create some data on our MySQL server: 5. The labels are assigned in the “metadata” section in the deployment. Let's be friends: Explore managing stateful applications with Kubernetes StatefulSets — when to use them, how to deploy MongoDB. After kubernetes 1. Stable, persistent storage. yaml We need to create a pvc. Diferencia entre Statefulset y Deployment en Kubernetes. Ordered Deployment and Scaling. Ordered, graceful deployment and scaling. Stateful sets are used for application storing data in memory, session and handling state. yaml. The example in this blog deploys on Centos7 using kubeadm. A diferencia. A Deployment, on the other hand, is suitable for stateless workloads that use multiple replicas of one pod, such as web servers like Nginx and Apache. It should not be confused with vertical scaling, which means allocating. 1 Like. Once kubectl apply/create is performed, noticed that three persistent volumes are created dynamically. This allows you to easily replicate Pods and attach a storage volume to the Pods. Unlike a. Why use. Deployment manages creating Pods by means of ReplicaSets. your state), so it cannot act as fast as Deployment (stateless) apps can. We will use the gce-pd storage to store the data. Kubernetes Deployment vs. 1. In statefulsets each replica pod created has an index number starting from 0 and it will only setup the next replica if the previous one is running. To summarise, Kubernetes StatefulSet manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods. Pods are created and terminated in a predictable order, ensuring orderly scaling and rolling updates. You are responsible for creating this Service. You can also learn how to Deploy a stateful application. Deployments use ReplicaSets as a mechanism to orchestrate Pod creation, deletion, and updates. What is Statefulsets? A StatefulSet is a controller that helps you deploy and scale groups of Kubernetes pods. They let you ensure that pods are scheduled in a specific order, that they have persistent storage volumes. Elaborate more on this if we should never use Deployment. Thats said, this is an easier solution, and that let you easier scale up to more replicas: When using StatefulSet and PersistentVolumeClaim, use the volumeClaimTemplates: field in the StatefulSet instead. 15. You would often use Statefulset if you want your. yaml. Open rverma-jm opened this issue Apr 7, 2020 · 10 comments. yaml 384 clear 385 kubectl get pods 386 kubectl delete deploy my-dep 387 clear 388 kubectl get pods 389 clear 390 kubectl get pods 391 kubectl apply -f pod1. StatefulSets vs. It is roughly analogous to a Deployment, but tailored to stateful rather than stateless processes. 4. Why not to use the Statefulsets for stateless applications in Kubernetes ? As Stateful sets have the same capabilities as Deployment PVC, HPA, and others. With Deployment, a failed pod will be migrated to other worker. As I mentioned in comments this can be done with help of StatefulSets. The manifest files do not have the namespace added to them. Although Kubernetes is best known for running applications, it's also capable of running databases. StatefulSets. StatefulSets. Statefulsets. Deployments are a great choice for applications that don’t require any state to be maintained. Kubernetes Deployments vs StatefulSets. Pods hold the containers for an application. If a new deployment or statefulset tries to lay claim to a volume claim with the same name as an existing deployment or statefulset, then the new pod(s) will become stuck as unscheduleable. First Note : The pod-template-hash label is added by the Deployment controller to every ReplicaSet that a Deployment creates or adopts. We are creating a StatefulSet called postgresql-db with two pods (replicas: 2). kind: Service metadata: name: redis labels: app: redis spec: type: ClusterIP ports: - name: redis port: 6379 targetPort. 6. A StatefulSets are Kubernetes objects used to consistently deploy stateful application components. However, even when using the same name for the volume claim as before, it seems to be creating an. Key takeaways: What is controller concept in Kuberenetes. You could set spec. [email protected] VS Deployment. 16 or above) deployments in cluster using Prometheus. Any application. StatefulSet Kubernetes | Understand what StatefulSet in Kubernetes is and how it works Using StatefulSet in practice 🙅🏼♀️ youtu. apiVersion: v1 kind: Secret metadata: name: mysecret type: Opaque data: ROOT_PASSWORD: cGFzc3dvcmQ=. 1. These controllers can be used to group pods together according to their runtime needs and define pod replication and pod start up ordering. The primary idea behind StatefulSets is to allow developers to deploy applications that require data to be stored in a filesystem with the ability to re-attach to them if they restart by failure. 而因為有關聯,所以在Deployment下的Label Name,會同樣印在pod上。. For stateless applications, using Deployment objects is most suitable. Assume I have a deployment where I expect 2 repicas to run. The same thing can be done by using StatefulSets. Nashville, TN 37211. For example, you define how many replicas ( pods) of your app you want to run in the. Pods created as part of a StatefulSet are given persistent identifiers that they retain even when they're rescheduled. Remember that the default. Use the right-hand menu to navigate. Grafana Enterprise. 60. In this video, we cover Kubernetes Statefulsets in detail. Not all stateful applications scale nicely. Kubernetes StatefulSets provide two main advantages (for stateful applications) over Deployments: a stable identity of the pods and the ability to follow specific Deployment orders. Using StatefulSets to run Stateful applications at scale. As far as a Deployment is concerned, Pods are interchangeable. We can use the kubectl describe secret command to display additional information about the resource. Deployment vs. Databases such as MySQL and PostgreSQL are examples of applications that are deployed using StatefulSets. . Note: This is not a production configuration. spec: rules: - paths: - path: /app-redis-0 backend: serviceName: redis. Deployment vs StatefulSet component. In practice, StatefulSets are most commonly used to deploy databases (e. 2. Kubernetes is a dynamic platform where objects are usually created in parallel and with random names. StatefulSets(since Kubernetes 1. StatefulSets are the native Kubernetes resources to manage stateful applications. Given this difference, Deployment is more suited to work with stateless applications. 3 ReplicaSet, Deployment, StatefulSet Controllers. It is a simple application to start with since it does not require a complicated setup and it cannot be scaled. $ export MYSQLPOD. 🤝 - LinkedIn - - Threads - - Twitter - (K8s) is an open-source container orchestration system which provides deployments, statefulsets & daemonsets to deploy… 8 min read · Apr 18, 2019 12I want to give my application limited access to get the replicas of different statefulsets (and maybe deployment) and if necessary scale them up or down. This appears to work : kubectl delete statefulsets mariadb -n openstack --force --grace-period=0 --cascade=false. The resource may continue to run on the cluster indefinitely. Sorted by: 21. Author: Peter Schuurman (Google) Kubernetes v1. Deployment is best suited for stateless applications while StatefulSet is best suited for stateful applications. Kubernetes StatefulSet vs. In this article, we will focus on how to deploy a PostgreSQL database on a Kubernetes cluster using StatefulSets. Kubernetes Replication Controller vs Deployment Deployments are intended to replace Replication Controllers. Specifying minReadySeconds slows down a rollout of a StatefulSet, when using a. Kubernetes DaemonSet is a great way to manage and deploy applications in a clustered environment. What are StatefulSets and why are they needed? Deployments vs StatefulSets TL;DR. Ordinals can start from arbitrary non-negative numbers. StatefulSet is the workload API object used to manage stateful applications. This binded volume is claiming ressources through the persistent volume claim. Network Identities: Kubernetes. A Deployment provides the following functions: It allows you to define the. Deployments have two main disadvantages compared with StatefulSets and DaemonSets. We will take the example of Cassandra to learn about statefulset upgrade feature . StatefulSets is a new feature and, as a result, running this example will require an environment based on Kubernetes 1. You may recall that the Deployment controller can perform the update in two ways, depending on the. ReplicaSets fall short when used to deploy a stateful application because they treat all the Pods the same, give them random hostnames and IP addresses that change on restarts. In statefulsets each replica pod created has an index number starting from 0 and it will only setup the next replica if the previous one is running. Before you begin Before you begin this tutorial, you should familiarize yourself with the following Kubernetes concepts: Pods Cluster DNS Headless Services PersistentVolumes PersistentVolume Provisioning The kubectl command line. Because Elasticsearch client nodes are stateless, you can deploy them as Kubernetes Deployments. Statefulsets and Operators are not that similar. Identity and Stable Network hostnames: StatefulSets are used for those applications that require stable network identity and hostnames. The pod template specifies the container image and port to be used for the application. Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods. Deploying a MongoDB Database: Here is an example of how to deploy a MongoDB database using a StatefulSet in Kubernetes. This tutorial will demonstrate Kubernetes StatefulSets as well as PodDisruptionBudgets, and PodAntiAffinity. A StatefulSet is a workload API object for managing stateful applications. Additionally, we are creating a Persistent Volume using the volumeClaimTemplate and using it in the StatefulSet to store the PostgreSQL data. I will help you understand the use of Statefulsets, and also go through the differences between De. Deployments and StatefulSets are the most common way to scale workloads with KEDA. StatefulSets. For hostnames, stable network identifiers please refer to the statefulset basics: For a StatefulSet with N replicas, each Pod in the StatefulSet will be assigned an integer ordinal, from 0 up through N-1, that is unique over the Set A StatefulSet can use a Headless Service to control the domain of its Pods. StatefulSets and DaemonSets. you can do that by entering the following command: touch example-statefulset. Roll back a deployment. Kubernetes deployment drawbacks. A ReplicaSet is used to ensure that a specific number of replicas (copies) of a pod are running at any given time, while a Deployment manages updates to a ReplicaSet by creating a new ReplicaSet with the updated pod template and gradually scaling it up while scaling down the old ReplicaSet. They let you ensure that pods are scheduled in a specific order, that they have persistent storage volumes available, and that they have a persistent network ID that is maintained even when a pod shuts down or is rescheduled. For example, assume you are planning to deploy your Node. Here is a step by step tutorial on how to use StatefulSets and some basic operations on StatefulSets. This sub-command will stop the current rollout and start a new one, using the current configuration settings. Best Practices for Running Stateful Applications on Kubernetes. StatefulSet doesn’t provide any guarantee to delete all pods when StatefulSet is deleted, unlike deployment, which deletes all pods associated with deployment when the deployment is deleted. Ordered, automated rolling updates. Deployments and StatefulSets are the most common way to scale workloads with KEDA. This series walks you through: Building a Kubernetes cluster on cloud providers. Each pod in the StatefulSet will need to have a service linking to it. yaml. All three of these are defined via YAML configuration, are created as an object in the cluster, and are then managed on an ongoing basis by a Kubernetes controller. 5. Provision a Static PV for a Deployment Workload. 申请转载. HPA is a Kubernetes component that automatically updates workload resources such as Deployments and StatefulSets, scaling them to match demand for applications in the cluster. Pods hold the containers for an application. 1 Answer. StatefulSets can be used to create pods with a guaranteed start-up order and unique identifiers. As the world becomes increasingly digital, companies are turning to cloud-based solutions like Kubernetes to help manage their applications. Download and install a kubectl greater than v1. Instead you create Deployments and StatefulSets where a controller takes care of that. This article contains best practices and guidance for running SQL Server containers on Kubernetes with StatefulSets. What then is the advantage of using StatefulSets?Pic from k8s. Ordered deployment, scaling, and rolling updates. The StatefulSet will not. yaml pod2. Not something I thought of a couple a years ago when the chart was made. 2. As in the case of Deployment, a controller is created, but unlike Deployment, it does not create a ReplicaSet , but instead it itself creates replicas from pods and assigns them names. DaemonSets StatefulSets are Kubernetes resources that allow us to deploy and manage the stateful application. yaml file under the current location. Stateful and Stateless Applications. You can see that with the kubectl get deploy and kubectl get statefulset> commands, both are ready. 💡Check out Kubernetes Deployments: The Ultimate Guide to understand more about how Deployments and ReplicaSets are used in a production setting. 4. Stable, persistent storage. In Deployment, all pods are created parallelly. It provides a more graceful method of deployment and scaling and ensures data is available via unique identity. StatefulSets provide the ability to use persistent volumes for each. It is the default strategy when . Why use StatefulSets. Kubernetes users don’t need to worry about how pods are scheduled—they can deploy pods sequentially, attach them to persistent storage volumes, and each pod maintains its own persistent network ID. Oct 12, 2020 Deployments vs StatefulSets in Kubernetes Deployments vs StatefulSets TL;DR Deployments are usually used for stateless applications while StatefulSets are. What is the difference between StatefulSet and Deployment? Ans: A StatefulSet acts as a controller in Kubernetes that manages pods just like Deployments. You may notice two things here: (1) there is only one pod created while we asked for three, and (2) the pod name contains the StatefulSet name. StatefulSets. 2. These concepts are. Each new pod in statefulset then have a new PV attached to them to. Within each pod, is there any way (through environment variable injection or similar) for us to get a unique identifier that. Helm is a deployment orchestrator and includes pre and post hooks that can be used during an install or upgrade. Here is a step by step tutorial on how to use StatefulSets and some basic operations on StatefulSets. Related. spec. Why use StatefulSets. StatefulSetCondition describes the state of a statefulset at a certain point. The operator defaults to creation of StatefulSets. type is set to RollingUpdate,. StatefulSets handle the deployment and scaling of sets of Kubernetes pods, providing guarantees about their uniqueness and ordering. Kubernetes Deployment vs. This is important because many stateful applications have data initialization routines to perform, masters to elect, and quorum to achieve. ReplicaSets . When comparing a Deployment vs Replica Set, the former provides the same replication functions (through Replica Sets) and also the ability to rollout changes and roll them back if necessary. A StatefulSet is better suited to stateful workloads that require persistent storage on each cluster node, such as databases and other identity-sensitive workloads. StatefulSets. 1. Two of the most commonly used resources are Kubernetes Deployment and Kubernetes StatefulSet. Additionally, StatefulSets enables you to reschedule database pods to other nodes. Stable And Ordered. Stable, persistent storage. StatefulSets with Amazon EFS. Replicas in a StatefulSet follow a graceful, sequential approach to deployment, scale, upgrades, and terminations. The Deployment controller creates ReplicaSets which means a bunch of the same pods, same everything, just scheduled individually. In addition to managing the deployment and scaling of a set of Pods, StatefulSets provide guarantees about the ordering and uniqueness of those Pods. Kubernetes provides Deployments for managing application orchestration. Self-managed. stateless applications. So in total we wait 55 Minutes just to fill up the capacity. 26 introduced a new, alpha-level feature for StatefulSets that controls the ordinal numbering of Pod replicas. 3343 Perimeter Hill Drive. However, Operators can go much further than what StatefulSets could possibly offer. Ordered, graceful deletion and termination. Ordering: Kubernetes StatefulSets ensure that each pod is created in a specific order, while Deployments do not. In Kubernetes, a Deployment is a workload resource object that lets you configure the lifecycle of pods in the cluster. I didn't really talk about (3) and (4) but that can also help with clusters as you can tell the first one to deploy to become the master and the next one find the first and treat it as master, etc. Like a Deployment, a StatefulSet manages Pods that are based on an identical container specification. To demonstrate just how pervasive the problem is, one can compare the list of charts using a StatefulSet vs a Deployment. StatefulSets . You can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name. Key differences. And kubectl rollout is used to check the above deployed application. StatefulSets. StatefulSet is the workload API object used to manage stateful applications. This deployment mode is the easiest way to deploy Loki at scale. Introducing Client-Side Field Level Encryption and MongoDB 5. Since uptime-kuma is using SQLite, it only allows. Deployment vs. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. Deployment is a resource to deploy a stateless application, if using a PVC, all replicas will be using the same Volume and none of it will have its own state. Conclusion. While this approach may be sufficient for stateless applications, the Deployment Controller isn't ideal for applications that require: A persistent naming convention or storage. The deployment uses a selector to match labels defined in the pod template. It allows us to automate deployments, scale, and manage. Recreate Strategy. StatefulSets in Kubernetes is a workload API that oversees the deployment and scaling of a set of Pods while preserving stickiness to persistent storage and guaranteeing order and uniqueness. Stable unique network identifiers. S tatefulSet represents a set of Pods with unique, persistent identities and stable hostnames. StatefulSet is used to manage stateful applications: It manages the deployment and scaling of a set of Pods.