Skip to content

adds support for adding additional containers, volumes and volumemounts

What does this MR do?

It implements support for adding additional containers, volumes and volumeMounts to the gitlab-runner deployment manifest. These can be supplied via new Helm variables extraContainers, extraVolumes and extraVolumeMounts.

extraContainers and extraVolumes are new additions to the pod, extraVolumeMounts are added to the gitlab-runner existing container.

Why was this MR needed?

It enables users of this Helm chart to customize their gitlab-runner deployment according to their specific requirements (e.g. to add a Docker-In-Docker sidecar to provide access to a Docker daemon for gitlab-runners running on Kubernetes clusters with containerd).

What's the best way to test this MR?

  1. edit values.yaml and add values for extraContainers, extraVolumes and extraVolumeMounts, e.g.:
extraContainers: |
- name: docker
  image: docker:20.10-dind
  securityContext:
    privileged: true
  volumeMounts:
    - mountPath: /var/run/
      name: dind-socket
  lifecycle:
    postStart:
      exec:
        command: [ "sh", "-c", "until docker info; do sleep 1; done;" ]

extraVolumes: |
- emptyDir: {}
  name: dind-socket

extraVolumeMounts: |
- mountPath: /var/run/
  name: dind-socket
  1. execute helm template . -f values.yaml

  2. verify that the rendered deployment manifest contains the additional container, volume and volumeMount as configured above

What are the relevant issue numbers?

Edited by Christopher Bohlen

Merge request reports