 What is a replica set? Remember when we mentioned that Kubernetes uses a declarative approach for the desired state of our application? A replica set is a Kubernetes abstraction that tries to fulfill your request for a certain number of instances of your containers. If you create a replica set with two instances of a particular container, Kubernetes will schedule the execution of those two instances across the nodes of your Kubernetes cluster. And suppose any of those instances becomes unhealthy and dies or gets terminated. In that case, Kubernetes will create another instance so that you always have the two instances that you requested in your replica set. We rarely use replica sets directly as it's usually tied with a Kubernetes deployment, but for education purposes, let's create an independent replica set. Let's take a look at the YAML file for a replica set. You can see here that I have the kind which is of type replica set. I can give a name. I can also specify the number of replicas, which in our particular case is 3, and I can specify what are the containers that I need to execute, which are in this particular case named quarkus-demo and the image is this one, key.io-rh-developers-quarkus-demo version 1. So let's see what happens when I apply this YAML file to my Kubernetes cluster. You can see that as soon as I apply the file, I already have pods being created in the lower side of my screen. And since my replica set requested three different instances of my application running in production, I already have these three different pods running in my cluster. And what happens when I delete one of these pods? So suppose that I ask one of these pods to be deleted, for example, this one. And please pay attention because it's going to be super fast. As soon as I hit the button here, as I ask it to be deleted, Kubernetes is already terminating the pods and another instance is already running. So it doesn't matter how many pods I kill, Kubernetes, the replica set, we always guarantee that I have the desire to request a number of instances running into production. Thanks for watching. Don't forget to like this video and subscribe to our channel.