Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snaipe/gitlab-runner-kubevirt

A gitlab-runner custom executor driver for running jobs with Kubevirt
https://github.com/snaipe/gitlab-runner-kubevirt

Last synced: 2 months ago
JSON representation

A gitlab-runner custom executor driver for running jobs with Kubevirt

Awesome Lists containing this project

README

        

# gitlab-runner-kubevirt

A Gitlab Runner custom executor for running jobs in VMs on kubernetes

## Usage

Before you begin, make sure that KubeVirt has been installed
to the cluster where you want to run these VM jobs.

### Manual Configuration

Add this configuration to your runner:

```toml
[[runners]]
name = "kubevirt"
executor = "custom"

[runners.custom]
config_exec = "/bin/gitlab-runner-kubevirt"
config_args = ["config"]
prepare_exec = "/bin/gitlab-runner-kubevirt"
prepare_args = [
"prepare",

]
run_exec = "/bin/gitlab-runner-kubevirt"
run_args = [
"run",
"--shell", "bash",

]
cleanup_exec = "/bin/gitlab-runner-kubevirt"
cleanup_args = ["cleanup"]
```

Various aspects of the virtual machines can be

### Using the gitlab-runner helm chart

The gitlab-runner-kubevirt executor can be used with the official gitlab-runner
helm chart. Simply add the following to the values:

```yaml
image: ghcr.io/snaipe/gitlab-runner-kubevirt:main

runners:
executor: custom
config: |
[[runners]]
name = "kubevirt"
executor = "custom"

[runners.custom]
config_exec = "/bin/gitlab-runner-kubevirt"
config_args = ["config"]
prepare_exec = "/bin/gitlab-runner-kubevirt"
prepare_args = ["prepare"]
run_exec = "/bin/gitlab-runner-kubevirt"
run_args = ["run", "--shell", "bash"]
cleanup_exec = "/bin/gitlab-runner-kubevirt"
cleanup_args = ["cleanup"]
```

## Examples

### Setting up a Windows runner with 2 CPUs and 4GB memory

```toml
[[runners]]
name = "kubernetes-windows-kubevirt"
executor = "custom"
shell = "pwsh"

[runners.custom]
config_exec = "/bin/gitlab-runner-kubevirt"
config_args = ["config"]
prepare_exec = "/bin/gitlab-runner-kubevirt"
prepare_args = [
"prepare",
"--debug",
"--default-image", "gitlab-registry.example.com:5050/ci/windows:v0.0.1"
"--default-memory-request", "4G",
"--default-memory-limit", "4G",
"--default-cpu-request", "2",
"--default-cpu-limit", "2",
"--default-ephemeral-storage-request", "30Gi",
"--default-ephemeral-storage-limit", "60Gi",
"--default-image-pull-secret", "gitlab-registry-credentials",
"--timeout", "1h",
]
run_exec = "/bin/gitlab-runner-kubevirt"
run_args = [
"run",
"--shell", "pwsh",
"--ssh-user", "vagrant",
"--ssh-password", "vagrant",
]
cleanup_exec = "/bin/gitlab-runner-kubevirt"
cleanup_args = ["cleanup"]
```