Skip to content

Allow Device Plugin resources with arbitrary keys in the kubernetes executor

What does this MR do?

Adds the ability to add generically named resource requests and limits.

In it's current form the config looks different than what was shown in the issue. This way is consistent with how other requests are named as they are each their own parameter. Open to other ways of setting up the config.

[runners.kubernetes.device_plugin_request]
      "my-dev-plugin/fuse" = "1"
[runners.kubernetes.device_plugin_limit]
      "my-dev-plugin/fuse" = "1"
[runners.kubernetes.helper_device_plugin_request]
      "my-dev-plugin/fuse" = "1"
[runners.kubernetes.helper_device_plugin_limit]
      "my-dev-plugin/fuse" = "1"
[runners.kubernetes.service_device_plugin_request]
      "my-dev-plugin/fuse" = "1"
[runners.kubernetes.service_device_plugin_limit]
      "my-dev-plugin/fuse" = "1"

Why was this MR needed?

So device plugin resources can be added to CI jobs on the kubernetes executor.

What's the best way to test this MR?

  1. Add the following config to runner.config in the gitlab runner helm chart
        [runners.kubernetes.device_plugin_request]
          "mock/device-a" = "1"
        [runners.kubernetes.device_plugin_limit]
          "mock/device-a" = "1"
  1. Redeploy runner
  2. Create .gitlab-ci.yml with job tagged to execute on test runner
  3. Execute ci pipeline for previously created .gitlab-ci.yml
  4. Note that pod execution fails with k8s event like Insufficient mock/device-a,. This is expected and this still validates that the device plugin resources are being added to the pod spec.

What are the relevant issue numbers?

#29339 (closed)

Edited by Drew Rochon

Merge request reports