easymock-template.yaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. apiVersion: v1
  2. kind: Template
  3. metadata:
  4. name: easy-mock
  5. objects:
  6. - apiVersion: v1
  7. kind: ServiceAccount
  8. metadata:
  9. name: easymock
  10. - apiVersion: v1
  11. kind: DeploymentConfig
  12. metadata:
  13. labels:
  14. app: easy-mock
  15. name: easy-mock
  16. spec:
  17. replicas: 1
  18. selector:
  19. app: easy-mock
  20. deploymentconfig: easy-mock
  21. template:
  22. metadata:
  23. labels:
  24. app: easy-mock
  25. deploymentconfig: easy-mock
  26. spec:
  27. containers:
  28. - image: blackcater/easy-mock:1.6.0
  29. imagePullPolicy: IfNotPresent
  30. name: easy-mock
  31. ports:
  32. - containerPort: 7300
  33. protocol: TCP
  34. volumeMounts:
  35. - mountPath: /easy-mock/config
  36. name: easy-mock-t75hs
  37. readOnly: true
  38. dnsPolicy: ClusterFirst
  39. restartPolicy: Always
  40. volumes:
  41. - configMap:
  42. defaultMode: 420
  43. name: easy-mock
  44. name: easy-mock-t75hs
  45. serviceAccount: easymock
  46. triggers:
  47. - type: ConfigChange
  48. - apiVersion: v1
  49. kind: DeploymentConfig
  50. metadata:
  51. labels:
  52. app: easy-mock
  53. name: mongo
  54. spec:
  55. replicas: 1
  56. selector:
  57. app: mongo
  58. deploymentconfig: mongo
  59. template:
  60. metadata:
  61. labels:
  62. app: mongo
  63. deploymentconfig: mongo
  64. spec:
  65. containers:
  66. - image: mongo:4.1
  67. imagePullPolicy: IfNotPresent
  68. name: mongo
  69. ports:
  70. - containerPort: 27017
  71. protocol: TCP
  72. resources: {}
  73. volumeMounts:
  74. - mountPath: /data/configdb
  75. name: mongo-1
  76. - mountPath: /data/db
  77. name: mongo-2
  78. serviceAccount: easymock
  79. dnsPolicy: ClusterFirst
  80. restartPolicy: Always
  81. schedulerName: default-scheduler
  82. securityContext: {}
  83. terminationGracePeriodSeconds: 30
  84. volumes:
  85. - emptyDir: {}
  86. name: mongo-1
  87. - name: mongo-2
  88. persistentVolumeClaim:
  89. claimName: mongodb
  90. test: false
  91. triggers:
  92. - type: ConfigChange
  93. - apiVersion: v1
  94. kind: DeploymentConfig
  95. metadata:
  96. labels:
  97. app: easy-mock
  98. name: redis
  99. spec:
  100. replicas: 1
  101. selector:
  102. app: redis
  103. deploymentconfig: redis
  104. template:
  105. metadata:
  106. labels:
  107. app: redis
  108. deploymentconfig: redis
  109. spec:
  110. containers:
  111. - image: docker.io/redis:5
  112. imagePullPolicy: IfNotPresent
  113. name: redis
  114. ports:
  115. - containerPort: 6379
  116. protocol: TCP
  117. volumeMounts:
  118. - mountPath: /data
  119. name: redis-volume-1
  120. serviceAccount: easymock
  121. volumes:
  122. - emptyDir: {}
  123. name: redis-volume-1
  124. triggers:
  125. - type: ConfigChange
  126. - apiVersion: v1
  127. kind: Service
  128. metadata:
  129. labels:
  130. app: easy-mock
  131. name: easy-mock
  132. spec:
  133. ports:
  134. - name: 7300-tcp
  135. port: 7300
  136. protocol: TCP
  137. targetPort: 7300
  138. selector:
  139. deploymentconfig: easy-mock
  140. sessionAffinity: None
  141. type: ClusterIP
  142. - apiVersion: v1
  143. kind: Service
  144. metadata:
  145. labels:
  146. app: easy-mock
  147. name: mongo
  148. spec:
  149. ports:
  150. - name: 27017-tcp
  151. port: 27017
  152. protocol: TCP
  153. targetPort: 27017
  154. selector:
  155. deploymentconfig: mongo
  156. sessionAffinity: None
  157. type: ClusterIP
  158. - apiVersion: v1
  159. kind: Service
  160. metadata:
  161. labels:
  162. app: easy-mock
  163. name: redis
  164. spec:
  165. ports:
  166. - name: 6379-tcp
  167. port: 6379
  168. protocol: TCP
  169. targetPort: 6379
  170. selector:
  171. app: redis
  172. deploymentconfig: redis
  173. sessionAffinity: None
  174. type: ClusterIP
  175. - apiVersion: v1
  176. kind: Route
  177. metadata:
  178. labels:
  179. app: easy-mock
  180. name: easy-mock
  181. spec:
  182. port:
  183. targetPort: 7300-tcp
  184. to:
  185. kind: Service
  186. name: easy-mock
  187. weight: 100
  188. - apiVersion: v1
  189. kind: PersistentVolumeClaim
  190. metadata:
  191. name: mongodb
  192. spec:
  193. accessModes:
  194. - ReadWriteMany
  195. resources:
  196. requests:
  197. storage: 10Gi
  198. - apiVersion: v1
  199. data:
  200. default.json: "{\r\n \"port\": 7300,\r\n \"host\": \"0.0.0.0\",\r\n \"pageSize\":
  201. 30,\r\n \"proxy\": false,\r\n \"db\": \"mongodb://mongo/easy-mock\",\r\n
  202. \ \"unsplashClientId\": \"\",\r\n \"redis\": {\r\n \"keyPrefix\": \"[Easy
  203. Mock]\",\r\n \"port\": 6379,\r\n \"host\": \"redis\",\r\n \"password\":
  204. \"\",\r\n \"db\": 0\r\n },\r\n \"blackList\": {\r\n \"projects\": [],
  205. // projectId,例:\"5a4495e16ef711102113e500\"\r\n \"ips\": [] // ip,例:\"127.0.0.1\"\r\n
  206. \ },\r\n \"rateLimit\": { // https://github.com/koajs/ratelimit\r\n \"max\":
  207. 1000,\r\n \"duration\": 1000\r\n },\r\n \"jwt\": {\r\n \"expire\": \"14
  208. days\",\r\n \"secret\": \"shared-secret\"\r\n },\r\n \"upload\": {\r\n \"types\":
  209. [\".jpg\", \".jpeg\", \".png\", \".gif\", \".json\", \".yml\", \".yaml\"],\r\n
  210. \ \"size\": 5242880,\r\n \"dir\": \"../public/upload\",\r\n \"expire\":
  211. {\r\n \"types\": [\".json\", \".yml\", \".yaml\"],\r\n \"day\": -1\r\n
  212. \ }\r\n },\r\n \"ldap\": {\r\n \"server\": \"\", // 设置 server 代表启用 LDAP
  213. 登录。例:\"ldap://localhost:389\" 或 \"ldaps://localhost:389\"(使用 SSL)\r\n \"bindDN\":
  214. \"\", // 用户名,例:\"cn=admin,dc=example,dc=com\"\r\n \"password\": \"\",\r\n \"filter\":
  215. {\r\n \"base\": \"\", // 查询用户的路径,例:\"dc=example,dc=com\"\r\n \"attributeName\":
  216. \"\" // 查询字段,例:\"mail\"\r\n }\r\n },\r\n \"fe\": {\r\n \"copyright\":
  217. \"\",\r\n \"storageNamespace\": \"easy-mock_\",\r\n \"timeout\": 25000,\r\n
  218. \ \"publicPath\": \"/dist/\"\r\n }\r\n}"
  219. kind: ConfigMap
  220. metadata:
  221. name: easy-mock