tektoncd/pipeline

PodAntiAffinity support

Aberta

#8.322 aberto em 8 de out. de 2024

 (0 comentário) (0 reação) (0 responsável)Go (1.943 forks)auto 404
area/apihelp wantedkind/feature

Métricas do repositório

Stars
 (9.013 estrelas)
Métricas de merge de PR
 (Mesclagem média 9d 3h) (137 fundiu PRs em 30d)

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.

Guia do colaborador