tektoncd/pipeline

PodAntiAffinity support

Offen

#8.322 geöffnet am 08.10.2024

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (1.943 Forks)auto 404
area/apihelp wantedkind/feature

Repository-Metriken

Stars
 (9.013 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 9T 3h) (137 gemergte PRs in 30 T)

Beschreibung

Is PodAntiAffinity supported when using TaskRuns?

I'm attempting to ensure that specific jobs do not get scheduled together on the same node, to do this, I attempted to use a podTemplate section with the following:

{
 // ... rest of spec
  "podTemplate": {
    "affinity": {
      "podAntiAffinity": {
        "requiredDuringSchedulingIgnoredDuringExecution": [
          {
            "labelSelector": {
              "matchExpressions": [
                {
                  "key": "jobName",
                  "operator": "In",
                  "values": [
                    "maintenance"
                  ]
                }
              ]
            },
            "topologyKey": "kubernetes.io/hostname"
          }
        ]
      }
    }
  }
}

However, when the task run is created the pod for the job does no longer contain the affinity rules.

Contributor Guide