@nathapp/na-cli 1.0.0-rc.4 → 1.0.0-rc.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/.gitlab-ci.yml +135 -0
  2. package/Makefile +16 -9
  3. package/README.md +18 -2
  4. package/alias-script.sh +30 -0
  5. package/dist/index.js +106 -128
  6. package/dist/index.js.map +1 -1
  7. package/dist/templates/db-schema/.gitignore-rename +1 -0
  8. package/dist/templates/db-schema/.gitlab-ci.yml +139 -0
  9. package/dist/templates/db-schema/001_Schema.sql +1 -0
  10. package/dist/templates/db-schema/DEV_MODE.txt +1 -0
  11. package/dist/templates/db-schema/Dockerfile +3 -0
  12. package/dist/templates/db-schema/Email-Templates/Individual/README.md +1 -0
  13. package/dist/templates/db-schema/GET_VERSION.sql +47 -0
  14. package/dist/templates/db-schema/Makefile +885 -0
  15. package/dist/templates/db-schema/README.md +117 -0
  16. package/dist/templates/db-schema/SET_VERSION.sql +5 -0
  17. package/dist/templates/db-schema/docker-compose.yaml +47 -0
  18. package/dist/templates/db-schema/package.json +3 -0
  19. package/dist/templates/db-schema/push.sh +0 -0
  20. package/dist/templates/db-schema/samples/899_DB_Grant_User.sql +9 -0
  21. package/dist/templates/db-schema/samples/990_SAMPLE_Init_Data.sql +27 -0
  22. package/dist/templates/k8s-deployment/.gitignore-rename +1 -0
  23. package/dist/templates/k8s-deployment/.gitlab-ci.yml +128 -0
  24. package/dist/templates/k8s-deployment/.helmignore +23 -0
  25. package/dist/templates/k8s-deployment/Chart.yaml +23 -0
  26. package/dist/templates/k8s-deployment/Makefile +196 -0
  27. package/dist/templates/k8s-deployment/README.md +32 -0
  28. package/dist/templates/k8s-deployment/resources/charts/mysql/Chart.yaml +23 -0
  29. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/Chart.yaml +23 -0
  30. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
  31. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/_helpers.tpl +62 -0
  32. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/configmap.yaml +1 -0
  33. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/job.yaml +1 -0
  34. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/secret.yaml +1 -0
  35. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/values.yaml +51 -0
  36. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/_helpers.tpl +62 -0
  37. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/configmap.yaml +1 -0
  38. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/deployment.yaml +1 -0
  39. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/ingress.yaml +1 -0
  40. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/job.yaml +1 -0
  41. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pv.yaml +1 -0
  42. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pvc.yaml +1 -0
  43. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/sc.yaml +1 -0
  44. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/secret.yaml +1 -0
  45. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/service.yaml +1 -0
  46. package/dist/templates/k8s-deployment/resources/charts/mysql/templates/statefulset.yaml +1 -0
  47. package/dist/templates/k8s-deployment/resources/charts/mysql/values.yaml +15 -0
  48. package/dist/templates/k8s-deployment/resources/charts/redis/Chart.yaml +23 -0
  49. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/Chart.yaml +23 -0
  50. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
  51. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/_helpers.tpl +62 -0
  52. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/configmap.yaml +1 -0
  53. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/job.yaml +1 -0
  54. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/secret.yaml +1 -0
  55. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/values.yaml +42 -0
  56. package/dist/templates/k8s-deployment/resources/charts/redis/templates/_helpers.tpl +62 -0
  57. package/dist/templates/k8s-deployment/resources/charts/redis/templates/configmap.yaml +1 -0
  58. package/dist/templates/k8s-deployment/resources/charts/redis/templates/deployment.yaml +1 -0
  59. package/dist/templates/k8s-deployment/resources/charts/redis/templates/ingress.yaml +1 -0
  60. package/dist/templates/k8s-deployment/resources/charts/redis/templates/job.yaml +1 -0
  61. package/dist/templates/k8s-deployment/resources/charts/redis/templates/pv.yaml +1 -0
  62. package/dist/templates/k8s-deployment/resources/charts/redis/templates/pvc.yaml +1 -0
  63. package/dist/templates/k8s-deployment/resources/charts/redis/templates/sc.yaml +1 -0
  64. package/dist/templates/k8s-deployment/resources/charts/redis/templates/secret.yaml +1 -0
  65. package/dist/templates/k8s-deployment/resources/charts/redis/templates/service.yaml +1 -0
  66. package/dist/templates/k8s-deployment/resources/charts/redis/templates/statefulset.yaml +1 -0
  67. package/dist/templates/k8s-deployment/resources/charts/redis/values.yaml +12 -0
  68. package/dist/templates/k8s-deployment/services/charts/hooks/Chart.yaml +23 -0
  69. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/Chart.yaml +23 -0
  70. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +49 -0
  71. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/_env.yaml +2 -0
  72. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/_helpers.tpl +62 -0
  73. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/configmap.yaml +1 -0
  74. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/job.yaml +1 -0
  75. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/secret.yaml +1 -0
  76. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/values.yaml +36 -0
  77. package/dist/templates/k8s-deployment/services/charts/sample-nginx/Chart.yaml +23 -0
  78. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/_helpers.tpl +62 -0
  79. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cluster-role-binding.yaml +1 -0
  80. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/configmap.yaml +1 -0
  81. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cronjob.yaml +1 -0
  82. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/deployment.yaml +1 -0
  83. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/ingress.yaml +1 -0
  84. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pv.yaml +1 -0
  85. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pvc.yaml +1 -0
  86. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/sc.yaml +1 -0
  87. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/secret.yaml +1 -0
  88. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service-account.yaml +1 -0
  89. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service.yaml +1 -0
  90. package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/statefulset.yaml +1 -0
  91. package/dist/templates/k8s-deployment/services/charts/sample-nginx/values.yaml +47 -0
  92. package/dist/templates/k8s-deployment/services/charts/tests/Chart.yaml +23 -0
  93. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Chart.yaml +23 -0
  94. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
  95. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/fixtures/index.json +1 -0
  96. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/login-spec.js +47 -0
  97. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginEmailWrong-spec.js +14 -0
  98. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginPasswordWrong-spec.js +14 -0
  99. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updatePassword-spec.js +15 -0
  100. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updateProfile-spec.js +25 -0
  101. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/test-script.spec.js +9 -0
  102. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/plugins/index.js +22 -0
  103. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/commands.js +258 -0
  104. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/index.js +35 -0
  105. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/misc.js +8 -0
  106. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress.json +4 -0
  107. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/_helpers.tpl +62 -0
  108. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/configmap.yaml +1 -0
  109. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/pod.yaml +1 -0
  110. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/secret.yaml +1 -0
  111. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/values.yaml +70 -0
  112. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/.helmignore +2 -0
  113. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/Chart.yaml +23 -0
  114. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
  115. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/_helpers.tpl +62 -0
  116. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/configmap.yaml +1 -0
  117. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/pod.yaml +1 -0
  118. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/secret.yaml +1 -0
  119. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
  120. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
  121. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
  122. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
  123. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
  124. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
  125. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
  126. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
  127. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
  128. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/live.jpg +0 -0
  129. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/mykad_front.jpg +0 -0
  130. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/profile.jpg +0 -0
  131. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
  132. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/values.yaml +59 -0
  133. package/dist/templates/k8s-deployment/templates/_cluster-role-binding.tpl +20 -0
  134. package/dist/templates/k8s-deployment/templates/_configmap.tpl +37 -0
  135. package/dist/templates/k8s-deployment/templates/_cronjob.tpl +225 -0
  136. package/dist/templates/k8s-deployment/templates/_deployment.tpl +246 -0
  137. package/dist/templates/k8s-deployment/templates/_helpers.tpl +31 -0
  138. package/dist/templates/k8s-deployment/templates/_ingress.tpl +77 -0
  139. package/dist/templates/k8s-deployment/templates/_job.tpl +233 -0
  140. package/dist/templates/k8s-deployment/templates/_pod.tpl +214 -0
  141. package/dist/templates/k8s-deployment/templates/_pv.tpl +42 -0
  142. package/dist/templates/k8s-deployment/templates/_pvc.tpl +27 -0
  143. package/dist/templates/k8s-deployment/templates/_root.tpl +314 -0
  144. package/dist/templates/k8s-deployment/templates/_sc.tpl +19 -0
  145. package/dist/templates/k8s-deployment/templates/_secret.tpl +15 -0
  146. package/dist/templates/k8s-deployment/templates/_service-account.tpl +8 -0
  147. package/dist/templates/k8s-deployment/templates/_service.tpl +40 -0
  148. package/dist/templates/k8s-deployment/templates/_statefulset.tpl +244 -0
  149. package/dist/templates/k8s-deployment/templates/root-cm.yaml +10 -0
  150. package/dist/templates/k8s-deployment/templates/root-pull-secret.yaml +11 -0
  151. package/dist/templates/k8s-deployment/templates/root-secret.yaml +24 -0
  152. package/dist/templates/k8s-deployment/values.yaml +38 -0
  153. package/dist/templates/k8s-helm-chart/Chart.yaml +23 -0
  154. package/dist/templates/k8s-helm-chart/templates/_helpers.tpl +62 -0
  155. package/dist/templates/k8s-helm-chart/templates/cluster-role-binding.yaml +1 -0
  156. package/dist/templates/k8s-helm-chart/templates/configmap.yaml +1 -0
  157. package/dist/templates/k8s-helm-chart/templates/cronjob.yaml +1 -0
  158. package/dist/templates/k8s-helm-chart/templates/deployment.yaml +1 -0
  159. package/dist/templates/k8s-helm-chart/templates/ingress.yaml +1 -0
  160. package/dist/templates/k8s-helm-chart/templates/pv.yaml +1 -0
  161. package/dist/templates/k8s-helm-chart/templates/pvc.yaml +1 -0
  162. package/dist/templates/k8s-helm-chart/templates/sc.yaml +1 -0
  163. package/dist/templates/k8s-helm-chart/templates/secret.yaml +1 -0
  164. package/dist/templates/k8s-helm-chart/templates/service-account.yaml +1 -0
  165. package/dist/templates/k8s-helm-chart/templates/service.yaml +1 -0
  166. package/dist/templates/k8s-helm-chart/templates/statefulset.yaml +1 -0
  167. package/dist/templates/k8s-helm-chart/values.yaml +41 -0
  168. package/dist/templates/mxw-base-api-express/.dockerignore +2 -0
  169. package/dist/templates/mxw-base-api-express/.env +10 -0
  170. package/dist/templates/mxw-base-api-express/.gitignore-rename +3 -0
  171. package/dist/templates/mxw-base-api-express/.gitlab-ci.yml +174 -0
  172. package/dist/templates/mxw-base-api-express/.nvmrc +1 -0
  173. package/dist/templates/mxw-base-api-express/Dockerfile +14 -0
  174. package/dist/templates/mxw-base-api-express/Makefile +84 -0
  175. package/dist/templates/mxw-base-api-express/README.md +71 -0
  176. package/dist/templates/mxw-base-api-express/package.json +55 -0
  177. package/dist/templates/mxw-base-api-express/src/app-service.test.ts +94 -0
  178. package/dist/templates/mxw-base-api-express/src/app-service.ts +498 -0
  179. package/dist/templates/mxw-base-api-express/src/auth/auth-user.test.ts +215 -0
  180. package/dist/templates/mxw-base-api-express/src/auth/auth-user.ts +86 -0
  181. package/dist/templates/mxw-base-api-express/src/auth/auth.ts +81 -0
  182. package/dist/templates/mxw-base-api-express/src/core-service.ts +72 -0
  183. package/dist/templates/mxw-base-api-express/src/crud.ts +84 -0
  184. package/dist/templates/mxw-base-api-express/src/http-handler.ts +71 -0
  185. package/dist/templates/mxw-base-api-express/src/server.ts +54 -0
  186. package/dist/templates/mxw-base-api-express/src/test.ts +38 -0
  187. package/dist/templates/mxw-base-api-express/src/utils/api-utilities.ts +52 -0
  188. package/dist/templates/mxw-base-api-express/src/utils/file-utilities.ts +55 -0
  189. package/dist/templates/mxw-base-api-express/tsconfig.json +32 -0
  190. package/dist/templates/nestjs-api/.dockerignore +2 -0
  191. package/dist/templates/nestjs-api/.env +12 -0
  192. package/dist/templates/nestjs-api/.eslintrc.js +25 -0
  193. package/dist/templates/nestjs-api/.gitignore-rename +35 -0
  194. package/dist/templates/nestjs-api/.gitlab-ci.yml +174 -0
  195. package/dist/templates/nestjs-api/.nvmrc +1 -0
  196. package/dist/templates/nestjs-api/.prettierrc +4 -0
  197. package/dist/templates/nestjs-api/Dockerfile +19 -0
  198. package/dist/templates/nestjs-api/Makefile +84 -0
  199. package/dist/templates/nestjs-api/README.md +67 -0
  200. package/dist/templates/nestjs-api/nest-cli.json +8 -0
  201. package/dist/templates/nestjs-api/package.json +75 -0
  202. package/dist/templates/nestjs-api/src/app.controller.spec.ts +22 -0
  203. package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
  204. package/dist/templates/nestjs-api/src/app.module.ts +10 -0
  205. package/dist/templates/nestjs-api/src/app.service.ts +12 -0
  206. package/dist/templates/nestjs-api/src/main.ts +31 -0
  207. package/dist/templates/nestjs-api/test/app.e2e-spec.ts +24 -0
  208. package/dist/templates/nestjs-api/test/jest-e2e.json +9 -0
  209. package/dist/templates/nestjs-api/tsconfig.build.json +4 -0
  210. package/dist/templates/nestjs-api/tsconfig.json +22 -0
  211. package/dist/templates/nestjs-library/.eslintrc.js +24 -0
  212. package/dist/templates/nestjs-library/.gitignore-rename +39 -0
  213. package/dist/templates/nestjs-library/.gitlab-ci.yml +135 -0
  214. package/dist/templates/nestjs-library/.npmignore-rename +30 -0
  215. package/dist/templates/nestjs-library/.prettierrc +6 -0
  216. package/dist/templates/nestjs-library/LICENSE +21 -0
  217. package/dist/templates/nestjs-library/Makefile +60 -0
  218. package/dist/templates/nestjs-library/README.md +3 -0
  219. package/dist/templates/nestjs-library/index.d.ts +1 -0
  220. package/dist/templates/nestjs-library/index.js +6 -0
  221. package/dist/templates/nestjs-library/index.ts +1 -0
  222. package/dist/templates/nestjs-library/lib/index.ts +2 -0
  223. package/dist/templates/nestjs-library/package.json +41 -0
  224. package/dist/templates/nestjs-library/tsconfig.build.json +4 -0
  225. package/dist/templates/nestjs-library/tsconfig.json +18 -0
  226. package/dist/templates/ts-library/.dockerignore +2 -0
  227. package/dist/templates/ts-library/.eslintrc.js +24 -0
  228. package/dist/templates/ts-library/.gitignore-rename +37 -0
  229. package/dist/templates/ts-library/.gitlab-ci.yml +135 -0
  230. package/dist/templates/ts-library/.npmignore-rename +30 -0
  231. package/dist/templates/ts-library/.prettierrc +6 -0
  232. package/dist/templates/ts-library/LICENSE +21 -0
  233. package/dist/templates/ts-library/Makefile +58 -0
  234. package/dist/templates/ts-library/README.md +1 -0
  235. package/dist/templates/ts-library/index.d.ts +1 -0
  236. package/dist/templates/ts-library/index.js +6 -0
  237. package/dist/templates/ts-library/index.ts +1 -0
  238. package/dist/templates/ts-library/lib/index.ts +1 -0
  239. package/dist/templates/ts-library/lib/samples/index.ts +5 -0
  240. package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
  241. package/dist/templates/ts-library/package.json +34 -0
  242. package/dist/templates/ts-library/test/jest-e2e.json +9 -0
  243. package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
  244. package/dist/templates/ts-library/tsconfig.build.json +4 -0
  245. package/dist/templates/ts-library/tsconfig.json +18 -0
  246. package/dist/utils/env.js +146 -0
  247. package/dist/utils/env.js.map +1 -0
  248. package/dist/utils/template.js +362 -1
  249. package/dist/utils/template.js.map +1 -1
  250. package/package.json +9 -5
  251. package/src/index.ts +0 -182
  252. package/src/utils/template.ts +0 -9
@@ -0,0 +1,233 @@
1
+ {{- define "root.job" -}}
2
+ {{- if and .Values.enabled (.Values.kind | default "" | lower | eq "job") -}}
3
+ apiVersion: batch/v1
4
+ kind: Job
5
+ metadata:
6
+ name: {{ include (print $.Chart.Name ".fullname") . }}
7
+ {{- if .Values.annotations }}
8
+ {{- with .Values.annotations }}
9
+ annotations:
10
+ {{- toYaml . | nindent 4 }}
11
+ {{- end }}
12
+ {{- end }}
13
+ spec:
14
+ template:
15
+ metadata:
16
+ labels:
17
+ {{- include (print $.Chart.Name ".selectorLabels") . | nindent 8 }}
18
+ annotations:
19
+ {{- $dict := (dict "local" "") }}
20
+ {{- if .Values.secret }}
21
+ {{- $value := get $dict "local" }}
22
+ {{- $value := print $value (include (print $.Template.BasePath "/secret.yaml") .) | sha256sum }}
23
+ {{- $_ := set $dict "local" $value }}
24
+ {{- end }}
25
+ {{- if .Values.config }}
26
+ {{- $value := get $dict "local" }}
27
+ {{- $value := print $value (include (print $.Template.BasePath "/configmap.yaml") .) | sha256sum }}
28
+ {{- $_ := set $dict "local" $value }}
29
+ {{- end }}
30
+ kubernetes.io/change-cause: {{ get $dict "local" | sha256sum }}
31
+ spec:
32
+ {{- if .Values.restartPolicy }}
33
+ restartPolicy: {{ .Values.restartPolicy }}
34
+ {{- end }}
35
+ {{- if and (hasKey .Values "serviceAccountName") }}
36
+ serviceAccountName: {{ include "root.globalMap" (list $ .Values.serviceAccountName) | default (include (print $.Chart.Name ".fullname") $) | quote }}
37
+ {{- end }}
38
+ {{- with .Values.imagePullSecrets }}
39
+ imagePullSecrets:
40
+ - name: {{ include "root.globalMap" (list $ .) | quote }}
41
+ {{- end }}
42
+ {{- if .Values.nodeSelector }}
43
+ {{- with .Values.nodeSelector }}
44
+ nodeSelector:
45
+ {{- toYaml . | nindent 8 }}
46
+ {{- end }}
47
+ {{- end }}
48
+ {{- if .Values.initContainers }}
49
+ {{- with .Values.initContainers }}
50
+ initContainers:
51
+ {{- toYaml . | nindent 8 }}
52
+ {{- end }}
53
+ {{- end }}
54
+ containers:
55
+ - name: {{ include (print $.Chart.Name ".fullname") . }}
56
+ image: {{ .Values.image.repository }}:{{ .Values.image.tag | default $.Chart.AppVersion }}
57
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
58
+ {{- if .Values.resources }}
59
+ resources:
60
+ {{- toYaml .Values.resources | nindent 10 }}
61
+ {{- end }}
62
+ {{- if or .Values.script (or .Values.beforeScript .Values.afterScript) }}
63
+ command: ["/bin/sh"]
64
+ {{- $dict := (dict "key" "") -}}
65
+
66
+ {{- if .Values.beforeScript }}
67
+ {{- range .Values.beforeScript -}}
68
+ {{- if eq (typeOf .) "string" -}}
69
+ {{ $n := include "root.globalMap" (list $ .) }}
70
+ {{- $script := print (get $dict "key") $n ";" -}}
71
+ {{- $_ := set $dict "key" $script -}}
72
+ {{- end -}}
73
+ {{- end -}}
74
+ {{- end -}}
75
+
76
+ {{- if .Values.script }}
77
+ {{- range .Values.script -}}
78
+ {{- if eq (typeOf .) "string" -}}
79
+ {{ $n := include "root.globalMap" (list $ .) }}
80
+ {{- $script := print (get $dict "key") $n ";" -}}
81
+ {{- $_ := set $dict "key" $script -}}
82
+ {{- end -}}
83
+ {{- end -}}
84
+ {{- end -}}
85
+
86
+ {{- if .Values.afterScript }}
87
+ {{- range .Values.afterScript -}}
88
+ {{- if eq (typeOf .) "string" -}}
89
+ {{ $n := include "root.globalMap" (list $ .) }}
90
+ {{- $script := print (get $dict "key") $n ";" -}}
91
+ {{- $_ := set $dict "key" $script -}}
92
+ {{- end -}}
93
+ {{- end -}}
94
+ {{- end -}}
95
+
96
+ {{- $script := get $dict "key" -}}
97
+ {{- if not (empty $script) }}
98
+ args: ["-c", {{ print $script | quote }}]
99
+ {{- end }}
100
+ {{- else }}
101
+ {{- if .Values.command }}
102
+ command:
103
+ {{- toYaml .Values.command | nindent 10 }}
104
+ {{- end }}
105
+ {{- end }}
106
+ {{- if and (hasKey .Values "service") }}
107
+ {{- if .Values.service.ports }}
108
+ ports:
109
+ {{- range $.Values.service.ports }}
110
+ - containerPort: {{ .targetPort | default .port }}
111
+ {{- end }}
112
+ {{- end }}
113
+ {{- if .Values.service.port }}
114
+ ports:
115
+ - containerPort: {{ .Values.service.targetPort | default .Values.service.port | default "" }}
116
+ {{- end }}
117
+ {{- end }}
118
+ {{- if .Values.readinessProbe }}
119
+ readinessProbe:
120
+ {{- toYaml .Values.readinessProbe | nindent 10 }}
121
+ {{- end }}
122
+ {{- if .Values.livenessProbe }}
123
+ livenessProbe:
124
+ {{- toYaml .Values.livenessProbe | nindent 10 }}
125
+ {{- end }}
126
+ env:
127
+ {{- range $key, $value := .Values.secret }}
128
+ - name: {{ $key }}
129
+ valueFrom:
130
+ secretKeyRef:
131
+ {{- if eq (typeOf $value) "string" }}
132
+ name: {{ include (print $.Chart.Name ".fullname") $ }}
133
+ key: {{ $key }}
134
+ {{- else }}
135
+ name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
136
+ {{- if .key }}
137
+ key: {{ .key }}
138
+ {{- else }}
139
+ key: {{ $key }}
140
+ {{- end }}
141
+ {{- end }}
142
+ {{- end }}
143
+ {{- range $key, $value := .Values.config }}
144
+ - name: {{ $key }}
145
+ valueFrom:
146
+ configMapKeyRef:
147
+ {{- if eq (typeOf $value) "string" }}
148
+ name: {{ include (print $.Chart.Name ".fullname") $ }}
149
+ key: {{ $key }}
150
+ {{- else }}
151
+ name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
152
+ {{- if .key }}
153
+ key: {{ .key }}
154
+ {{- else }}
155
+ key: {{ $key }}
156
+ {{- end }}
157
+ {{- end }}
158
+ {{- end }}
159
+ {{- range $key, $value := .Values.env }}
160
+ - name: {{ $key }}
161
+ value: {{ include "root.globalMap" (list $ $value) | quote }}
162
+ {{- end }}
163
+ {{- if $.Values.volumeMounts }}
164
+ volumeMounts:
165
+ {{- range $.Values.volumeMounts }}
166
+ - name: {{ .name }}
167
+ {{- if .mountPath }}
168
+ mountPath: {{ include "root.globalMap" (list $ .mountPath) | quote }}
169
+ {{- end }}
170
+ {{- if .subPath }}
171
+ subPath: {{ include "root.globalMap" (list $ .subPath) | quote }}
172
+ {{- end }}
173
+ {{- if .readOnly }}
174
+ readOnly: {{ .readOnly }}
175
+ {{- end }}
176
+ {{- end }}
177
+ {{- end }}
178
+ {{- if $.Values.volumes }}
179
+ volumes:
180
+ {{- range $.Values.volumes }}
181
+ {{- if .secret }}
182
+ - name: {{ .name }}
183
+ {{- with .secret }}
184
+ secret:
185
+ {{- if .defaultMode }}
186
+ defaultMode: {{ .defaultMode }}
187
+ {{- end }}
188
+ {{- if .items }}
189
+ items:
190
+ {{- range .items }}
191
+ - key: {{ .key }}
192
+ path: {{ .path }}
193
+ {{- end }}
194
+ {{- end }}
195
+ {{- if .secretName }}
196
+ secretName: {{ .secretName }}
197
+ {{- else }}
198
+ secretName: {{ include (print $.Chart.Name ".fullname") $ }}
199
+ {{- end }}
200
+ {{- end }}
201
+ {{- else if .configMap }}
202
+ - name: {{ .name }}
203
+ {{- with .configMap }}
204
+ configMap:
205
+ name: {{ include "root.globalMap" (list $ .name) | default (include (print $.Chart.Name ".fullname") $) | quote }}
206
+ {{- end }}
207
+ {{- else if .hostPath }}
208
+ - name: {{ .name }}
209
+ {{- with .hostPath }}
210
+ hostPath:
211
+ path: {{ include "root.globalMap" (list $ .path) }}
212
+ type: {{ .type }}
213
+ {{- end }}
214
+ {{- else if .nfs }}
215
+ - name: {{ .name }}
216
+ {{- with .nfs }}
217
+ nfs:
218
+ server: {{ include "root.globalMap" (list $ .server) }}
219
+ path: {{ include "root.globalMap" (list $ .path) }}
220
+ {{- end }}
221
+ {{- else if .persistentVolumeClaim }}
222
+ - name: {{ .name }}
223
+ {{- with .persistentVolumeClaim }}
224
+ persistentVolumeClaim:
225
+ claimName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .claimName }}
226
+ {{- end }}
227
+ {{- else }}
228
+ {{- toYaml . | nindent 8 }}
229
+ {{- end }}
230
+ {{- end }}
231
+ {{- end }}
232
+ {{- end }}
233
+ {{- end }}
@@ -0,0 +1,214 @@
1
+ {{- define "root.pod" -}}
2
+ {{- if and .Values.enabled (.Values.kind | default "" | lower | eq "pod") -}}
3
+ apiVersion: v1
4
+ kind: Pod
5
+ metadata:
6
+ name: {{ include (print $.Chart.Name ".fullname") . }}
7
+ {{- if .Values.annotations }}
8
+ {{- with .Values.annotations }}
9
+ annotations:
10
+ {{- toYaml . | nindent 4 }}
11
+ {{- end }}
12
+ {{- end }}
13
+ spec:
14
+ {{- if and (hasKey .Values "serviceAccountName") }}
15
+ serviceAccountName: {{ include "root.globalMap" (list $ .Values.serviceAccountName) | default (include (print $.Chart.Name ".fullname") $) | quote }}
16
+ {{- end }}
17
+ {{- with .Values.imagePullSecrets }}
18
+ imagePullSecrets:
19
+ - name: {{ include "root.globalMap" (list $ .) | quote }}
20
+ {{- end }}
21
+ {{- if .Values.nodeSelector }}
22
+ {{- with .Values.nodeSelector }}
23
+ nodeSelector:
24
+ {{- toYaml . | nindent 4 }}
25
+ {{- end }}
26
+ {{- end }}
27
+ {{- if .Values.initContainers }}
28
+ {{- with .Values.initContainers }}
29
+ initContainers:
30
+ {{- toYaml . | nindent 4 }}
31
+ {{- end }}
32
+ {{- end }}
33
+ {{- if .Values.restartPolicy }}
34
+ restartPolicy: {{ .Values.restartPolicy }}
35
+ {{- end }}
36
+ containers:
37
+ - name: {{ include (print $.Chart.Name ".fullname") . }}
38
+ image: {{ .Values.image.repository }}:{{ .Values.image.tag | default $.Chart.AppVersion }}
39
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
40
+ {{- if .Values.resources }}
41
+ resources:
42
+ {{- toYaml .Values.resources | nindent 6 }}
43
+ {{- end }}
44
+ {{- if or .Values.script (or .Values.beforeScript .Values.afterScript) }}
45
+ command: ["/bin/sh"]
46
+ {{- $dict := (dict "key" "") -}}
47
+
48
+ {{- if .Values.beforeScript }}
49
+ {{- range .Values.beforeScript -}}
50
+ {{- if eq (typeOf .) "string" -}}
51
+ {{ $n := include "root.globalMap" (list $ .) }}
52
+ {{- $script := print (get $dict "key") $n ";" -}}
53
+ {{- $_ := set $dict "key" $script -}}
54
+ {{- end -}}
55
+ {{- end -}}
56
+ {{- end -}}
57
+
58
+ {{- if .Values.script }}
59
+ {{- range .Values.script -}}
60
+ {{- if eq (typeOf .) "string" -}}
61
+ {{ $n := include "root.globalMap" (list $ .) }}
62
+ {{- $script := print (get $dict "key") $n ";" -}}
63
+ {{- $_ := set $dict "key" $script -}}
64
+ {{- end -}}
65
+ {{- end -}}
66
+ {{- end -}}
67
+
68
+ {{- if .Values.afterScript }}
69
+ {{- range .Values.afterScript -}}
70
+ {{- if eq (typeOf .) "string" -}}
71
+ {{ $n := include "root.globalMap" (list $ .) }}
72
+ {{- $script := print (get $dict "key") $n ";" -}}
73
+ {{- $_ := set $dict "key" $script -}}
74
+ {{- end -}}
75
+ {{- end -}}
76
+ {{- end -}}
77
+
78
+ {{- $script := get $dict "key" -}}
79
+ {{- if not (empty $script) }}
80
+ args: ["-c", {{ print $script | quote }}]
81
+ {{- end }}
82
+ {{- else }}
83
+ {{- if .Values.command }}
84
+ command:
85
+ {{- toYaml .Values.command | nindent 6 }}
86
+ {{- end }}
87
+ {{- end }}
88
+ {{- if and (hasKey .Values "service") }}
89
+ {{- if .Values.service.ports }}
90
+ ports:
91
+ {{- range $.Values.service.ports }}
92
+ - containerPort: {{ .targetPort | default .port }}
93
+ {{- end }}
94
+ {{- end }}
95
+ {{- if .Values.service.port }}
96
+ ports:
97
+ - containerPort: {{ .Values.service.targetPort | default .Values.service.port | default "" }}
98
+ {{- end }}
99
+ {{- end }}
100
+ {{- if .Values.readinessProbe }}
101
+ readinessProbe:
102
+ {{- toYaml .Values.readinessProbe | nindent 6 }}
103
+ {{- end }}
104
+ {{- if .Values.livenessProbe }}
105
+ livenessProbe:
106
+ {{- toYaml .Values.livenessProbe | nindent 6 }}
107
+ {{- end }}
108
+ env:
109
+ {{- range $key, $value := .Values.secret }}
110
+ - name: {{ $key }}
111
+ valueFrom:
112
+ secretKeyRef:
113
+ {{- if eq (typeOf $value) "string" }}
114
+ name: {{ include (print $.Chart.Name ".fullname") $ }}
115
+ key: {{ $key }}
116
+ {{- else }}
117
+ name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
118
+ {{- if .key }}
119
+ key: {{ .key }}
120
+ {{- else }}
121
+ key: {{ $key }}
122
+ {{- end }}
123
+ {{- end }}
124
+ {{- end }}
125
+ {{- range $key, $value := .Values.config }}
126
+ - name: {{ $key }}
127
+ valueFrom:
128
+ configMapKeyRef:
129
+ {{- if eq (typeOf $value) "string" }}
130
+ name: {{ include (print $.Chart.Name ".fullname") $ }}
131
+ key: {{ $key }}
132
+ {{- else }}
133
+ name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
134
+ {{- if .key }}
135
+ key: {{ .key }}
136
+ {{- else }}
137
+ key: {{ $key }}
138
+ {{- end }}
139
+ {{- end }}
140
+ {{- end }}
141
+ {{- range $key, $value := .Values.env }}
142
+ - name: {{ $key }}
143
+ value: {{ include "root.globalMap" (list $ $value) | quote }}
144
+ {{- end }}
145
+ {{- if $.Values.volumeMounts }}
146
+ volumeMounts:
147
+ {{- range $.Values.volumeMounts }}
148
+ - name: {{ .name }}
149
+ {{- if .mountPath }}
150
+ mountPath: {{ include "root.globalMap" (list $ .mountPath) | quote }}
151
+ {{- end }}
152
+ {{- if .subPath }}
153
+ subPath: {{ include "root.globalMap" (list $ .subPath) | quote }}
154
+ {{- end }}
155
+ {{- if .readOnly }}
156
+ readOnly: {{ .readOnly }}
157
+ {{- end }}
158
+ {{- end }}
159
+ {{- end }}
160
+ {{- if $.Values.volumes }}
161
+ volumes:
162
+ {{- range $.Values.volumes }}
163
+ {{- if .secret }}
164
+ - name: {{ .name }}
165
+ {{- with .secret }}
166
+ secret:
167
+ {{- if .defaultMode }}
168
+ defaultMode: {{ .defaultMode }}
169
+ {{- end }}
170
+ {{- if .items }}
171
+ items:
172
+ {{- range .items }}
173
+ - key: {{ .key }}
174
+ path: {{ .path }}
175
+ {{- end }}
176
+ {{- end }}
177
+ {{- if .secretName }}
178
+ secretName: {{ .secretName }}
179
+ {{- else }}
180
+ secretName: {{ include (print $.Chart.Name ".fullname") $ }}
181
+ {{- end }}
182
+ {{- end }}
183
+ {{- else if .configMap }}
184
+ - name: {{ .name }}
185
+ {{- with .configMap }}
186
+ configMap:
187
+ name: {{ include "root.globalMap" (list $ .name) | default (include (print $.Chart.Name ".fullname") $) | quote }}
188
+ {{- end }}
189
+ {{- else if .hostPath }}
190
+ - name: {{ .name }}
191
+ {{- with .hostPath }}
192
+ hostPath:
193
+ path: {{ include "root.globalMap" (list $ .path) }}
194
+ type: {{ .type }}
195
+ {{- end }}
196
+ {{- else if .nfs }}
197
+ {{- with .nfs }}
198
+ nfs:
199
+ server: {{ include "root.globalMap" (list $ .server) }}
200
+ path: {{ include "root.globalMap" (list $ .path) }}
201
+ {{- end }}
202
+ {{- else if .persistentVolumeClaim }}
203
+ - name: {{ .name }}
204
+ {{- with .persistentVolumeClaim }}
205
+ persistentVolumeClaim:
206
+ claimName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .claimName }}
207
+ {{- end }}
208
+ {{- else }}
209
+ {{- toYaml . | nindent 4 }}
210
+ {{- end }}
211
+ {{- end }}
212
+ {{- end }}
213
+ {{- end }}
214
+ {{- end }}
@@ -0,0 +1,42 @@
1
+ {{- define "root.pv" -}}
2
+ {{- if and .Values.enabled (hasKey .Values "PersistentVolume") -}}
3
+ {{- range .Values.PersistentVolume }}
4
+ apiVersion: v1
5
+ kind: PersistentVolume
6
+ metadata:
7
+ name: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .name }}
8
+ {{- if .annotations }}
9
+ {{- with .annotations }}
10
+ annotations:
11
+ {{- toYaml . | nindent 4 }}
12
+ {{- end }}
13
+ {{- end }}
14
+ spec:
15
+ {{- if .storageClassName }}
16
+ storageClassName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .storageClassName }}
17
+ {{- end }}
18
+ persistentVolumeReclaimPolicy: {{ .persistentVolumeReclaimPolicy | default "Delete" }}
19
+ accessModes:
20
+ - {{ .accessModes | default "ReadWriteMany" }}
21
+ capacity:
22
+ storage: {{ .capacity }}
23
+ {{- if .mountOptions }}
24
+ {{- with .mountOptions }}
25
+ mountOptions:
26
+ {{- toYaml . | nindent 4 }}
27
+ {{- end }}
28
+ {{- end }}
29
+
30
+ {{- if .nfs }}
31
+ {{- with .nfs }}
32
+ nfs:
33
+ server: {{ include "root.globalMap" (list $ .server) }}
34
+ path: {{ include "root.globalMap" (list $ .path) }}
35
+ {{- end }}
36
+ {{- else }}
37
+ {{- toYaml . | nindent 2 }}
38
+ {{- end }}
39
+ {{- "---" | nindent 0 }}
40
+ {{- end }}
41
+ {{- end }}
42
+ {{- end }}
@@ -0,0 +1,27 @@
1
+ {{- define "root.pvc" -}}
2
+ {{- if and .Values.enabled (hasKey .Values "PersistentVolumeClaim") -}}
3
+ {{- range .Values.PersistentVolumeClaim }}
4
+ apiVersion: v1
5
+ kind: PersistentVolumeClaim
6
+ metadata:
7
+ name: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .name }}
8
+ {{- if .annotations }}
9
+ {{- with .annotations }}
10
+ annotations:
11
+ {{- toYaml . | nindent 4 }}
12
+ {{- end }}
13
+ {{- end }}
14
+ spec:
15
+ {{- if .storageClassName }}
16
+ storageClassName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .storageClassName }}
17
+ {{- end }}
18
+ volumeName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .volumeName }}
19
+ accessModes:
20
+ - {{ .accessModes | default "ReadWriteMany" }}
21
+ resources:
22
+ requests:
23
+ storage: {{ .capacity }}
24
+ {{- "---" | nindent 0 }}
25
+ {{- end }}
26
+ {{- end }}
27
+ {{- end }}