Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielealbano/4312016cce7589c4f2566b8f7b2fbca3 to your computer and use it in GitHub Desktop.
Save danielealbano/4312016cce7589c4f2566b8f7b2fbca3 to your computer and use it in GitHub Desktop.
kubernetes github runner deployment for raspberrypi
# Before applying this k8s deployment is necessary to adjust the labels specified in the
# selctor to match the ones in use in your kubernetes cluster.
# It is in addition necessary to replace the __ACCESS_TOKEN__, __REPO_URL__, __REPO_NAME__
# placeholders, the gitlab runner are per repo or per organization, they can't be assigned
# directly to an user.
apiVersion: apps/v1
kind: Deployment
metadata:
name: github-runner-__REPO_NAME__-arm64-rpi4
spec:
replicas: 2
selector:
matchLabels:
apps/github-runner: "true"
hw/board: "raspberry-pi4"
hw/memory: "2gb"
hw/nvme: "true"
hw/shared-nvme: "false"
hw/dedicated-nvme: "true"
kubernetes.io/os: "linux"
kubernetes.io/arch: "arm64"
template:
metadata:
labels:
apps/github-runner: "true"
hw/board: "raspberry-pi4"
hw/memory: "2gb"
hw/nvme: "true"
hw/shared-nvme: "false"
hw/dedicated-nvme: "true"
kubernetes.io/os: "linux"
kubernetes.io/arch: "arm64"
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "apps/github-runner"
operator: In
values:
- "true"
topologyKey: "kubernetes.io/hostname"
volumes:
- name: dind-storage
emptyDir: {}
- name: dind-sock-var-run
emptyDir: {}
containers:
- name: dind
image: docker:dind
securityContext:
privileged: true
volumeMounts:
- name: dind-sock-var-run
mountPath: /var/run
- name: dind-storage
mountPath: /var/lib/docker
- name: runner
image: myoung34/github-runner:latest
env:
- name: ACCESS_TOKEN
value: "__ACCESS_TOKEN__"
- name: LABELS
value: "aarch64,arm64,raspberry-pi4,raspberry-pi4-2gb,nvme,dedicated-nvme"
- name: REPO_URL
value: "__REPO_URL__"
- name: RUNNER_NAME_PREFIX
value: "github-runner-k8s-__REPO_NAME__-rpi4"
- name: RUNNER_ALLOW_RUNASROOT
value: "1"
volumeMounts:
- name: dind-sock-var-run
mountPath: /var/run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment