<p>I have a deployment, that looks as follows: 
<a href="https://i.stack.imgur.com/j5TPW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j5TPW.png" alt="enter image description here"></a></p>

<p>The question is, what is the difference between the red border label and the violet one? </p>

<p>You can add labels to any k8s object. Pod are one of the objects that take most advantage of it as services target them through labels, but again, any object can have labels.</p>

<p>About deployments, a deployment creates a replicaSet, that in turn creates the pods. The red square is the deployment labels, while the violet is the labels that will have the pods that the replicaSet will create. Note that it is under template section (Pod template).</p>

<p>Now, and this is the important thing with deployments, these two labels must match, in order for a deployment to recognize its "children", otherwise the pods will be orphan. So, if you would change any of these labels, the deployment will create new pods with its labels, and the pods that do not match will run without any controller to back them up.</p>
