I have a doubt, hope you would help.
Suppose I have 4 node and created a deployment with ReplicaSet value is 3 with pod spec having label xyz. Now creating one DaemonSet with pod having label xyz which is same mentioned above. Now finally how many pods will be there 4 or 3 and how does it work?
Please reply soon.
Total pods would be 7, 3 created by deployment, and 4 would be created by DamemonSet on each node.
A DaemonSet deploys pods to all nodes in the cluster.
As per Kubernetes docs :-
you should not normally create any pods whose labels match this selector, either directly, with another ReplicationController, or with another controller such as Job. If you do so, the ReplicationController thinks that it created the other pods. Kubernetes does not stop you from doing this.
If you do end up with multiple controllers that have overlapping selectors, you will have to manage the deletion yourself