It's not clear to me if you are asking about YAML/API server behavior, or the semantics of label selectors, or the semantics of pod affinity/anti-affinity.
On Fri, Apr 28, 2017 at 3:26 PM, 'Kenneth Massada' via Kubernetes user discussion and Q&A <kubernetes-users@googlegroups.com> wrote: > Could someone help clarify difference between empty and null? > https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ > says An empty label selector (that is, one with zero requirements) selects > every object in the collection. A null label selector (which is only > possible for optional selector fields) selects no objects consider this: > affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - > labelSelector: matchLabels: app: nginx topologyKey: kubernetes.io/hostname > podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - > labelSelector: matchLabels: null topologyKey: kubernetes.io/hostname The > current behavior is then schedule pod on all nodes that have a pod > app:nginx BUT do not schedule pod on "every" of the nodes. or schedule it > none nodes and node that has a pod app:nginx consider affinity: > podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - > labelSelector: matchLabels: app: nginx topologyKey: kubernetes.io/hostname > podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - > topologyKey: kubernetes.io/hostname The current behavior is then schedule > pod on all nodes that have a pod app:nginx BUT do not schedule it on "none" > of the nodes. schedule it on all nodes and node that has a pod app:nginx > {}/null act as every Empty act as all so according to the YAML construct > "{}" is also null. > however, {} this looks more like empty? so is empty omitting? > > I guess the use case here is > > PodAffinity: app:nginx AND podAntiAffinity: NONE > > Kenneth > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com. > To post to this group, send email to kubernetes-users@googlegroups.com. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.