 What is a label? When you deploy your first application in Kubernetes or even another two or three It's easy to manage the resources and apply the appropriate commands by referencing their names, for example But when you need to organize those resources better or when you want to apply some changes or commands in only a subset of those resources, you need something else That's why we have labels Kubernetes labels are key value pairs that can be attached to resources You can attach multiple labels to the same resource just like you can apply multiple labels to a particular email in your email web clients Once you have labels attached to your resources, you can use these labels as selectors You can delete or update all resources with a particular label and Even Kubernetes services use labels to determine which pods are part of a load balancing group Let's take a look at how labels work in press Already have three different deployments Each one of two instances I have a mygo deployment I'm my node deployment and I'm my Python deployment and now I have six pods Let's take a look at them and try to list the labels as well. You see that each one of those pods have different labels So one of the use cases of labels is that labels allow us to filter the resources in which my Commands are applied so suppose that I want to delete the pods and I only want to delete the pods that have a certain label So, how can I do that? I can say keep CTL Delete pods and I can say that I can want to filter them by this label and the label needs to add equals to my go And as soon as I tap this command you see in the bottom of the screen that only the my go pods will be deleted So I deleted my go once and I didn't touch the my nodes nor the my Python ones Most of the times you will apply the labels in your resources through configuration email files But just in case you want to apply them by hand you can do that also So let's say that I want to apply a label to my pods But not all the pods only the pods of the my node deployment So I can say keep CTL label pods and I want to filter only the app equals to My node and I want to create a new label in service equals to okay and Just by applying this command if I keep CTL get pods and show the labels You see that the pods of the my node deployment already contain a new label and serves equals to okay And what if I want to remove a certain label of my pods? I can do the same just as I added the label in service if I did do an in service dash I Can remove the labels of my pot. So let's take a look at the pods again You see that the in service label was removed Thanks for watching. Don't forget to like this video and subscribe to our channel