wekan.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. ---
  2. apiVersion: v1
  3. kind: Template
  4. labels:
  5. template: wekan-mongodb-persistent-template
  6. message: |-
  7. The following service(s) have been created in your project: ${WEKAN_SERVICE_NAME}.
  8. metadata:
  9. annotations:
  10. description: |-
  11. This template provides a Wekan instance backed by a standalone MongoDB
  12. server. The database is stored on persistent storage.
  13. iconClass: pficon-trend-up
  14. openshift.io/display-name: Wekan backed by MongoDB
  15. openshift.io/documentation-url: https://wekan.github.io/
  16. openshift.io/long-description: This template provides a Wekan platform
  17. with a MongoDB database created. The database is stored on persistent storage. The
  18. database name, username, and password are chosen via parameters when provisioning
  19. this service.
  20. tags: wekan,kanban,mongodb
  21. name: wekan-mongodb-persistent
  22. objects:
  23. - apiVersion: v1
  24. kind: ServiceAccount
  25. metadata:
  26. name: ${WEKAN_SERVICE_NAME}
  27. labels:
  28. app: wekan
  29. service: ${WEKAN_SERVICE_NAME}
  30. - apiVersion: v1
  31. kind: Secret
  32. metadata:
  33. annotations:
  34. template.openshift.io/expose-admin_password: "{.data['database-admin-password']}"
  35. template.openshift.io/expose-database_name: "{.data['database-name']}"
  36. template.openshift.io/expose-password: "{.data['database-password']}"
  37. template.openshift.io/expose-username: "{.data['database-user']}"
  38. name: "${DATABASE_SERVICE_NAME}"
  39. labels:
  40. app: wekan
  41. service: ${WEKAN_SERVICE_NAME}
  42. stringData:
  43. database-admin-password: "${MONGODB_ADMIN_PASSWORD}"
  44. database-name: "${MONGODB_DATABASE}"
  45. database-password: "${MONGODB_PASSWORD}"
  46. database-user: "${MONGODB_USER}"
  47. - apiVersion: v1
  48. kind: Service
  49. metadata:
  50. annotations:
  51. template.openshift.io/expose-uri: http://{.spec.clusterIP}:{.spec.ports[?(.name=="wekan")].port}
  52. name: "${WEKAN_SERVICE_NAME}"
  53. labels:
  54. app: wekan
  55. service: ${WEKAN_SERVICE_NAME}
  56. spec:
  57. ports:
  58. - name: wekan
  59. nodePort: 0
  60. port: 8080
  61. protocol: TCP
  62. targetPort: 8080
  63. selector:
  64. name: "${WEKAN_SERVICE_NAME}"
  65. sessionAffinity: None
  66. type: ClusterIP
  67. status:
  68. loadBalancer: {}
  69. - apiVersion: v1
  70. kind: Service
  71. metadata:
  72. annotations:
  73. template.openshift.io/expose-uri: mongodb://{.spec.clusterIP}:{.spec.ports[?(.name=="mongo")].port}
  74. name: "${DATABASE_SERVICE_NAME}"
  75. labels:
  76. app: wekan
  77. service: ${WEKAN_SERVICE_NAME}
  78. spec:
  79. ports:
  80. - name: mongo
  81. nodePort: 0
  82. port: 27017
  83. protocol: TCP
  84. targetPort: 27017
  85. selector:
  86. name: "${DATABASE_SERVICE_NAME}"
  87. sessionAffinity: None
  88. type: ClusterIP
  89. status:
  90. loadBalancer: {}
  91. - apiVersion: v1
  92. kind: PersistentVolumeClaim
  93. metadata:
  94. name: "${DATABASE_SERVICE_NAME}"
  95. labels:
  96. app: wekan
  97. service: ${WEKAN_SERVICE_NAME}
  98. spec:
  99. accessModes:
  100. - ReadWriteOnce
  101. resources:
  102. requests:
  103. storage: "${VOLUME_CAPACITY}"
  104. - apiVersion: image.openshift.io/v1
  105. kind: ImageStream
  106. metadata:
  107. labels:
  108. app: wekan
  109. name: ${WEKAN_SERVICE_NAME}
  110. spec:
  111. tags:
  112. - from:
  113. kind: DockerImage
  114. name: ${WEKAN_IMAGE}
  115. generation: 2
  116. name: latest
  117. referencePolicy:
  118. type: Source
  119. - apiVersion: v1
  120. kind: DeploymentConfig
  121. metadata:
  122. name: ${WEKAN_SERVICE_NAME}
  123. labels:
  124. app: wekan
  125. service: ${WEKAN_SERVICE_NAME}
  126. spec:
  127. replicas: 1
  128. selector:
  129. app: wekan
  130. deploymentconfig: ${WEKAN_SERVICE_NAME}
  131. strategy:
  132. type: Recreate
  133. template:
  134. metadata:
  135. labels:
  136. app: wekan
  137. service: ${WEKAN_SERVICE_NAME}
  138. deploymentconfig: ${WEKAN_SERVICE_NAME}
  139. template: wekan
  140. name: ${WEKAN_SERVICE_NAME}
  141. spec:
  142. containers:
  143. - name: ${WEKAN_SERVICE_NAME}
  144. image: ${WEKAN_IMAGE}
  145. imagePullPolicy: Always
  146. env:
  147. - name: MONGO_URL
  148. value: mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${DATABASE_SERVICE_NAME}:27017/${MONGODB_DATABASE}
  149. - name: ROOT_URL
  150. value: https://${FQDN}/
  151. - name: PORT
  152. value: "8080"
  153. ports:
  154. - containerPort: 8080
  155. name: ${WEKAN_SERVICE_NAME}
  156. protocol: TCP
  157. terminationMessagePath: /dev/termination-log
  158. livenessProbe:
  159. failureThreshold: 30
  160. httpGet:
  161. path: /
  162. port: 8080
  163. initialDelaySeconds: 240
  164. timeoutSeconds: 3
  165. readinessProbe:
  166. httpGet:
  167. path: /
  168. port: 8080
  169. initialDelaySeconds: 3
  170. timeoutSeconds: 3
  171. dnsPolicy: ClusterFirst
  172. restartPolicy: Always
  173. serviceAccount: ${WEKAN_SERVICE_NAME}
  174. serviceAccountName: ${WEKAN_SERVICE_NAME}
  175. terminationGracePeriodSeconds: 30
  176. triggers:
  177. - type: ConfigChange
  178. - type: ImageChange
  179. imageChangeParams:
  180. automatic: true
  181. containerNames:
  182. - ${WEKAN_SERVICE_NAME}
  183. from:
  184. kind: ImageStreamTag
  185. name: ${WEKAN_SERVICE_NAME}:latest
  186. lastTriggeredImage: ""
  187. - apiVersion: v1
  188. kind: DeploymentConfig
  189. metadata:
  190. annotations:
  191. template.alpha.openshift.io/wait-for-ready: 'true'
  192. name: "${DATABASE_SERVICE_NAME}"
  193. labels:
  194. app: wekan
  195. service: ${WEKAN_SERVICE_NAME}
  196. spec:
  197. replicas: 1
  198. selector:
  199. name: "${DATABASE_SERVICE_NAME}"
  200. strategy:
  201. type: Recreate
  202. template:
  203. metadata:
  204. labels:
  205. name: "${DATABASE_SERVICE_NAME}"
  206. spec:
  207. containers:
  208. - capabilities: {}
  209. env:
  210. - name: MONGODB_USER
  211. valueFrom:
  212. secretKeyRef:
  213. key: database-user
  214. name: "${DATABASE_SERVICE_NAME}"
  215. - name: MONGODB_PASSWORD
  216. valueFrom:
  217. secretKeyRef:
  218. key: database-password
  219. name: "${DATABASE_SERVICE_NAME}"
  220. - name: MONGODB_ADMIN_PASSWORD
  221. valueFrom:
  222. secretKeyRef:
  223. key: database-admin-password
  224. name: "${DATABASE_SERVICE_NAME}"
  225. - name: MONGODB_DATABASE
  226. valueFrom:
  227. secretKeyRef:
  228. key: database-name
  229. name: "${DATABASE_SERVICE_NAME}"
  230. image: " "
  231. imagePullPolicy: IfNotPresent
  232. livenessProbe:
  233. initialDelaySeconds: 30
  234. tcpSocket:
  235. port: 27017
  236. timeoutSeconds: 1
  237. name: mongodb
  238. ports:
  239. - containerPort: 27017
  240. protocol: TCP
  241. readinessProbe:
  242. exec:
  243. command:
  244. - "/bin/sh"
  245. - "-i"
  246. - "-c"
  247. - mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD
  248. --eval="quit()"
  249. initialDelaySeconds: 3
  250. timeoutSeconds: 1
  251. resources:
  252. limits:
  253. memory: "${MEMORY_LIMIT}"
  254. securityContext:
  255. capabilities: {}
  256. privileged: false
  257. terminationMessagePath: "/dev/termination-log"
  258. volumeMounts:
  259. - mountPath: "/var/lib/mongodb/data"
  260. name: "${DATABASE_SERVICE_NAME}-data"
  261. dnsPolicy: ClusterFirst
  262. restartPolicy: Always
  263. volumes:
  264. - name: "${DATABASE_SERVICE_NAME}-data"
  265. persistentVolumeClaim:
  266. claimName: "${DATABASE_SERVICE_NAME}"
  267. triggers:
  268. - imageChangeParams:
  269. automatic: true
  270. containerNames:
  271. - mongodb
  272. from:
  273. kind: ImageStreamTag
  274. name: mongodb:${MONGODB_VERSION}
  275. namespace: "openshift"
  276. lastTriggeredImage: ''
  277. type: ImageChange
  278. - type: ConfigChange
  279. status: {}
  280. - apiVersion: route.openshift.io/v1
  281. kind: Route
  282. metadata:
  283. labels:
  284. app: wekan
  285. service: wekan
  286. template: wekan-mongodb-persistent-template
  287. name: wekan
  288. namespace: ${NAMESPACE}
  289. spec:
  290. host: ${FQDN}
  291. port:
  292. targetPort: wekan
  293. tls:
  294. termination: edge
  295. to:
  296. kind: Service
  297. name: wekan
  298. weight: 100
  299. wildcardPolicy: None
  300. status:
  301. ingress:
  302. - conditions:
  303. - lastTransitionTime: '2018-08-28T14:45:21Z'
  304. status: 'True'
  305. type: Admitted
  306. host: ${FQDN}
  307. routerName: router
  308. wildcardPolicy: None
  309. parameters:
  310. - description: The Fully Qualified Hostname (FQDN) of the application
  311. displayName: FQDN
  312. name: FQDN
  313. required: true
  314. - description: Maximum amount of memory the container can use.
  315. displayName: Memory Limit
  316. name: MEMORY_LIMIT
  317. required: true
  318. value: 512Mi
  319. - description: The OpenShift Namespace where the ImageStream resides.
  320. displayName: Namespace
  321. name: NAMESPACE
  322. - description: The name of the OpenShift Service exposed for the database.
  323. displayName: Database Service Name
  324. name: DATABASE_SERVICE_NAME
  325. required: true
  326. value: mongodb
  327. - description: Username for MongoDB user that will be used for accessing the database.
  328. displayName: MongoDB Connection Username
  329. from: user[A-Z0-9]{3}
  330. generate: expression
  331. name: MONGODB_USER
  332. required: true
  333. - description: Password for the MongoDB connection user.
  334. displayName: MongoDB Connection Password
  335. from: "[a-zA-Z0-9]{16}"
  336. generate: expression
  337. name: MONGODB_PASSWORD
  338. required: true
  339. - description: Name of the MongoDB database accessed.
  340. displayName: MongoDB Database Name
  341. name: MONGODB_DATABASE
  342. required: true
  343. value: wekan
  344. - description: Password for the database admin user.
  345. displayName: MongoDB Admin Password
  346. from: "[a-zA-Z0-9]{16}"
  347. generate: expression
  348. name: MONGODB_ADMIN_PASSWORD
  349. required: true
  350. - description: Volume space available for data, e.g. 512Mi, 2Gi.
  351. displayName: Volume Capacity
  352. name: VOLUME_CAPACITY
  353. required: true
  354. value: 1Gi
  355. - description: Version of MongoDB image to be used (2.4, 2.6, 3.2 or latest).
  356. displayName: Version of MongoDB Image
  357. name: MONGODB_VERSION
  358. required: true
  359. value: '3.2'
  360. - name: WEKAN_SERVICE_NAME
  361. displayName: Wekan Service Name
  362. value: wekan
  363. required: true
  364. - name: WEKAN_IMAGE
  365. displayName: WeKan Docker Image
  366. value: quay.io/wekan/wekan:latest
  367. description: The metabase docker image to use
  368. required: true