-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitlab-runner.yml
84 lines (84 loc) · 1.78 KB
/
gitlab-runner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitlab-runner
namespace: gitlab
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: gitlab-runner-role
namespace: gitlab
rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: gitlab-runner-rb
namespace: gitlab
subjects:
- kind: ServiceAccount
name: gitlab-runner
namespace: gitlab
roleRef:
kind: Role
name: gitlab-runner-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gitlab-runner-configmap
namespace: gitlab
data:
entrypoint: |
#!/bin/bash
cp /scripts/config.toml /etc/gitlab-runner/config.toml
exec /entrypoint run
config.toml: |
concurrent = 4
[[runners]]
name = "Kubernetes Runner"
url = "https://gitlab.com/ci"
token = ""
executor = "kubernetes"
[runners.kubernetes]
namespace = "gitlab"
poll_timeout = 600
service_account_overwrite_allowed = "gitlab-(runner|deploy)"
helper_image = "titilambert/gitlab-runner-helper:x86_64-d97749b6"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab-runner-deployment
namespace: gitlab
labels:
app: gitlab-runner
spec:
replicas: 1
selector:
matchLabels:
app: gitlab-runner
template:
metadata:
labels:
app: gitlab-runner
spec:
serviceAccountName: gitlab-runner
containers:
- name: gitlab-runner
image: gitlab/gitlab-runner:alpine
command:
- '/bin/bash'
- '/scripts/entrypoint'
volumeMounts:
- name: config
mountPath: /scripts
volumes:
- name: config
configMap:
name: gitlab-runner-configmap