wekan.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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: ClientIP
  66. type: ClusterIP
  67. - apiVersion: v1
  68. kind: Service
  69. metadata:
  70. annotations:
  71. template.openshift.io/expose-uri: mongodb://{.spec.clusterIP}:{.spec.ports[?(.name=="mongo")].port}
  72. name: "${DATABASE_SERVICE_NAME}"
  73. labels:
  74. app: wekan
  75. service: ${WEKAN_SERVICE_NAME}
  76. spec:
  77. ports:
  78. - name: mongo
  79. nodePort: 0
  80. port: 27017
  81. protocol: TCP
  82. targetPort: 27017
  83. selector:
  84. name: "${DATABASE_SERVICE_NAME}"
  85. sessionAffinity: None
  86. type: ClusterIP
  87. - apiVersion: v1
  88. kind: PersistentVolumeClaim
  89. metadata:
  90. name: "${DATABASE_SERVICE_NAME}"
  91. labels:
  92. app: wekan
  93. service: ${WEKAN_SERVICE_NAME}
  94. spec:
  95. accessModes:
  96. - ReadWriteOnce
  97. resources:
  98. requests:
  99. storage: "${VOLUME_CAPACITY}"
  100. - apiVersion: image.openshift.io/v1
  101. kind: ImageStream
  102. metadata:
  103. labels:
  104. app: wekan
  105. name: ${WEKAN_SERVICE_NAME}
  106. spec:
  107. tags:
  108. - from:
  109. kind: DockerImage
  110. name: ${WEKAN_IMAGE}
  111. generation: 2
  112. name: latest
  113. referencePolicy:
  114. type: Source
  115. - apiVersion: v1
  116. kind: DeploymentConfig
  117. metadata:
  118. name: ${WEKAN_SERVICE_NAME}
  119. labels:
  120. app: wekan
  121. service: ${WEKAN_SERVICE_NAME}
  122. spec:
  123. replicas: 1
  124. selector:
  125. app: wekan
  126. deploymentconfig: ${WEKAN_SERVICE_NAME}
  127. strategy:
  128. type: Recreate
  129. template:
  130. metadata:
  131. labels:
  132. app: wekan
  133. service: ${WEKAN_SERVICE_NAME}
  134. deploymentconfig: ${WEKAN_SERVICE_NAME}
  135. template: wekan
  136. name: ${WEKAN_SERVICE_NAME}
  137. spec:
  138. containers:
  139. - name: ${WEKAN_SERVICE_NAME}
  140. image: ${WEKAN_IMAGE}
  141. imagePullPolicy: Always
  142. env:
  143. - name: MONGO_URL
  144. value: mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${DATABASE_SERVICE_NAME}:27017/${MONGODB_DATABASE}
  145. - name: ROOT_URL
  146. value: https://${FQDN}/
  147. - name: PORT
  148. value: "8080"
  149. ports:
  150. - containerPort: 8080
  151. name: ${WEKAN_SERVICE_NAME}
  152. protocol: TCP
  153. terminationMessagePath: /dev/termination-log
  154. livenessProbe:
  155. failureThreshold: 30
  156. httpGet:
  157. path: /
  158. port: 8080
  159. initialDelaySeconds: 240
  160. timeoutSeconds: 3
  161. readinessProbe:
  162. httpGet:
  163. path: /
  164. port: 8080
  165. initialDelaySeconds: 3
  166. timeoutSeconds: 3
  167. dnsPolicy: ClusterFirst
  168. restartPolicy: Always
  169. serviceAccount: ${WEKAN_SERVICE_NAME}
  170. serviceAccountName: ${WEKAN_SERVICE_NAME}
  171. terminationGracePeriodSeconds: 30
  172. triggers:
  173. - type: ConfigChange
  174. - type: ImageChange
  175. imageChangeParams:
  176. automatic: true
  177. containerNames:
  178. - ${WEKAN_SERVICE_NAME}
  179. from:
  180. kind: ImageStreamTag
  181. name: ${WEKAN_SERVICE_NAME}:latest
  182. lastTriggeredImage: ""
  183. - apiVersion: v1
  184. kind: DeploymentConfig
  185. metadata:
  186. annotations:
  187. template.alpha.openshift.io/wait-for-ready: 'true'
  188. name: "${DATABASE_SERVICE_NAME}"
  189. labels:
  190. app: wekan
  191. service: ${WEKAN_SERVICE_NAME}
  192. spec:
  193. replicas: 1
  194. selector:
  195. name: "${DATABASE_SERVICE_NAME}"
  196. strategy:
  197. type: Recreate
  198. template:
  199. metadata:
  200. labels:
  201. name: "${DATABASE_SERVICE_NAME}"
  202. spec:
  203. containers:
  204. - capabilities: {}
  205. env:
  206. - name: MONGODB_USER
  207. valueFrom:
  208. secretKeyRef:
  209. key: database-user
  210. name: "${DATABASE_SERVICE_NAME}"
  211. - name: MONGODB_PASSWORD
  212. valueFrom:
  213. secretKeyRef:
  214. key: database-password
  215. name: "${DATABASE_SERVICE_NAME}"
  216. - name: MONGODB_ADMIN_PASSWORD
  217. valueFrom:
  218. secretKeyRef:
  219. key: database-admin-password
  220. name: "${DATABASE_SERVICE_NAME}"
  221. - name: MONGODB_DATABASE
  222. valueFrom:
  223. secretKeyRef:
  224. key: database-name
  225. name: "${DATABASE_SERVICE_NAME}"
  226. image: " "
  227. imagePullPolicy: IfNotPresent
  228. livenessProbe:
  229. initialDelaySeconds: 30
  230. tcpSocket:
  231. port: 27017
  232. timeoutSeconds: 1
  233. name: mongodb
  234. ports:
  235. - containerPort: 27017
  236. protocol: TCP
  237. readinessProbe:
  238. exec:
  239. command:
  240. - "/bin/sh"
  241. - "-i"
  242. - "-c"
  243. - mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD
  244. --eval="quit()"
  245. initialDelaySeconds: 3
  246. timeoutSeconds: 1
  247. resources:
  248. limits:
  249. memory: "${MEMORY_LIMIT}"
  250. securityContext:
  251. capabilities: {}
  252. privileged: false
  253. terminationMessagePath: "/dev/termination-log"
  254. volumeMounts:
  255. - mountPath: "/var/lib/mongodb/data"
  256. name: "${DATABASE_SERVICE_NAME}-data"
  257. dnsPolicy: ClusterFirst
  258. restartPolicy: Always
  259. volumes:
  260. - name: "${DATABASE_SERVICE_NAME}-data"
  261. persistentVolumeClaim:
  262. claimName: "${DATABASE_SERVICE_NAME}"
  263. triggers:
  264. - imageChangeParams:
  265. automatic: true
  266. containerNames:
  267. - mongodb
  268. from:
  269. kind: ImageStreamTag
  270. name: mongodb:${MONGODB_VERSION}
  271. namespace: "openshift"
  272. lastTriggeredImage: ''
  273. type: ImageChange
  274. - type: ConfigChange
  275. - apiVersion: route.openshift.io/v1
  276. kind: Route
  277. metadata:
  278. labels:
  279. app: wekan
  280. service: wekan
  281. template: wekan-mongodb-persistent-template
  282. name: wekan
  283. namespace: ${NAMESPACE}
  284. spec:
  285. host: ${FQDN}
  286. port:
  287. targetPort: wekan
  288. tls:
  289. termination: edge
  290. to:
  291. kind: Service
  292. name: wekan
  293. weight: 100
  294. wildcardPolicy: None
  295. parameters:
  296. - description: The Fully Qualified Hostname (FQDN) of the application
  297. displayName: FQDN
  298. name: FQDN
  299. required: true
  300. - description: Maximum amount of memory the container can use.
  301. displayName: Memory Limit
  302. name: MEMORY_LIMIT
  303. required: true
  304. value: 512Mi
  305. - description: The OpenShift Namespace where the ImageStream resides.
  306. displayName: Namespace
  307. name: NAMESPACE
  308. - description: The name of the OpenShift Service exposed for the database.
  309. displayName: Database Service Name
  310. name: DATABASE_SERVICE_NAME
  311. required: true
  312. value: wekan-mongodb
  313. - description: Username for MongoDB user that will be used for accessing the database.
  314. displayName: MongoDB Connection Username
  315. from: user[A-Z0-9]{3}
  316. generate: expression
  317. name: MONGODB_USER
  318. required: true
  319. - description: Password for the MongoDB connection user.
  320. displayName: MongoDB Connection Password
  321. from: "[a-zA-Z0-9]{16}"
  322. generate: expression
  323. name: MONGODB_PASSWORD
  324. required: true
  325. - description: Name of the MongoDB database accessed.
  326. displayName: MongoDB Database Name
  327. name: MONGODB_DATABASE
  328. required: true
  329. value: wekan
  330. - description: Password for the database admin user.
  331. displayName: MongoDB Admin Password
  332. from: "[a-zA-Z0-9]{16}"
  333. generate: expression
  334. name: MONGODB_ADMIN_PASSWORD
  335. required: true
  336. - description: Volume space available for data, e.g. 512Mi, 2Gi.
  337. displayName: Volume Capacity
  338. name: VOLUME_CAPACITY
  339. required: true
  340. value: 1Gi
  341. - description: Version of MongoDB image to be used (3.6, 4.0.10).
  342. displayName: Version of MongoDB Image
  343. name: MONGODB_VERSION
  344. required: true
  345. value: '3.6'
  346. - name: WEKAN_SERVICE_NAME
  347. displayName: Wekan Service Name
  348. value: wekan
  349. required: true
  350. - name: WEKAN_IMAGE
  351. displayName: Wekan Docker Image
  352. value: quay.io/wekan/wekan
  353. description: The metabase docker image to use
  354. required: true