tektoncd/pipeline

PodAntiAffinity support

开放

#8,322 创建于 2024年10月8日

 (0 条评论) (0 个反应) (0 位负责人)Go (1,943 个派生)auto 404
area/apihelp wantedkind/feature

仓库指标

星标
 (9,013 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南