diff --git a/helm/postgres-init/templates/inji-verify-env-configmap.yaml b/helm/postgres-init/templates/inji-verify-env-configmap.yaml new file mode 100644 index 0000000..d38a438 --- /dev/null +++ b/helm/postgres-init/templates/inji-verify-env-configmap.yaml @@ -0,0 +1,23 @@ +{{- if .Values.databases.inji_verify.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: db-inji-verify-init-env-config + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: postgres + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +data: + MOSIP_DB_NAME: inji_verify + DB_SERVERIP: {{ .Values.databases.inji_verify.host | quote }} + DB_PORT: {{ .Values.databases.inji_verify.port | quote }} + SU_USER: {{ .Values.databases.inji_verify.su.user | quote }} + DML_FLAG: {{ .Values.databases.inji_verify.dml | quote }} + GIT_REPO_URL: {{ .Values.databases.inji_verify.repoUrl | quote }} + GIT_BRANCH: {{ .Values.databases.inji_verify.branch | quote }} +{{- end }} diff --git a/helm/postgres-init/templates/inji-verify-job.yaml b/helm/postgres-init/templates/inji-verify-job.yaml new file mode 100644 index 0000000..15f738f --- /dev/null +++ b/helm/postgres-init/templates/inji-verify-job.yaml @@ -0,0 +1,47 @@ +{{- if .Values.databases.inji_verify.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: db-inji-verify-init-job + labels: + {{- include "postgres-init.labels" . | nindent 4 }} +spec: + backoffLimit: 0 + template: + metadata: + labels: + {{- include "postgres-init.selectorLabels" . | nindent 8 }} + app.kubernetes.io/name: db-inji-verify-init-job + sidecar.istio.io/inject: "false" + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "postgres-init.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.jobSecurityContext | nindent 8 }} + restartPolicy: Never # This is one time job + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: SU_USER_PWD + valueFrom: + secretKeyRef: + name: {{ .Values.databases.inji_verify.su.secret.name }} + key: {{ .Values.databases.inji_verify.su.secret.key }} + + - name: DBUSER_PWD + valueFrom: + secretKeyRef: + name: db-common-secrets + key: db-dbuser-password + + envFrom: + - configMapRef: + name: db-inji-verify-init-env-config +{{- end }} diff --git a/helm/postgres-init/values.yaml b/helm/postgres-init/values.yaml index 38b8f65..e847b18 100644 --- a/helm/postgres-init/values.yaml +++ b/helm/postgres-init/values.yaml @@ -334,3 +334,16 @@ databases: dml: 1 repoUrl: https://github.com/mosip/inji-certify.git branch: develop + + inji_verify: + enabled: false + host: "postgres-postgresql" + port: 5432 + su: + user: postgres + secret: + name: postgres-postgresql + key: postgres-password + dml: 1 + repoUrl: https://github.com/mosip/inji-verify.git + branch: develop