-
-
Notifications
You must be signed in to change notification settings - Fork 0
GitLab Runner Kubernetes
This guide covers installing a GitLab project runner on a Kubernetes cluster with a Jetson node.
- A Jetson device joined to the cluster as a worker node
- JetPack SDK installed on the Jetson (L4T r36.4.0 or compatible)
-
kubectlaccess to the cluster - Helm 3 installed
- A project runner token (
glrt-...) — see Requesting a Token
The Jetson node must have the NVIDIA container runtime so pods get Tegra library injection.
Verify it is installed:
nvidia-container-runtime --versionIf missing:
sudo apt-get install -y nvidia-container-toolkitCreate or edit /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl:
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "nvidia"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
privileged_without_host_devices = false
runtime_engine = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
BinaryName = "/usr/bin/nvidia-container-runtime"
SystemdCgroup = trueRestart k3s:
sudo systemctl restart k3sEdit /etc/containerd/config.toml and add the NVIDIA runtime, then restart containerd:
sudo systemctl restart containerdDeploy the device plugin DaemonSet so Kubernetes exposes GPU resources:
kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.17.1/deployments/static/nvidia-device-plugin.ymlVerify:
kubectl describe node <jetson-node> | grep nvidia.com/gpuExpected output: nvidia.com/gpu: 1
Create a RuntimeClass so the runner can request the NVIDIA runtime:
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: nvidia
handler: nvidiakubectl apply -f runtimeclass-nvidia.yamlCreate the namespace and secret with the project runner token:
kubectl create namespace gitlab-runner 2>/dev/null || true
kubectl create secret generic gitlab-runner-secret \
--namespace gitlab-runner \
--from-literal=runner-registration-token="" \
--from-literal=runner-token="<glrt-YOUR_PROJECT_RUNNER_TOKEN>"Install via Helm:
helm repo add gitlab https://charts.gitlab.io
helm repo update
helm install gitlab-runner gitlab/gitlab-runner \
--namespace gitlab-runner \
--set gitlabUrl=https://gitlab.timmertech.nl/ \
--set runners.secret=gitlab-runner-secret \
--set runners.executor=kubernetesTags are configured in GitLab when creating the project runner. The runner inherits them from the server.
Create a values.yaml with Jetson-specific settings:
runners:
config: |
[[runners]]
[runners.kubernetes]
namespace = "gitlab-runner"
image = "harbor.local/jetson/l4t-jetpack:r36.4.0"
runtime_class_name = "nvidia"
[runners.kubernetes.node_selector]
kubernetes.io/hostname = "<jetson-node-hostname>"
[runners.kubernetes.pod_annotations]
"container.apparmor.security.beta.kubernetes.io/build" = "unconfined"
[[runners.kubernetes.volumes.empty_dir]]
name = "tmp"
mount_path = "/tmp"
[runners.kubernetes.pod_security_context]
run_as_non_root = false
executor: kubernetesApply:
helm upgrade gitlab-runner gitlab/gitlab-runner \
--namespace gitlab-runner \
-f values.yaml| Setting | Purpose |
|---|---|
runtime_class_name = "nvidia" |
Pods use NVIDIA container runtime; Tegra libs injected automatically |
node_selector |
Pins CI pods to the Jetson node |
image |
Default build image; should match the L4T version on the device |
Check the runner appears in GitLab:
- Go to Settings > CI/CD > Runners
- Runner should show online with tags
jetsonand your variant
Quick pod test:
kubectl run gpu-test --rm -it --restart=Never \
--overrides='{"spec":{"runtimeClassName":"nvidia","nodeSelector":{"kubernetes.io/hostname":"<jetson-node>"}}}' \
--image=harbor.local/jetson/l4t-jetpack:r36.4.0 \
-- bash -c "ls /usr/lib/aarch64-linux-gnu/tegra/ && echo OK"Project runner tokens are created by maintainers. To request one:
- Open an issue using the GitLab Runner Token Request template
- A maintainer will create the project runner and share the
glrt-...token via a secure channel - Once you have the token, follow this guide from step 4
- Check
kubectl describe pod <pod>for events - Common cause: NVIDIA device plugin not running or RuntimeClass missing
- The NVIDIA runtime is not configured on the node
- Verify the containerd config and restart k3s/containerd
- Check runner tags match the job tags in
.gitlab-ci.yml - HW test jobs need both
jetsonAND<variant>tags - Build/patch jobs have no tags — any runner picks them up
- Verify device plugin:
kubectl get pods -n kube-system | grep nvidia - Verify node resources:
kubectl describe node <node> | grep nvidia - Ensure
NVIDIA_VISIBLE_DEVICES=allis set (CI config does this for test jobs)
🏠 Home · 📦 Repository · 🐞 Issues · 🏷 Releases · 📋 README · 📝 CHANGELOG
Documentation lives in this wiki. To change a doc, edit the relevant wiki page (clone jetson-ffmpeg.wiki.git) — the docs/ folder in the repo has been retired.
📦 Usage & Runtime
❓ FAQ
- Overview
- Hardware & Platform
- Versions & Compatibility
- Build & Install
- Performance
- Features & Fork Differences
🛠 Development
⚙️ CI / Infrastructure
- GitHub Actions
- GitLab CI
- GitHub Runner — Manual
- GitHub Runner — Kubernetes
- GitLab Runner — Manual
- GitLab Runner — Kubernetes
- Release Process
🔬 Project / Fork Analysis