2
0

gitrunner-deploy.yaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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.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. value: 3000m
  54. - name: KUBERNETES_MEMORY_LIMIT
  55. value: 2048Mi
  56. - name: KUBERNETES_CPU_REQUEST
  57. value: 100m
  58. - name: KUBERNETES_MEMORY_REQUEST
  59. value: 256Mi
  60. - name: KUBERNETES_SERVICE_ACCOUNT
  61. - name: KUBERNETES_SERVICE_CPU_LIMIT
  62. - name: KUBERNETES_SERVICE_MEMORY_LIMIT
  63. - name: KUBERNETES_SERVICE_CPU_REQUEST
  64. - name: KUBERNETES_SERVICE_MEMORY_REQUEST
  65. - name: KUBERNETES_HELPER_CPU_LIMIT
  66. - name: KUBERNETES_HELPER_MEMORY_LIMIT
  67. - name: KUBERNETES_HELPER_CPU_REQUEST
  68. - name: KUBERNETES_HELPER_MEMORY_REQUEST
  69. - name: KUBERNETES_HELPER_IMAGE
  70. - name: KUBERNETES_PULL_POLICY
  71. image: gitlab/gitlab-runner:alpine-v11.6.0
  72. imagePullPolicy: IfNotPresent
  73. lifecycle:
  74. preStop:
  75. exec:
  76. command:
  77. - gitlab-runner
  78. - unregister
  79. - --all-runners
  80. livenessProbe:
  81. exec:
  82. command:
  83. - /bin/bash
  84. - /scripts/check-live
  85. failureThreshold: 3
  86. initialDelaySeconds: 60
  87. periodSeconds: 10
  88. successThreshold: 1
  89. timeoutSeconds: 1
  90. name: gitrunner-gitlab-runner
  91. ports:
  92. - containerPort: 9252
  93. name: metrics
  94. protocol: TCP
  95. readinessProbe:
  96. exec:
  97. command:
  98. - /usr/bin/pgrep
  99. - gitlab.*runner
  100. failureThreshold: 3
  101. initialDelaySeconds: 10
  102. periodSeconds: 10
  103. successThreshold: 1
  104. timeoutSeconds: 1
  105. resources:
  106. limits:
  107. cpu: 200m
  108. memory: 256Mi
  109. requests:
  110. cpu: 10m
  111. memory: 128Mi
  112. terminationMessagePath: /dev/termination-log
  113. terminationMessagePolicy: File
  114. volumeMounts:
  115. - mountPath: /secrets
  116. name: runner-secrets
  117. - mountPath: /home/gitlab-runner/.gitlab-runner
  118. name: etc-gitlab-runner
  119. - mountPath: /scripts
  120. name: scripts
  121. dnsPolicy: ClusterFirst
  122. initContainers:
  123. - command:
  124. - sh
  125. - /config/configure
  126. env:
  127. - name: CI_SERVER_URL
  128. value: http://g.com.cn/ci/
  129. - name: CLONE_URL
  130. - name: RUNNER_REQUEST_CONCURRENCY
  131. value: "1"
  132. - name: RUNNER_EXECUTOR
  133. value: kubernetes
  134. - name: REGISTER_LOCKED
  135. value: "true"
  136. - name: RUNNER_TAG_LIST
  137. value: kubernetes-runner
  138. - name: KUBERNETES_IMAGE
  139. value: ubuntu:16.04
  140. - name: KUBERNETES_PRIVILEGED
  141. value: "true"
  142. - name: KUBERNETES_NAMESPACE
  143. value: default
  144. - name: KUBERNETES_CPU_LIMIT
  145. value: 3000m
  146. - name: KUBERNETES_MEMORY_LIMIT
  147. value: 2048Mi
  148. - name: KUBERNETES_CPU_REQUEST
  149. value: 100m
  150. - name: KUBERNETES_MEMORY_REQUEST
  151. value: 256Mi
  152. - name: KUBERNETES_SERVICE_ACCOUNT
  153. - name: KUBERNETES_SERVICE_CPU_LIMIT
  154. - name: KUBERNETES_SERVICE_MEMORY_LIMIT
  155. - name: KUBERNETES_SERVICE_CPU_REQUEST
  156. - name: KUBERNETES_SERVICE_MEMORY_REQUEST
  157. - name: KUBERNETES_HELPER_CPU_LIMIT
  158. - name: KUBERNETES_HELPER_MEMORY_LIMIT
  159. - name: KUBERNETES_HELPER_CPU_REQUEST
  160. - name: KUBERNETES_HELPER_MEMORY_REQUEST
  161. - name: KUBERNETES_HELPER_IMAGE
  162. - name: KUBERNETES_PULL_POLICY
  163. image: gitlab/gitlab-runner:alpine-v11.6.0
  164. imagePullPolicy: IfNotPresent
  165. name: configure
  166. resources:
  167. limits:
  168. cpu: 200m
  169. memory: 256Mi
  170. requests:
  171. cpu: 10m
  172. memory: 128Mi
  173. terminationMessagePath: /dev/termination-log
  174. terminationMessagePolicy: File
  175. volumeMounts:
  176. - mountPath: /secrets
  177. name: runner-secrets
  178. - mountPath: /config
  179. name: scripts
  180. readOnly: true
  181. - mountPath: /init-secrets
  182. name: init-runner-secrets
  183. readOnly: true
  184. restartPolicy: Always
  185. schedulerName: default-scheduler
  186. securityContext:
  187. fsGroup: 65533
  188. runAsUser: 100
  189. serviceAccount: gitlab
  190. serviceAccountName: gitlab
  191. terminationGracePeriodSeconds: 30
  192. volumes:
  193. - emptyDir:
  194. medium: Memory
  195. name: runner-secrets
  196. - emptyDir:
  197. medium: Memory
  198. name: etc-gitlab-runner
  199. - name: init-runner-secrets
  200. projected:
  201. defaultMode: 420
  202. sources:
  203. - secret:
  204. items:
  205. - key: runner-registration-token
  206. path: runner-registration-token
  207. - key: runner-token
  208. path: runner-token
  209. name: gitrunner-gitlab-runner
  210. - configMap:
  211. defaultMode: 420
  212. name: gitrunner-gitlab-runner
  213. name: scripts