tektoncd/pipeline

PodAntiAffinity support

Aperta

#8322 aperta il 8 ott 2024

 (0 commenti) (0 reazioni) (0 assegnatari)Go (1943 fork)auto 404
area/apihelp wantedkind/feature

Metriche repository

Star
 (9013 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor