Skip to content

Add podlabels interpolation

  • 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?

Let users customize runner setups with dynamic pod labels. This saves time and effort, especially when managing multiple runners. Make the podLabels feature more adaptable/customisable to different needs. Another option is to have helper function, as helper functions can be overriden in parent charts when required.

Why was this MR needed?

In our case we have an umbrella chart, with similar structure

├── chart
│   └─ gitlab-runner
│       ├── Chart.yaml
│       └── values.yaml
├── environments
│   ├── sandbox
│   │   └── eu-west-1
│   │       └── cluster-one
│   │           ├── generic-micro.yaml
│   │           ├── gitlab-runner.yaml
│   │           └── gitlab-x.yaml
│   └── services
│       └── eu-west-1
│           └── cluster-two
│               ├── generic-micro.yaml
│               ├── gitlab-runner.yaml
│               └── gitlab-x.yaml

This feature will cut down repetition by a lot. The pod label can be set in chart/gitlab-runner/values.yaml

something like

podLabels:
  owner.team: "{{ .Values.team }}"
  tags.{{ .Values.tag }}/env: "{{ .Values.environment }}"
  # other labels

This will make sure all our other runners just need to provide environment or team, and standard labels applied

What's the best way to test this MR?

helm unittest . or

helm template gitlab-runner . \
        --output-dir output -n gitlab \
        --values values.yaml

What are the relevant issue numbers?

Not exist. Can create one.

Edited by Ivan Katliarchuk

Merge request reports

Loading