k8s.io/kubernetes@v1.29.3/test/integration/scheduler_perf/config/pod-preferred-anti-affinity-ns-selector.yaml (about)

     1  apiVersion: v1
     2  kind: Pod
     3  metadata:
     4    generateName: anti-affinity-pod-
     5    labels:
     6      color: green
     7  spec:
     8    affinity:
     9      podAntiAffinity:
    10        preferredDuringSchedulingIgnoredDuringExecution:
    11        - podAffinityTerm:
    12            labelSelector:
    13              matchLabels:
    14                color: green
    15            topologyKey: kubernetes.io/hostname
    16            namespaceSelector:
    17              matchLabels:
    18                team: devops
    19          weight: 1
    20    containers:
    21    - image: registry.k8s.io/pause:3.9
    22      name: pause
    23      ports:
    24      - containerPort: 80
    25      resources:
    26        limits:
    27          cpu: 100m
    28          memory: 500Mi
    29        requests:
    30          cpu: 100m
    31          memory: 500Mi