Ex.1
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: common.k8s.elastic.co/type
operator: Exists
topologyKey: "kubernetes.io/hostname"
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- prometheus
topologyKey: "kubernetes.io/hostname"
Ex.2
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: common.k8s.elastic.co/type
operator: Exists
- key: app
operator: In
values:
- prometheus
topologyKey: "kubernetes.io/hostname"
Kubernetes version: 1.23
I’m not sure these 2 examples are the same. I presume that Ex.1 is “OR” and Ex.2 is “AND”.
So, what dose is difference?