k8s.io/perf-tests/clusterloader2@v0.0.0-20240304094227-64bdb12da87e/testing/density/scheduler/pod-anti-affinity/deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: {{.Name}}
     5    labels:
     6      group: {{.Group}}
     7  spec:
     8    replicas: {{.Replicas}}
     9    selector:
    10      matchLabels:
    11        name: {{.Name}}
    12    template:
    13      metadata:
    14        labels:
    15          name: {{.Name}}
    16          group: {{.Group}}
    17      spec:
    18        affinity:
    19          podAntiAffinity:
    20            preferredDuringSchedulingIgnoredDuringExecution:
    21            - podAffinityTerm:
    22                labelSelector:
    23                  matchLabels:
    24                    group: {{.Group}}
    25                topologyKey: "kubernetes.io/hostname"
    26              weight: 1
    27        containers:
    28        - image: registry.k8s.io/pause:3.9
    29          imagePullPolicy: IfNotPresent
    30          name: {{.Name}}
    31          ports:
    32          resources:
    33            requests:
    34              cpu: {{.CpuRequest}}
    35              memory: {{.MemoryRequest}}
    36        # Add not-ready/unreachable tolerations for 15 minutes so that node
    37        # failure doesn't trigger pod deletion.
    38        tolerations:
    39        - key: "node.kubernetes.io/not-ready"
    40          operator: "Exists"
    41          effect: "NoExecute"
    42          tolerationSeconds: 900
    43        - key: "node.kubernetes.io/unreachable"
    44          operator: "Exists"
    45          effect: "NoExecute"
    46          tolerationSeconds: 900