Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/snaipe/gitlab-runner-kubevirt
- Owner: Snaipe
- License: mit
- Created: 2023-06-14T21:36:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-15T08:15:58.000Z (9 months ago)
- Last Synced: 2024-05-02T00:19:44.906Z (8 months ago)
- Language: Go
- Size: 104 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:mainrunners:
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"]
```