@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.
- package/.gitlab-ci.yml +135 -0
- package/Makefile +16 -9
- package/README.md +18 -2
- package/alias-script.sh +30 -0
- package/dist/index.js +106 -128
- package/dist/index.js.map +1 -1
- package/dist/templates/db-schema/.gitignore-rename +1 -0
- package/dist/templates/db-schema/.gitlab-ci.yml +139 -0
- package/dist/templates/db-schema/001_Schema.sql +1 -0
- package/dist/templates/db-schema/DEV_MODE.txt +1 -0
- package/dist/templates/db-schema/Dockerfile +3 -0
- package/dist/templates/db-schema/Email-Templates/Individual/README.md +1 -0
- package/dist/templates/db-schema/GET_VERSION.sql +47 -0
- package/dist/templates/db-schema/Makefile +885 -0
- package/dist/templates/db-schema/README.md +117 -0
- package/dist/templates/db-schema/SET_VERSION.sql +5 -0
- package/dist/templates/db-schema/docker-compose.yaml +47 -0
- package/dist/templates/db-schema/package.json +3 -0
- package/dist/templates/db-schema/push.sh +0 -0
- package/dist/templates/db-schema/samples/899_DB_Grant_User.sql +9 -0
- package/dist/templates/db-schema/samples/990_SAMPLE_Init_Data.sql +27 -0
- package/dist/templates/k8s-deployment/.gitignore-rename +1 -0
- package/dist/templates/k8s-deployment/.gitlab-ci.yml +128 -0
- package/dist/templates/k8s-deployment/.helmignore +23 -0
- package/dist/templates/k8s-deployment/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/Makefile +196 -0
- package/dist/templates/k8s-deployment/README.md +32 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/values.yaml +51 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/values.yaml +15 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/values.yaml +42 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/values.yaml +12 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +49 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/_env.yaml +2 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/values.yaml +36 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cluster-role-binding.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cronjob.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service-account.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/values.yaml +47 -0
- package/dist/templates/k8s-deployment/services/charts/tests/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/fixtures/index.json +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/login-spec.js +47 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginEmailWrong-spec.js +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginPasswordWrong-spec.js +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updatePassword-spec.js +15 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updateProfile-spec.js +25 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/test-script.spec.js +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/plugins/index.js +22 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/commands.js +258 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/index.js +35 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/misc.js +8 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress.json +4 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/pod.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/values.yaml +70 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/.helmignore +2 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/pod.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/live.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/mykad_front.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/profile.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/values.yaml +59 -0
- package/dist/templates/k8s-deployment/templates/_cluster-role-binding.tpl +20 -0
- package/dist/templates/k8s-deployment/templates/_configmap.tpl +37 -0
- package/dist/templates/k8s-deployment/templates/_cronjob.tpl +225 -0
- package/dist/templates/k8s-deployment/templates/_deployment.tpl +246 -0
- package/dist/templates/k8s-deployment/templates/_helpers.tpl +31 -0
- package/dist/templates/k8s-deployment/templates/_ingress.tpl +77 -0
- package/dist/templates/k8s-deployment/templates/_job.tpl +233 -0
- package/dist/templates/k8s-deployment/templates/_pod.tpl +214 -0
- package/dist/templates/k8s-deployment/templates/_pv.tpl +42 -0
- package/dist/templates/k8s-deployment/templates/_pvc.tpl +27 -0
- package/dist/templates/k8s-deployment/templates/_root.tpl +314 -0
- package/dist/templates/k8s-deployment/templates/_sc.tpl +19 -0
- package/dist/templates/k8s-deployment/templates/_secret.tpl +15 -0
- package/dist/templates/k8s-deployment/templates/_service-account.tpl +8 -0
- package/dist/templates/k8s-deployment/templates/_service.tpl +40 -0
- package/dist/templates/k8s-deployment/templates/_statefulset.tpl +244 -0
- package/dist/templates/k8s-deployment/templates/root-cm.yaml +10 -0
- package/dist/templates/k8s-deployment/templates/root-pull-secret.yaml +11 -0
- package/dist/templates/k8s-deployment/templates/root-secret.yaml +24 -0
- package/dist/templates/k8s-deployment/values.yaml +38 -0
- package/dist/templates/k8s-helm-chart/Chart.yaml +23 -0
- package/dist/templates/k8s-helm-chart/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-helm-chart/templates/cluster-role-binding.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/cronjob.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/pv.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/sc.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/secret.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/service-account.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/service.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-helm-chart/values.yaml +41 -0
- package/dist/templates/mxw-base-api-express/.dockerignore +2 -0
- package/dist/templates/mxw-base-api-express/.env +10 -0
- package/dist/templates/mxw-base-api-express/.gitignore-rename +3 -0
- package/dist/templates/mxw-base-api-express/.gitlab-ci.yml +174 -0
- package/dist/templates/mxw-base-api-express/.nvmrc +1 -0
- package/dist/templates/mxw-base-api-express/Dockerfile +14 -0
- package/dist/templates/mxw-base-api-express/Makefile +84 -0
- package/dist/templates/mxw-base-api-express/README.md +71 -0
- package/dist/templates/mxw-base-api-express/package.json +55 -0
- package/dist/templates/mxw-base-api-express/src/app-service.test.ts +94 -0
- package/dist/templates/mxw-base-api-express/src/app-service.ts +498 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.test.ts +215 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.ts +86 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth.ts +81 -0
- package/dist/templates/mxw-base-api-express/src/core-service.ts +72 -0
- package/dist/templates/mxw-base-api-express/src/crud.ts +84 -0
- package/dist/templates/mxw-base-api-express/src/http-handler.ts +71 -0
- package/dist/templates/mxw-base-api-express/src/server.ts +54 -0
- package/dist/templates/mxw-base-api-express/src/test.ts +38 -0
- package/dist/templates/mxw-base-api-express/src/utils/api-utilities.ts +52 -0
- package/dist/templates/mxw-base-api-express/src/utils/file-utilities.ts +55 -0
- package/dist/templates/mxw-base-api-express/tsconfig.json +32 -0
- package/dist/templates/nestjs-api/.dockerignore +2 -0
- package/dist/templates/nestjs-api/.env +12 -0
- package/dist/templates/nestjs-api/.eslintrc.js +25 -0
- package/dist/templates/nestjs-api/.gitignore-rename +35 -0
- package/dist/templates/nestjs-api/.gitlab-ci.yml +174 -0
- package/dist/templates/nestjs-api/.nvmrc +1 -0
- package/dist/templates/nestjs-api/.prettierrc +4 -0
- package/dist/templates/nestjs-api/Dockerfile +19 -0
- package/dist/templates/nestjs-api/Makefile +84 -0
- package/dist/templates/nestjs-api/README.md +67 -0
- package/dist/templates/nestjs-api/nest-cli.json +8 -0
- package/dist/templates/nestjs-api/package.json +75 -0
- package/dist/templates/nestjs-api/src/app.controller.spec.ts +22 -0
- package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
- package/dist/templates/nestjs-api/src/app.module.ts +10 -0
- package/dist/templates/nestjs-api/src/app.service.ts +12 -0
- package/dist/templates/nestjs-api/src/main.ts +31 -0
- package/dist/templates/nestjs-api/test/app.e2e-spec.ts +24 -0
- package/dist/templates/nestjs-api/test/jest-e2e.json +9 -0
- package/dist/templates/nestjs-api/tsconfig.build.json +4 -0
- package/dist/templates/nestjs-api/tsconfig.json +22 -0
- package/dist/templates/nestjs-library/.eslintrc.js +24 -0
- package/dist/templates/nestjs-library/.gitignore-rename +39 -0
- package/dist/templates/nestjs-library/.gitlab-ci.yml +135 -0
- package/dist/templates/nestjs-library/.npmignore-rename +30 -0
- package/dist/templates/nestjs-library/.prettierrc +6 -0
- package/dist/templates/nestjs-library/LICENSE +21 -0
- package/dist/templates/nestjs-library/Makefile +60 -0
- package/dist/templates/nestjs-library/README.md +3 -0
- package/dist/templates/nestjs-library/index.d.ts +1 -0
- package/dist/templates/nestjs-library/index.js +6 -0
- package/dist/templates/nestjs-library/index.ts +1 -0
- package/dist/templates/nestjs-library/lib/index.ts +2 -0
- package/dist/templates/nestjs-library/package.json +41 -0
- package/dist/templates/nestjs-library/tsconfig.build.json +4 -0
- package/dist/templates/nestjs-library/tsconfig.json +18 -0
- package/dist/templates/ts-library/.dockerignore +2 -0
- package/dist/templates/ts-library/.eslintrc.js +24 -0
- package/dist/templates/ts-library/.gitignore-rename +37 -0
- package/dist/templates/ts-library/.gitlab-ci.yml +135 -0
- package/dist/templates/ts-library/.npmignore-rename +30 -0
- package/dist/templates/ts-library/.prettierrc +6 -0
- package/dist/templates/ts-library/LICENSE +21 -0
- package/dist/templates/ts-library/Makefile +58 -0
- package/dist/templates/ts-library/README.md +1 -0
- package/dist/templates/ts-library/index.d.ts +1 -0
- package/dist/templates/ts-library/index.js +6 -0
- package/dist/templates/ts-library/index.ts +1 -0
- package/dist/templates/ts-library/lib/index.ts +1 -0
- package/dist/templates/ts-library/lib/samples/index.ts +5 -0
- package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
- package/dist/templates/ts-library/package.json +34 -0
- package/dist/templates/ts-library/test/jest-e2e.json +9 -0
- package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
- package/dist/templates/ts-library/tsconfig.build.json +4 -0
- package/dist/templates/ts-library/tsconfig.json +18 -0
- package/dist/utils/env.js +146 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/template.js +362 -1
- package/dist/utils/template.js.map +1 -1
- package/package.json +9 -5
- package/src/index.ts +0 -182
- package/src/utils/template.ts +0 -9
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{{/*
|
|
2
|
+
Expand the name of the chart.
|
|
3
|
+
*/}}
|
|
4
|
+
{{- define "root.name" -}}
|
|
5
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
+
{{- end }}
|
|
7
|
+
|
|
8
|
+
{{/*
|
|
9
|
+
Create a default fully qualified app name.
|
|
10
|
+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
|
+
If release name contains chart name it will be used as a full name.
|
|
12
|
+
*/}}
|
|
13
|
+
{{- define "root.fullname" -}}
|
|
14
|
+
{{- if .Values.fullnameOverride }}
|
|
15
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
16
|
+
{{- else }}
|
|
17
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
18
|
+
{{- if contains $name .Release.Name }}
|
|
19
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
20
|
+
{{- else }}
|
|
21
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
22
|
+
{{- end }}
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
|
|
26
|
+
{{/*
|
|
27
|
+
Create chart name and version as used by the chart label.
|
|
28
|
+
*/}}
|
|
29
|
+
{{- define "root.chart" -}}
|
|
30
|
+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
31
|
+
{{- end }}
|
|
32
|
+
|
|
33
|
+
{{/*
|
|
34
|
+
Define deployment common settings
|
|
35
|
+
*/}}
|
|
36
|
+
|
|
37
|
+
{{- define "root.global.SERVICE_BASE_DOMAIN" -}}
|
|
38
|
+
{{ .Values.global.root.SERVICE_BASE_DOMAIN | default "DEFAULT" }}
|
|
39
|
+
{{- end }}
|
|
40
|
+
|
|
41
|
+
{{- define "root.global.SERVICE_BASE_NAME" -}}
|
|
42
|
+
{{ $.Release.Name | lower }}
|
|
43
|
+
{{- end }}
|
|
44
|
+
|
|
45
|
+
{{- define "root.global.SERVICE_BASE_URL" -}}
|
|
46
|
+
{{- include "root.global.SERVICE_BASE_DOMAIN" . }}/{{- include "root.global.SERVICE_BASE_NAME" . }}
|
|
47
|
+
{{- end }}
|
|
48
|
+
|
|
49
|
+
{{- define "root.global.CLUSTER_DOMAIN" -}}
|
|
50
|
+
{{ .Values.global.root.CLUSTER_DOMAIN | default "cluster.local" }}
|
|
51
|
+
{{- end }}
|
|
52
|
+
|
|
53
|
+
{{- define "root.global.CLUSTER_NAMESPACE" -}}
|
|
54
|
+
{{ $.Release.Namespace | lower }}
|
|
55
|
+
{{- end }}
|
|
56
|
+
|
|
57
|
+
{{/*
|
|
58
|
+
Define deployment global settings
|
|
59
|
+
*/}}
|
|
60
|
+
|
|
61
|
+
{{- define "array" -}}
|
|
62
|
+
{{- $array := first . -}}
|
|
63
|
+
{{- $type := typeOf $array -}}
|
|
64
|
+
|
|
65
|
+
{{- if or (eq $type "[]interface {}") (eq $type "map[string]interface {}") -}}
|
|
66
|
+
{{- $key := (index . 1) -}}
|
|
67
|
+
{{- if eq (typeOf $key) "int" -}}
|
|
68
|
+
{{- if ge (len $array) $key -}}
|
|
69
|
+
{{- index $array $key | default "" -}}
|
|
70
|
+
{{- end -}}
|
|
71
|
+
{{- else -}}
|
|
72
|
+
{{- index $array $key | default "" -}}
|
|
73
|
+
{{- end -}}
|
|
74
|
+
{{- end -}}
|
|
75
|
+
{{- end -}}
|
|
76
|
+
|
|
77
|
+
{{- define "root.globalMap" -}}
|
|
78
|
+
{{- $env := first . -}}
|
|
79
|
+
{{- $value := include "array" (list . 1) -}}
|
|
80
|
+
|
|
81
|
+
{{- $value := include "root._globalMap" (list $env $value "{{" "}}") -}}
|
|
82
|
+
{{- $value := include "root._globalMap" (list $env $value "$" "") -}}
|
|
83
|
+
{{- $value := include "root._globalMap" (list $env $value "${" "}") -}}
|
|
84
|
+
|
|
85
|
+
{{- $dict := (dict "key" $value) -}}
|
|
86
|
+
|
|
87
|
+
{{- range (until 5) -}}
|
|
88
|
+
{{- range (list (list "{{" "}}") (list "$" "") (list "${" "}")) -}}
|
|
89
|
+
{{- $prefix := first . -}}
|
|
90
|
+
{{- $postfix := include "array" (list . 1) -}}
|
|
91
|
+
|
|
92
|
+
{{- if and (contains $prefix $value) (contains $postfix $value) -}}
|
|
93
|
+
{{- $value := get $dict "key" -}}
|
|
94
|
+
{{- $n := include "root._globalMap" (list $env $value $prefix $postfix) -}}
|
|
95
|
+
{{- if not (eq $n $value) -}}
|
|
96
|
+
{{- $_ := set $dict "key" $n -}}
|
|
97
|
+
{{- end -}}
|
|
98
|
+
{{- end -}}
|
|
99
|
+
{{- end -}}
|
|
100
|
+
{{- end -}}
|
|
101
|
+
|
|
102
|
+
{{- get $dict "key" | default "" -}}
|
|
103
|
+
{{- end -}}
|
|
104
|
+
|
|
105
|
+
{{- define "root._globalMap" -}}
|
|
106
|
+
{{- $env := first . -}}
|
|
107
|
+
{{- $value := include "array" (list . 1) -}}
|
|
108
|
+
{{- $prefix := include "array" (list . 2) -}}
|
|
109
|
+
{{- $postfix := include "array" (list . 3) -}}
|
|
110
|
+
|
|
111
|
+
{{- $value := replace (print $prefix "Release.Name" $postfix) $env.Release.Name $value -}}
|
|
112
|
+
{{- $value := replace (print $prefix "Release.Namespace" $postfix) (lower $env.Release.Namespace) $value -}}
|
|
113
|
+
{{- $value := replace (print $prefix "Chart.Name" $postfix) (lower $env.Chart.Name) $value -}}
|
|
114
|
+
{{- $value := replace (print $prefix "SERVICE_BASE_SCHEMA" $postfix) ($env.Values.global.root.SERVICE_BASE_SCHEMA | default "https") $value -}}
|
|
115
|
+
{{- $value := replace (print $prefix "SERVICE_BASE_DOMAIN" $postfix) ($env.Values.global.root.SERVICE_BASE_DOMAIN | default "") $value -}}
|
|
116
|
+
{{- $value := replace (print $prefix "SERVICE_BASE_NAME" $postfix) ($env.Release.Name | default "" | lower) $value -}}
|
|
117
|
+
{{- $value := replace (print $prefix "SERVICE_NAME" $postfix) (print $env.Release.Name "_" $env.Chart.Name | replace "-" "_" | lower) $value -}}
|
|
118
|
+
|
|
119
|
+
{{- $v := print $env.Values.global.root.SERVICE_BASE_SCHEMA "://" $env.Values.global.root.SERVICE_BASE_DOMAIN "/" $env.Release.Name -}}
|
|
120
|
+
{{- $value := replace (print $prefix "SERVICE_BASE_URL" $postfix) ($v | default "" | lower) $value -}}
|
|
121
|
+
|
|
122
|
+
{{- $value := replace (print $prefix "CLUSTER_DOMAIN" $postfix) ((include "root.global.CLUSTER_DOMAIN" $env) | default "") $value -}}
|
|
123
|
+
{{- $value := replace (print $prefix "CLUSTER_NAMESPACE" $postfix) ((include "root.global.CLUSTER_NAMESPACE" $env) | default "") $value -}}
|
|
124
|
+
|
|
125
|
+
{{- $dict := (dict "key" $value) -}}
|
|
126
|
+
|
|
127
|
+
{{- if $env.Values.config -}}
|
|
128
|
+
{{- range $k, $v := $env.Values.config -}}
|
|
129
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
130
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
131
|
+
{{- $value := get $dict "key" -}}
|
|
132
|
+
{{- $n := replace $key $v $value -}}
|
|
133
|
+
|
|
134
|
+
{{- if not (eq $n $value) -}}
|
|
135
|
+
{{- $_ := set $dict "key" $n -}}
|
|
136
|
+
{{- end -}}
|
|
137
|
+
{{- else -}}
|
|
138
|
+
{{- if hasKey $v "service" -}}
|
|
139
|
+
{{- with index $v "service" -}}
|
|
140
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
141
|
+
{{- $value := get $dict "key" -}}
|
|
142
|
+
|
|
143
|
+
{{- $v := include "root.globalValue" (list $env "CLUSTER_BASE_URL" .schema .name .namespace .domain .port) -}}
|
|
144
|
+
{{- $n := replace $key $v $value -}}
|
|
145
|
+
|
|
146
|
+
{{- if not (eq $n $value) -}}
|
|
147
|
+
{{- $_ := set $dict "key" $n -}}
|
|
148
|
+
{{- end -}}
|
|
149
|
+
{{- end -}}
|
|
150
|
+
{{- end -}}
|
|
151
|
+
{{- end -}}
|
|
152
|
+
{{- end -}}
|
|
153
|
+
{{- end -}}
|
|
154
|
+
|
|
155
|
+
{{- if $env.Values.env -}}
|
|
156
|
+
{{- range $k, $v := $env.Values.env -}}
|
|
157
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
158
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
159
|
+
{{- $value := get $dict "key" -}}
|
|
160
|
+
{{- $n := replace $key $v $value -}}
|
|
161
|
+
|
|
162
|
+
{{- if not (eq $n $value) -}}
|
|
163
|
+
{{- $_ := set $dict "key" $n -}}
|
|
164
|
+
{{- end -}}
|
|
165
|
+
{{- else -}}
|
|
166
|
+
{{- if hasKey $v "service" -}}
|
|
167
|
+
{{- with index $v "service" -}}
|
|
168
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
169
|
+
{{- $value := get $dict "key" -}}
|
|
170
|
+
|
|
171
|
+
{{- $v := include "root.globalValue" (list $env "CLUSTER_BASE_URL" .schema .name .namespace .domain .port) -}}
|
|
172
|
+
{{- $n := replace $key $v $value -}}
|
|
173
|
+
|
|
174
|
+
{{- if not (eq $n $value) -}}
|
|
175
|
+
{{- $_ := set $dict "key" $n -}}
|
|
176
|
+
{{- end -}}
|
|
177
|
+
{{- end -}}
|
|
178
|
+
{{- end -}}
|
|
179
|
+
{{- end -}}
|
|
180
|
+
{{- end -}}
|
|
181
|
+
{{- end -}}
|
|
182
|
+
|
|
183
|
+
{{- if $env.Values.secret -}}
|
|
184
|
+
{{- range $k, $v := $env.Values.secret -}}
|
|
185
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
186
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
187
|
+
{{- $value := get $dict "key" -}}
|
|
188
|
+
{{- $n := replace $key $v $value -}}
|
|
189
|
+
|
|
190
|
+
{{- if not (eq $n $value) -}}
|
|
191
|
+
{{- $_ := set $dict "key" $n -}}
|
|
192
|
+
{{- end -}}
|
|
193
|
+
{{- end -}}
|
|
194
|
+
{{- end -}}
|
|
195
|
+
{{- end -}}
|
|
196
|
+
|
|
197
|
+
{{- if and $env.Values.global $env.Values.global.root -}}
|
|
198
|
+
{{- range $k, $v := $env.Values.global.root -}}
|
|
199
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
200
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
201
|
+
{{- $value := get $dict "key" -}}
|
|
202
|
+
{{- $n := replace $key $v $value -}}
|
|
203
|
+
|
|
204
|
+
{{- if not (eq $n $value) -}}
|
|
205
|
+
{{- $_ := set $dict "key" $n -}}
|
|
206
|
+
{{- end -}}
|
|
207
|
+
{{- else -}}
|
|
208
|
+
{{- if hasKey $v "service" -}}
|
|
209
|
+
{{- with index $v "service" -}}
|
|
210
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
211
|
+
{{- $value := get $dict "key" -}}
|
|
212
|
+
|
|
213
|
+
{{- $v := include "root.globalValue" (list $env "CLUSTER_BASE_URL" .schema .name .namespace .domain .port) -}}
|
|
214
|
+
{{- $n := replace $key $v $value -}}
|
|
215
|
+
|
|
216
|
+
{{- if not (eq $n $value) -}}
|
|
217
|
+
{{- $_ := set $dict "key" $n -}}
|
|
218
|
+
{{- end -}}
|
|
219
|
+
{{- end -}}
|
|
220
|
+
{{- end -}}
|
|
221
|
+
{{- end -}}
|
|
222
|
+
{{- end -}}
|
|
223
|
+
{{- end -}}
|
|
224
|
+
|
|
225
|
+
{{- if and $env.Values.global $env.Values.global.env -}}
|
|
226
|
+
{{- range $k, $v := $env.Values.global.env -}}
|
|
227
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
228
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
229
|
+
{{- $value := get $dict "key" -}}
|
|
230
|
+
{{- $n := replace $key $v $value -}}
|
|
231
|
+
|
|
232
|
+
{{- if not (eq $n $value) -}}
|
|
233
|
+
{{- $_ := set $dict "key" $n -}}
|
|
234
|
+
{{- end -}}
|
|
235
|
+
{{- else -}}
|
|
236
|
+
{{- if hasKey $v "service" -}}
|
|
237
|
+
{{- with index $v "service" -}}
|
|
238
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
239
|
+
{{- $value := get $dict "key" -}}
|
|
240
|
+
|
|
241
|
+
{{- $v := include "root.globalValue" (list $env "CLUSTER_BASE_URL" .schema .name .namespace .domain .port) -}}
|
|
242
|
+
{{- $n := replace $key $v $value -}}
|
|
243
|
+
|
|
244
|
+
{{- if not (eq $n $value) -}}
|
|
245
|
+
{{- $_ := set $dict "key" $n -}}
|
|
246
|
+
{{- end -}}
|
|
247
|
+
{{- end -}}
|
|
248
|
+
{{- end -}}
|
|
249
|
+
{{- end -}}
|
|
250
|
+
{{- end -}}
|
|
251
|
+
{{- end -}}
|
|
252
|
+
|
|
253
|
+
{{- if and $env.Values.global $env.Values.global.secret -}}
|
|
254
|
+
{{- if and $env.Values.global.secret $env.Values.global.secret.root -}}
|
|
255
|
+
{{- range $k, $v := $env.Values.global.secret.root -}}
|
|
256
|
+
{{- if eq (typeOf $v) "string" -}}
|
|
257
|
+
{{- $key := print $prefix $k $postfix -}}
|
|
258
|
+
{{- $value := get $dict "key" -}}
|
|
259
|
+
{{- $n := replace $key $v $value -}}
|
|
260
|
+
|
|
261
|
+
{{- if not (eq $n $value) -}}
|
|
262
|
+
{{- $_ := set $dict "key" $n -}}
|
|
263
|
+
{{- end -}}
|
|
264
|
+
{{- end -}}
|
|
265
|
+
{{- end -}}
|
|
266
|
+
{{- end -}}
|
|
267
|
+
{{- end -}}
|
|
268
|
+
|
|
269
|
+
{{- get $dict "key" | default "" -}}
|
|
270
|
+
{{- end -}}
|
|
271
|
+
|
|
272
|
+
{{- define "root.global" -}}
|
|
273
|
+
{{- $env := first . -}}
|
|
274
|
+
|
|
275
|
+
{{- $value := include "root.globalValue" . -}}
|
|
276
|
+
{{- $value := include "root.globalMap" (list $env $value) -}}
|
|
277
|
+
{{- $value | default "" -}}
|
|
278
|
+
{{- end -}}
|
|
279
|
+
|
|
280
|
+
{{- define "root.globalValue" -}}
|
|
281
|
+
{{- $env := first . -}}
|
|
282
|
+
{{- $key := include "array" (list . 1) -}}
|
|
283
|
+
|
|
284
|
+
{{- if eq $key "CLUSTER_BASE_URL" -}}
|
|
285
|
+
{{- $schema := include "array" (list . 2) | default "http" -}}
|
|
286
|
+
{{- $service := include "array" (list . 3) -}}
|
|
287
|
+
{{- $namespace := include "array" (list . 4) | default $env.Release.Namespace -}}
|
|
288
|
+
{{- $domain := include "array" (list . 5) -}}
|
|
289
|
+
{{- $port := include "array" (list . 6) -}}
|
|
290
|
+
|
|
291
|
+
{{- print $schema "://" -}}
|
|
292
|
+
{{- include "root.global.SERVICE_BASE_NAME" $env }}{{- "-" -}}
|
|
293
|
+
{{ $service }}{{- "." -}}
|
|
294
|
+
{{ $namespace }}{{- "." -}}
|
|
295
|
+
{{- include "root.globalValue" (list $env "CLUSTER_DOMAIN" $domain) }}
|
|
296
|
+
{{- if $port -}}
|
|
297
|
+
{{- print ":" $port -}}
|
|
298
|
+
{{- end -}}
|
|
299
|
+
{{- else -}}
|
|
300
|
+
{{- $value := include "array" (list $env.Values.config $key) | default (index $env.Values.global.root $key) -}}
|
|
301
|
+
|
|
302
|
+
{{- if eq (typeOf $value) "string" -}}
|
|
303
|
+
{{- $value -}}
|
|
304
|
+
{{- else -}}
|
|
305
|
+
{{- if hasKey $value "service" -}}
|
|
306
|
+
{{- with index $value "service" -}}
|
|
307
|
+
{{- include "root.globalValue" (list $env "CLUSTER_BASE_URL" .schema .name .namespace .domain .port) -}}
|
|
308
|
+
{{- end -}}
|
|
309
|
+
{{- else -}}
|
|
310
|
+
{{ $key }}
|
|
311
|
+
{{- end -}}
|
|
312
|
+
{{- end -}}
|
|
313
|
+
{{- end -}}
|
|
314
|
+
{{- end }}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{- define "root.sc" -}}
|
|
2
|
+
{{- if and .Values.enabled (hasKey .Values "StorageClass") -}}
|
|
3
|
+
{{- range .Values.StorageClass }}
|
|
4
|
+
apiVersion: storage.k8s.io/v1
|
|
5
|
+
kind: StorageClass
|
|
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
|
+
reclaimPolicy: {{ .reclaimPolicy | default "Delete" }}
|
|
15
|
+
provisioner: {{ .provisioner }}
|
|
16
|
+
{{- "---" | nindent 0 }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
{{- end }}
|
|
19
|
+
{{- end }}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{{- define "root.secret" -}}
|
|
2
|
+
{{- if and .Values.enabled (hasKey .Values "secret") -}}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: Secret
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ include (print $.Chart.Name ".fullname") . }}
|
|
7
|
+
type: Opaque
|
|
8
|
+
data:
|
|
9
|
+
{{- range $key, $value := .Values.secret }}
|
|
10
|
+
{{- if eq (typeOf $value) "string" }}
|
|
11
|
+
{{- $key | nindent 2 }}: {{ include "root.globalMap" (list $ $value) | b64enc }}
|
|
12
|
+
{{- end }}
|
|
13
|
+
{{- end }}
|
|
14
|
+
{{- end }}
|
|
15
|
+
{{- end }}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{{- define "root.service-account" -}}
|
|
2
|
+
{{- if and .Values.enabled (and (hasKey .Values "serviceAccountName")) -}}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: ServiceAccount
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ include "root.globalMap" (list $ .Values.serviceAccountName) | default (include (print $.Chart.Name ".fullname") $) | quote }}
|
|
7
|
+
{{- end }}
|
|
8
|
+
{{- end }}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{{- define "root.service" -}}
|
|
2
|
+
{{- if and .Values.enabled .Values.service -}}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: Service
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ include (print $.Chart.Name ".fullname") . }}
|
|
7
|
+
{{- if .Values.service.annotations }}
|
|
8
|
+
{{- with .Values.service.annotations }}
|
|
9
|
+
annotations:
|
|
10
|
+
{{- toYaml . | nindent 4 }}
|
|
11
|
+
{{- end }}
|
|
12
|
+
{{- end }}
|
|
13
|
+
spec:
|
|
14
|
+
type: {{ .Values.service.type }}
|
|
15
|
+
{{- if .Values.service.loadBalancerIP }}
|
|
16
|
+
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
## set clusterIP to none to create headless services
|
|
19
|
+
{{- if .Values.service.clusterIP }}
|
|
20
|
+
clusterIP: {{ .Values.service.clusterIP }}
|
|
21
|
+
{{- end }}
|
|
22
|
+
ports:
|
|
23
|
+
{{- if .Values.service.ports }}
|
|
24
|
+
{{- range $.Values.service.ports }}
|
|
25
|
+
- port: {{ .port }}
|
|
26
|
+
targetPort: {{ .targetPort | default .port }}
|
|
27
|
+
protocol: {{ .protocol | default "TCP" }}
|
|
28
|
+
name: {{ .name | default "http" }}
|
|
29
|
+
{{- end }}
|
|
30
|
+
{{- end }}
|
|
31
|
+
{{- if .Values.service.port }}
|
|
32
|
+
- port: {{ .Values.service.port }}
|
|
33
|
+
targetPort: {{ .Values.service.targetPort | default .Values.service.port }}
|
|
34
|
+
protocol: TCP
|
|
35
|
+
name: http
|
|
36
|
+
{{- end }}
|
|
37
|
+
selector:
|
|
38
|
+
{{- include (print $.Chart.Name ".selectorLabels") . | nindent 4 }}
|
|
39
|
+
{{- end }}
|
|
40
|
+
{{- end }}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
{{- define "root.statefulset" -}}
|
|
2
|
+
{{- if and .Values.enabled (.Values.kind | default "" | lower | eq "statefulset") -}}
|
|
3
|
+
apiVersion: apps/v1
|
|
4
|
+
kind: StatefulSet
|
|
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
|
+
replicas: {{ .Values.replicaCount | default "1" }}
|
|
15
|
+
serviceName: {{ include (print $.Chart.Name ".fullname") . }}
|
|
16
|
+
podManagementPolicy: {{ .Values.podManagementPolicy | default "Parallel" }}
|
|
17
|
+
updateStrategy:
|
|
18
|
+
type: {{ .Values.updateStrategy | default "RollingUpdate" }}
|
|
19
|
+
selector:
|
|
20
|
+
matchLabels:
|
|
21
|
+
{{- include (print $.Chart.Name ".selectorLabels") . | nindent 6 }}
|
|
22
|
+
template:
|
|
23
|
+
metadata:
|
|
24
|
+
labels:
|
|
25
|
+
{{- include (print $.Chart.Name ".selectorLabels") . | nindent 8 }}
|
|
26
|
+
annotations:
|
|
27
|
+
{{- $dict := (dict "local" "") }}
|
|
28
|
+
{{- if .Values.secret }}
|
|
29
|
+
{{- $value := get $dict "local" }}
|
|
30
|
+
{{- $value := print $value (include (print $.Template.BasePath "/secret.yaml") .) | sha256sum }}
|
|
31
|
+
{{- $_ := set $dict "local" $value }}
|
|
32
|
+
{{- end }}
|
|
33
|
+
{{- if .Values.config }}
|
|
34
|
+
{{- $value := get $dict "local" }}
|
|
35
|
+
{{- $value := print $value (include (print $.Template.BasePath "/configmap.yaml") .) | sha256sum }}
|
|
36
|
+
{{- $_ := set $dict "local" $value }}
|
|
37
|
+
{{- end }}
|
|
38
|
+
kubernetes.io/change-cause: {{ get $dict "local" | sha256sum }}
|
|
39
|
+
spec:
|
|
40
|
+
{{- if .Values.securityContext }}
|
|
41
|
+
{{- with .Values.securityContext }}
|
|
42
|
+
securityContext:
|
|
43
|
+
{{- toYaml . | nindent 8 }}
|
|
44
|
+
{{- end }}
|
|
45
|
+
{{- end }}
|
|
46
|
+
{{- if and (hasKey .Values "serviceAccountName") }}
|
|
47
|
+
serviceAccountName: {{ include "root.globalMap" (list $ .Values.serviceAccountName) | default (include (print $.Chart.Name ".fullname") $) | quote }}
|
|
48
|
+
{{- end }}
|
|
49
|
+
{{- with .Values.imagePullSecrets }}
|
|
50
|
+
imagePullSecrets:
|
|
51
|
+
- name: {{ include "root.globalMap" (list $ .) | quote }}
|
|
52
|
+
{{- end }}
|
|
53
|
+
{{- if .Values.nodeSelector }}
|
|
54
|
+
{{- with .Values.nodeSelector }}
|
|
55
|
+
nodeSelector:
|
|
56
|
+
{{- toYaml . | nindent 8 }}
|
|
57
|
+
{{- end }}
|
|
58
|
+
{{- end }}
|
|
59
|
+
{{- if .Values.initContainers }}
|
|
60
|
+
{{- with .Values.initContainers }}
|
|
61
|
+
initContainers:
|
|
62
|
+
{{- toYaml . | nindent 8 }}
|
|
63
|
+
{{- end }}
|
|
64
|
+
{{- end }}
|
|
65
|
+
containers:
|
|
66
|
+
- name: {{ include (print $.Chart.Name ".fullname") . }}
|
|
67
|
+
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default $.Chart.AppVersion }}
|
|
68
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
69
|
+
{{- if .Values.resources }}
|
|
70
|
+
resources:
|
|
71
|
+
{{- toYaml .Values.resources | nindent 10 }}
|
|
72
|
+
{{- end }}
|
|
73
|
+
{{- if or .Values.script (or .Values.beforeScript .Values.afterScript) }}
|
|
74
|
+
command: ["/bin/sh"]
|
|
75
|
+
{{- $dict := (dict "key" "") -}}
|
|
76
|
+
|
|
77
|
+
{{- if .Values.beforeScript }}
|
|
78
|
+
{{- range .Values.beforeScript -}}
|
|
79
|
+
{{- if eq (typeOf .) "string" -}}
|
|
80
|
+
{{ $n := include "root.globalMap" (list $ .) }}
|
|
81
|
+
{{- $script := print (get $dict "key") $n ";" -}}
|
|
82
|
+
{{- $_ := set $dict "key" $script -}}
|
|
83
|
+
{{- end -}}
|
|
84
|
+
{{- end -}}
|
|
85
|
+
{{- end -}}
|
|
86
|
+
|
|
87
|
+
{{- if .Values.script }}
|
|
88
|
+
{{- range .Values.script -}}
|
|
89
|
+
{{- if eq (typeOf .) "string" -}}
|
|
90
|
+
{{ $n := include "root.globalMap" (list $ .) }}
|
|
91
|
+
{{- $script := print (get $dict "key") $n ";" -}}
|
|
92
|
+
{{- $_ := set $dict "key" $script -}}
|
|
93
|
+
{{- end -}}
|
|
94
|
+
{{- end -}}
|
|
95
|
+
{{- end -}}
|
|
96
|
+
|
|
97
|
+
{{- if .Values.afterScript }}
|
|
98
|
+
{{- range .Values.afterScript -}}
|
|
99
|
+
{{- if eq (typeOf .) "string" -}}
|
|
100
|
+
{{ $n := include "root.globalMap" (list $ .) }}
|
|
101
|
+
{{- $script := print (get $dict "key") $n ";" -}}
|
|
102
|
+
{{- $_ := set $dict "key" $script -}}
|
|
103
|
+
{{- end -}}
|
|
104
|
+
{{- end -}}
|
|
105
|
+
{{- end -}}
|
|
106
|
+
|
|
107
|
+
{{- $script := get $dict "key" -}}
|
|
108
|
+
{{- if not (empty $script) }}
|
|
109
|
+
args: ["-c", {{ print $script | quote }}]
|
|
110
|
+
{{- end }}
|
|
111
|
+
{{- else }}
|
|
112
|
+
{{- if .Values.command }}
|
|
113
|
+
command:
|
|
114
|
+
{{- toYaml .Values.command | nindent 10 }}
|
|
115
|
+
{{- end }}
|
|
116
|
+
{{- end }}
|
|
117
|
+
{{- if .Values.service }}
|
|
118
|
+
{{- if .Values.service.ports }}
|
|
119
|
+
ports:
|
|
120
|
+
{{- range $.Values.service.ports }}
|
|
121
|
+
- containerPort: {{ .targetPort | default .port }}
|
|
122
|
+
{{- end }}
|
|
123
|
+
{{- end }}
|
|
124
|
+
{{- if .Values.service.port }}
|
|
125
|
+
ports:
|
|
126
|
+
- containerPort: {{ .Values.service.targetPort | default .Values.service.port }}
|
|
127
|
+
{{- end }}
|
|
128
|
+
{{- end }}
|
|
129
|
+
{{- if .Values.readinessProbe }}
|
|
130
|
+
readinessProbe:
|
|
131
|
+
{{- toYaml .Values.readinessProbe | nindent 10 }}
|
|
132
|
+
{{- end }}
|
|
133
|
+
{{- if .Values.livenessProbe }}
|
|
134
|
+
livenessProbe:
|
|
135
|
+
{{- toYaml .Values.livenessProbe | nindent 10 }}
|
|
136
|
+
{{- end }}
|
|
137
|
+
env:
|
|
138
|
+
{{- range $key, $value := .Values.secret }}
|
|
139
|
+
- name: {{ $key }}
|
|
140
|
+
valueFrom:
|
|
141
|
+
secretKeyRef:
|
|
142
|
+
{{- if eq (typeOf $value) "string" }}
|
|
143
|
+
name: {{ include (print $.Chart.Name ".fullname") $ }}
|
|
144
|
+
key: {{ $key }}
|
|
145
|
+
{{- else }}
|
|
146
|
+
name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
|
|
147
|
+
{{- if .key }}
|
|
148
|
+
key: {{ .key }}
|
|
149
|
+
{{- else }}
|
|
150
|
+
key: {{ $key }}
|
|
151
|
+
{{- end }}
|
|
152
|
+
{{- end }}
|
|
153
|
+
{{- end }}
|
|
154
|
+
{{- range $key, $value := .Values.config }}
|
|
155
|
+
- name: {{ $key }}
|
|
156
|
+
valueFrom:
|
|
157
|
+
configMapKeyRef:
|
|
158
|
+
{{- if eq (typeOf $value) "string" }}
|
|
159
|
+
name: {{ include (print $.Chart.Name ".fullname") $ }}
|
|
160
|
+
key: {{ $key }}
|
|
161
|
+
{{- else }}
|
|
162
|
+
name: {{ include "root.globalMap" (list $ .fromKeyRef) | trimSuffix "-" }}
|
|
163
|
+
{{- if .key }}
|
|
164
|
+
key: {{ .key }}
|
|
165
|
+
{{- else }}
|
|
166
|
+
key: {{ $key }}
|
|
167
|
+
{{- end }}
|
|
168
|
+
{{- end }}
|
|
169
|
+
{{- end }}
|
|
170
|
+
{{- range $key, $value := .Values.env }}
|
|
171
|
+
- name: {{ $key }}
|
|
172
|
+
value: {{ include "root.globalMap" (list $ $value) | quote }}
|
|
173
|
+
{{- end }}
|
|
174
|
+
{{- if $.Values.volumeMounts }}
|
|
175
|
+
volumeMounts:
|
|
176
|
+
{{- range $.Values.volumeMounts }}
|
|
177
|
+
- name: {{ .name }}
|
|
178
|
+
{{- if .mountPath }}
|
|
179
|
+
mountPath: {{ include "root.globalMap" (list $ .mountPath) | quote }}
|
|
180
|
+
{{- end }}
|
|
181
|
+
{{- if .subPath }}
|
|
182
|
+
subPath: {{ include "root.globalMap" (list $ .subPath) | quote }}
|
|
183
|
+
{{- end }}
|
|
184
|
+
{{- if .readOnly }}
|
|
185
|
+
readOnly: {{ .readOnly }}
|
|
186
|
+
{{- end }}
|
|
187
|
+
{{- end }}
|
|
188
|
+
{{- end }}
|
|
189
|
+
{{- if $.Values.volumes }}
|
|
190
|
+
volumes:
|
|
191
|
+
{{- range $.Values.volumes }}
|
|
192
|
+
{{- if .secret }}
|
|
193
|
+
- name: {{ .name }}
|
|
194
|
+
{{- with .secret }}
|
|
195
|
+
secret:
|
|
196
|
+
{{- if .defaultMode }}
|
|
197
|
+
defaultMode: {{ .defaultMode }}
|
|
198
|
+
{{- end }}
|
|
199
|
+
{{- if .items }}
|
|
200
|
+
items:
|
|
201
|
+
{{- range .items }}
|
|
202
|
+
- key: {{ .key }}
|
|
203
|
+
path: {{ .path }}
|
|
204
|
+
{{- end }}
|
|
205
|
+
{{- end }}
|
|
206
|
+
{{- if .secretName }}
|
|
207
|
+
secretName: {{ .secretName }}
|
|
208
|
+
{{- else }}
|
|
209
|
+
secretName: {{ include (print $.Chart.Name ".fullname") $ }}
|
|
210
|
+
{{- end }}
|
|
211
|
+
{{- end }}
|
|
212
|
+
{{- else if .configMap }}
|
|
213
|
+
- name: {{ .name }}
|
|
214
|
+
{{- with .configMap }}
|
|
215
|
+
configMap:
|
|
216
|
+
name: {{ include "root.globalMap" (list $ .name) | default (include (print $.Chart.Name ".fullname") $) | quote }}
|
|
217
|
+
{{- end }}
|
|
218
|
+
{{- else if .hostPath }}
|
|
219
|
+
- name: {{ .name }}
|
|
220
|
+
{{- with .hostPath }}
|
|
221
|
+
hostPath:
|
|
222
|
+
path: {{ include "root.globalMap" (list $ .path) }}
|
|
223
|
+
type: {{ .type }}
|
|
224
|
+
{{- end }}
|
|
225
|
+
{{- else if .nfs }}
|
|
226
|
+
- name: {{ .name }}
|
|
227
|
+
{{- with .nfs }}
|
|
228
|
+
nfs:
|
|
229
|
+
server: {{ include "root.globalMap" (list $ .server) }}
|
|
230
|
+
path: {{ include "root.globalMap" (list $ .path) }}
|
|
231
|
+
{{- end }}
|
|
232
|
+
{{- else if .persistentVolumeClaim }}
|
|
233
|
+
- name: {{ .name }}
|
|
234
|
+
{{- with .persistentVolumeClaim }}
|
|
235
|
+
persistentVolumeClaim:
|
|
236
|
+
claimName: {{ include (print $.Chart.Name ".fullname") $ }}-{{ .claimName }}
|
|
237
|
+
{{- end }}
|
|
238
|
+
{{- else }}
|
|
239
|
+
{{- toYaml . | nindent 8 }}
|
|
240
|
+
{{- end }}
|
|
241
|
+
{{- end }}
|
|
242
|
+
{{- end }}
|
|
243
|
+
{{- end }}
|
|
244
|
+
{{- end }}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: ConfigMap
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ print $.Release.Name "-root" }}
|
|
5
|
+
data:
|
|
6
|
+
{{- with .Values.global.root }}
|
|
7
|
+
{{- range $key, $value := . }}
|
|
8
|
+
{{- $key | nindent 2 }}{{- ": " -}}{{ include "root.global" (list $ $key) | quote }}
|
|
9
|
+
{{- end }}
|
|
10
|
+
{{- end }}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{{- if .Values.global.secret.pull }}
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: Secret
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ print $.Release.Name "-pull" }}
|
|
6
|
+
type: kubernetes.io/dockerconfigjson
|
|
7
|
+
data:
|
|
8
|
+
{{- with .Values.global.secret.pull }}
|
|
9
|
+
.dockerconfigjson: {{ .auth | b64enc | printf "{\"auths\":{\"%s\":{\"auth\":\"%s\"}}}" .host | b64enc }}
|
|
10
|
+
{{- end }}
|
|
11
|
+
{{- end }}
|