 What is a deployment? A Kubernetes deployment is a Kubernetes abstraction that tries to fulfill the requested declared state of your application. Doesn't it sound very similar to a replica set? Actually, a deployment contains a replica set. So what's the purpose of a deployment? When you change your replica set by changing the version of your application, for example, you change it the current state of your replica set, and that's it. A deployment, on the other hand, maintains the history of changes applied to itself. This means that you can check this history any time and you're also enabled to perform rollbacks to a particular previous state. If you upgraded your application to version 2.0 and you have any issues in production, you can easily rollback your changes to the immediately previous version or any other version. Let's take a look at the deployment YAML file. You can see here that the kind is deployment and I'm asking for four replicas of this particular container image. Let's see how it works. I'm applying the YAML file and now the containers are creating and you can check that in the bottom of my screen. All of them are running. So what happens when I try to change some configuration of the deployment? The deployment will record this particular change and I'll be able to check this history later. So let's try to update this container image to another version of my application. So I'm changing my Spring Boot application to my Quarkus application. And you can see in the bottom of the screen that I'm already performing and rolling updates. And all my free instances for instances actually are already running. And this change is going to be reported in my rollout history. I have first revision, which was the first version of application. Now I have the second revision of my application, which is already here. And what if something went wrong with my production deployment and I want to rollback to the previous version of my deployment? I can do that simply by typing kubectl rollout undo deploy slash my boot. And if I had more than one revision of my application, I could even specify which number of the revision I want to undo the deployment. I could say two, revision one, in this particular case I only have one before. And when I do that, my deployed is rolled back and that's one of the great advantages of using a deployment. It maintains the history of changes applied to it. And once my deployment change happens very quickly, you see that, yes, I'm already running the previous version of my application. Thanks for watching. Don't forget to like this video and subscribe to our channel.