---
# https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
kind: Pod
apiVersion: v1
metadata:
  name: topology-spread-constraints/topology-spread-constraints-with-node-affinity-pod
  labels:
    label1: value1
spec:
  topologySpreadConstraints:
    - labelSelector:
        matchLabels:
          label1: value1
      maxSkew: 1
      topologyKey: zone
      whenUnsatisfiable: DoNotSchedule
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - key: zone
                operator: NotIn
                values:
                  - zoneC
  containers:
    - name: pause
      image: k8s.gcr.io/pause:3.1
