Expand default labels on build pods

What does this MR do?

Expand the range of default labels on pod created by the Kubernetes executor. This allows other systems get more insights into the created pods, e.g. for cost management/tracking.

Why was this MR needed?

Some relevant build information is only exported as Kubernetes annotations, which are not allways picked up by external tools. Now we export more information deliberately as labels.

Which labels and annotation we want on build pods has been hashed out over here.

What's the best way to test this MR?

  • default:
    • launch a build
    • inspect the pod
    • see that the pod has the documented labels
  • blocking overwrites:
    • set additional pod labels:
      • one in the runner.gitlab.com namespace in the runner config (e.g. "runner.gitlab.com/fromRunnerConfig" = "foo")
      • another in the runner.gitlab.com namespace in the pipeline config (e.g. "runner.gitlab.com/fromPipelineCOnfig" = "foo")
    • launch a build
    • inspect the pod
    • see, that hose labels are not on the pod

What are the relevant issue numbers?

closes: #38359 (closed)

Edited by Hannes Hörl

Merge request reports

Loading