Skip to content

Support topologySpreadConstraints config

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do?

Provides the ability to configure topologySpreadConstraints for job Pods.

Why was this MR needed?

There is a need to spread job Pods across the cluster among failure domains for some cases. e.g.:

  • To avoid performance issues of multiple jobs being scheduled all in one node (#30933).
  • To minimize blast radius of cloud zonal outages.

What's the best way to test this MR?

Register a runner with the Kubernetes executor and confirm that job Pods are created with topology spread constraints config such as the following:

[[runners]]
  name = "myRunner"
  url = "gitlab.example.com"
  executor = "kubernetes"
  [runners.kubernetes]
    [[runners.kubernetes.topology_spread_constraints]]
      max_skew = 2
      min_domains = 1
      topology_key = "topology.kubernetes.io/zone"
      when_unsatisfiable = "DoNotSchedule"

What are the relevant issue numbers?

#30933

Edited by 🤖 GitLab Bot 🤖

Merge request reports