tektoncd/pipeline

PodAntiAffinity support

Ouverte

#8 322 ouverte le 8 oct. 2024

 (0 commentaire) (0 réaction) (0 personne assignée)Go (1 943 forks)auto 404
area/apihelp wantedkind/feature

Métriques du dépôt

Stars
 (9 013 étoiles)
Métriques de merge PR
 (Merge moyen 9j 3h) (137 PRs mergées en 30 j)

Description

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.

Guide contributeur