git-runner.yaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. apiVersion: extensions/v1beta1
  2. kind: Deployment
  3. metadata:
  4. annotations:
  5. deployment.kubernetes.io/revision: "1"
  6. generation: 1
  7. labels:
  8. app: gitrunner-gitlab-runner
  9. chart: gitlab-runner-0.8.0-beta
  10. release: gitrunner
  11. name: gitrunner-gitlab-runner
  12. spec:
  13. replicas: 1
  14. selector:
  15. matchLabels:
  16. app: gitrunner-gitlab-runner
  17. strategy:
  18. rollingUpdate:
  19. maxSurge: 1
  20. maxUnavailable: 1
  21. type: RollingUpdate
  22. template:
  23. metadata:
  24. annotations:
  25. prometheus.io/port: "9252"
  26. prometheus.io/scrape: "true"
  27. labels:
  28. app: gitrunner-gitlab-runner
  29. spec:
  30. containers:
  31. - command:
  32. - /bin/bash
  33. - /scripts/entrypoint
  34. env:
  35. - name: CI_SERVER_URL
  36. value: http://g.xxx.com.cn/ci/
  37. - name: CLONE_URL
  38. - name: RUNNER_REQUEST_CONCURRENCY
  39. value: "1"
  40. - name: RUNNER_EXECUTOR
  41. value: kubernetes
  42. - name: REGISTER_LOCKED
  43. value: "true"
  44. - name: RUNNER_TAG_LIST
  45. value: kubernetes-runner
  46. - name: KUBERNETES_IMAGE
  47. value: ubuntu:16.04
  48. - name: KUBERNETES_PRIVILEGED
  49. value: "true"
  50. - name: KUBERNETES_NAMESPACE
  51. value: default
  52. - name: KUBERNETES_CPU_LIMIT
  53. - name: KUBERNETES_MEMORY_LIMIT
  54. - name: KUBERNETES_CPU_REQUEST
  55. - name: KUBERNETES_MEMORY_REQUEST
  56. - name: KUBERNETES_SERVICE_ACCOUNT
  57. - name: KUBERNETES_SERVICE_CPU_LIMIT
  58. - name: KUBERNETES_SERVICE_MEMORY_LIMIT
  59. - name: KUBERNETES_SERVICE_CPU_REQUEST
  60. - name: KUBERNETES_SERVICE_MEMORY_REQUEST
  61. - name: KUBERNETES_HELPER_CPU_LIMIT
  62. - name: KUBERNETES_HELPER_MEMORY_LIMIT
  63. - name: KUBERNETES_HELPER_CPU_REQUEST
  64. - name: KUBERNETES_HELPER_MEMORY_REQUEST
  65. - name: KUBERNETES_HELPER_IMAGE
  66. - name: KUBERNETES_PULL_POLICY
  67. image: gitlab/gitlab-runner:alpine-v11.6.0
  68. imagePullPolicy: IfNotPresent
  69. lifecycle:
  70. preStop:
  71. exec:
  72. command:
  73. - gitlab-runner
  74. - unregister
  75. - --all-runners
  76. livenessProbe:
  77. exec:
  78. command:
  79. - /bin/bash
  80. - /scripts/check-live
  81. failureThreshold: 3
  82. initialDelaySeconds: 60
  83. periodSeconds: 10
  84. successThreshold: 1
  85. timeoutSeconds: 1
  86. name: gitrunner-gitlab-runner
  87. ports:
  88. - containerPort: 9252
  89. name: metrics
  90. protocol: TCP
  91. readinessProbe:
  92. exec:
  93. command:
  94. - /usr/bin/pgrep
  95. - gitlab.*runner
  96. failureThreshold: 3
  97. initialDelaySeconds: 10
  98. periodSeconds: 10
  99. successThreshold: 1
  100. timeoutSeconds: 1
  101. resources:
  102. limits:
  103. cpu: 200m
  104. memory: 256Mi
  105. requests:
  106. cpu: 10m
  107. memory: 128Mi
  108. terminationMessagePath: /dev/termination-log
  109. terminationMessagePolicy: File
  110. volumeMounts:
  111. - mountPath: /secrets
  112. name: runner-secrets
  113. - mountPath: /home/gitlab-runner/.gitlab-runner
  114. name: etc-gitlab-runner
  115. - mountPath: /scripts
  116. name: scripts
  117. dnsPolicy: ClusterFirst
  118. initContainers:
  119. - command:
  120. - sh
  121. - /config/configure
  122. env:
  123. - name: CI_SERVER_URL
  124. value: http://g.xxx.com.cn/ci/
  125. - name: CLONE_URL
  126. - name: RUNNER_REQUEST_CONCURRENCY
  127. value: "1"
  128. - name: RUNNER_EXECUTOR
  129. value: kubernetes
  130. - name: REGISTER_LOCKED
  131. value: "true"
  132. - name: RUNNER_TAG_LIST
  133. value: kubernetes-runner
  134. - name: KUBERNETES_IMAGE
  135. value: ubuntu:16.04
  136. - name: KUBERNETES_PRIVILEGED
  137. value: "true"
  138. - name: KUBERNETES_NAMESPACE
  139. value: default
  140. - name: KUBERNETES_CPU_LIMIT
  141. - name: KUBERNETES_MEMORY_LIMIT
  142. - name: KUBERNETES_CPU_REQUEST
  143. - name: KUBERNETES_MEMORY_REQUEST
  144. - name: KUBERNETES_SERVICE_ACCOUNT
  145. - name: KUBERNETES_SERVICE_CPU_LIMIT
  146. - name: KUBERNETES_SERVICE_MEMORY_LIMIT
  147. - name: KUBERNETES_SERVICE_CPU_REQUEST
  148. - name: KUBERNETES_SERVICE_MEMORY_REQUEST
  149. - name: KUBERNETES_HELPER_CPU_LIMIT
  150. - name: KUBERNETES_HELPER_MEMORY_LIMIT
  151. - name: KUBERNETES_HELPER_CPU_REQUEST
  152. - name: KUBERNETES_HELPER_MEMORY_REQUEST
  153. - name: KUBERNETES_HELPER_IMAGE
  154. - name: KUBERNETES_PULL_POLICY
  155. image: gitlab/gitlab-runner:alpine-v11.6.0
  156. imagePullPolicy: IfNotPresent
  157. name: configure
  158. resources:
  159. limits:
  160. cpu: 200m
  161. memory: 256Mi
  162. requests:
  163. cpu: 10m
  164. memory: 128Mi
  165. terminationMessagePath: /dev/termination-log
  166. terminationMessagePolicy: File
  167. volumeMounts:
  168. - mountPath: /secrets
  169. name: runner-secrets
  170. - mountPath: /config
  171. name: scripts
  172. readOnly: true
  173. - mountPath: /init-secrets
  174. name: init-runner-secrets
  175. readOnly: true
  176. restartPolicy: Always
  177. schedulerName: default-scheduler
  178. securityContext:
  179. fsGroup: 65533
  180. runAsUser: 100
  181. serviceAccount: gitlab
  182. serviceAccountName: gitlab
  183. terminationGracePeriodSeconds: 30
  184. volumes:
  185. - emptyDir:
  186. medium: Memory
  187. name: runner-secrets
  188. - emptyDir:
  189. medium: Memory
  190. name: etc-gitlab-runner
  191. - name: init-runner-secrets
  192. projected:
  193. defaultMode: 420
  194. sources:
  195. - secret:
  196. items:
  197. - key: runner-registration-token
  198. path: runner-registration-token
  199. - key: runner-token
  200. path: runner-token
  201. name: gitrunner-gitlab-runner
  202. - configMap:
  203. defaultMode: 420
  204. name: gitrunner-gitlab-runner
  205. name: scripts