deployment.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: drone
  5. namespace: cicd
  6. labels:
  7. app.kubernetes.io/name: drone
  8. spec:
  9. selector:
  10. matchLabels:
  11. app.kubernetes.io/name: drone
  12. replicas: 1
  13. template:
  14. metadata:
  15. labels:
  16. app.kubernetes.io/name: drone
  17. spec:
  18. shareProcessNamespace: true
  19. containers:
  20. - name: runner
  21. image: drone/drone-runner-docker:1
  22. imagePullPolicy: Always
  23. resources:
  24. limits:
  25. cpu: "2"
  26. memory: "2Gi"
  27. requests:
  28. cpu: "1"
  29. memory: "1Gi"
  30. ports:
  31. - name: http
  32. containerPort: 3000
  33. protocol: TCP
  34. env:
  35. - name: DRONE_RPC_PROTO
  36. value: "http"
  37. - name: DRONE_ENV_PLUGIN_SKIP_VERIFY
  38. value: "false"
  39. - name: DRONE_RPC_HOST
  40. value: "drone.cicd.svc.cluster.local"
  41. - name: DRONE_RPC_SECRET
  42. value: "cecf@cestong.com"
  43. - name: DRONE_RUNNER_CAPACITY
  44. value: "2"
  45. - name: DRONE_RUNNER_NAME
  46. value: "first-runner"
  47. volumeMounts:
  48. - name: data
  49. mountPath: /var/lib/drone
  50. - name: docker-socket
  51. mountPath: /var/run/docker.sock
  52. - name: server
  53. image: drone/drone:2
  54. imagePullPolicy: Always
  55. resources:
  56. limits:
  57. cpu: "2"
  58. memory: "2Gi"
  59. requests:
  60. cpu: "1"
  61. memory: "1Gi"
  62. ports:
  63. - name: https
  64. containerPort: 443
  65. protocol: TCP
  66. - name: http
  67. containerPort: 80
  68. protocol: TCP
  69. env:
  70. - name: DRONE_ENV_PLUGIN_SKIP_VERIFY
  71. value: "false"
  72. - name: DRONE_AGENTS_ENABLED
  73. value: "true"
  74. - name: DRONE_GOGS_SERVER
  75. value: "http://git.cestong.com.cn"
  76. - name: DRONE_RPC_SECRET
  77. value: "cecf@cestong.com"
  78. - name: DRONE_SERVER_HOST
  79. value: "ci.cestong.com.cn"
  80. - name: DRONE_SERVER_PROTO
  81. value: "http"
  82. volumeMounts:
  83. - name: data
  84. mountPath: /var/lib/drone
  85. volumes:
  86. - name: data
  87. persistentVolumeClaim:
  88. claimName: drone-pvc
  89. - name: docker-socket
  90. hostPath:
  91. path: /var/run/docker.sock