apiVersion: v1
kind: Pod
metadata:
  name: pod-with-pod-anti-affinity-02
  labels:
    app: pause
    applicationId: "pod-with-pod-anti-affinity-01"
    queue: "root.sandbox"
    zone: z1
spec:
  schedulerName: yunikorn
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        - labelSelector:
            matchExpressions:
              - key: zone
                operator: In
                values:
                  - z1
          topologyKey: "kubernetes.io/hostname"
  containers:
    - name: with-pod-affinity
      image: k8s.gcr.io/pause:2.0
      resources:
        requests:
          cpu: "100m"
          memory: "500M"