Skip to content

Add support for Kubernetes 1.14+ Runtime Class

What does this MR do?

Adds support for https://kubernetes.io/docs/concepts/containers/runtime-class/

Why was this MR needed?

For example, to make use of Kata Containers with Gitlab Runner for much better security.

Pod Annotations can be specified currently to use Kata Containers but it does not allow as much granularity, such as the ability to use kata-qemu-virtiofs for much better disk performance.

Are there points in the code the reviewer needs to double check?

  • Ensure that the Runtime Class cannot be controlled by .gitlab.ci.yml

  • Ensure that if a Runtime Class is specified but the Kubernetes cluster does not support the feature, Gitlab Runner exits with an hard error. An hard error is appropriate because failure to use a Runtime Class can turn into a security issue.

  • How to run Mockery to mock Runtime Class feature checking (use Makefile) and then test this change? I'm not familiar with the code base.

  • How to update the k8s.io/api/core/v1 dependency so that it supports the RuntimeClassName field? Looks already supported.

  • Determine if it's a problem to use a beta feature of Kubernetes

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

None was created.

Edited by Georgi N. Georgiev

Merge request reports