tektoncd/pipeline

PodAntiAffinity support

オープン

#8,322 opened on 2024/10/08

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Go (1,943 件のフォーク)auto 404
area/apihelp wantedkind/feature

Repository metrics

Stars
 (9,013 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド