Skip to content

Add support for custom storage medium for kubernetes executor.

What does this MR do?

These changes create the possibilty to define the storage medium of the build directory of the kubernetes executor.

Why was this MR needed?

Currently the build directory is statically mounted as emptyDir volume with 'default' storage medium. There is no way to change this behaviour. As we wanted to have in-memory builds without any further configuration, we needed a way to change the storage medium of the emptyDir volume to "memory".

This MR goes further and enables the possibilty to set the storage medium to one of the allowed types. Currently this is "" (default), "memory" and "huge-pages".

What's the best way to test this MR?

The feature can be enabled by either setting the environment variable KUBERNETES_WORK_STORAGE_MEDIUM, or set the key 'work_storage_medium' in the [runners.kubernetes] section of the config.toml

The /builds directory is then mounted as tmpfs. Either visible in the kubernetes config of the build pod, or by the mount command on the shell inside.

What are the relevant issue numbers?

There is at least one issue requesting this feature: #3090

Merge request reports