From 3a6339898089d8bdc3a371e8fcd0cdd2df81160a Mon Sep 17 00:00:00 2001 From: Abhi Date: Fri, 21 Feb 2025 18:05:53 +0530 Subject: [PATCH 1/2] [MOSIP-38912] Created scripts for injiverify db Signed-off-by: Abhi --- .../templates/inji-verify-env-configmap.yaml | 23 +++++++++ .../templates/inji-verify-job.yaml | 47 +++++++++++++++++++ helm/postgres-init/values.yaml | 13 +++++ 3 files changed, 83 insertions(+) create mode 100644 helm/postgres-init/templates/inji-verify-env-configmap.yaml create mode 100644 helm/postgres-init/templates/inji-verify-job.yaml 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..07daa6b --- /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-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..a6e52bd --- /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-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-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-verify-init-env-config +{{- end }} diff --git a/helm/postgres-init/values.yaml b/helm/postgres-init/values.yaml index 38b8f65..11cab5c 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-certify.git + branch: develop From de6f953579551dd7e60948a45628af73157e2279 Mon Sep 17 00:00:00 2001 From: Abhi Date: Mon, 24 Feb 2025 15:28:19 +0530 Subject: [PATCH 2/2] [MOSIP-38912] Created scripts for injiverify db Signed-off-by: Abhi --- helm/postgres-init/templates/inji-verify-env-configmap.yaml | 2 +- helm/postgres-init/templates/inji-verify-job.yaml | 6 +++--- helm/postgres-init/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helm/postgres-init/templates/inji-verify-env-configmap.yaml b/helm/postgres-init/templates/inji-verify-env-configmap.yaml index 07daa6b..d38a438 100644 --- a/helm/postgres-init/templates/inji-verify-env-configmap.yaml +++ b/helm/postgres-init/templates/inji-verify-env-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: db-verify-init-env-config + name: db-inji-verify-init-env-config namespace: {{ .Release.Namespace }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: postgres diff --git a/helm/postgres-init/templates/inji-verify-job.yaml b/helm/postgres-init/templates/inji-verify-job.yaml index a6e52bd..15f738f 100644 --- a/helm/postgres-init/templates/inji-verify-job.yaml +++ b/helm/postgres-init/templates/inji-verify-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: db-verify-init-job + name: db-inji-verify-init-job labels: {{- include "postgres-init.labels" . | nindent 4 }} spec: @@ -11,7 +11,7 @@ spec: metadata: labels: {{- include "postgres-init.selectorLabels" . | nindent 8 }} - app.kubernetes.io/name: db-verify-init-job + app.kubernetes.io/name: db-inji-verify-init-job sidecar.istio.io/inject: "false" spec: {{- with .Values.imagePullSecrets }} @@ -43,5 +43,5 @@ spec: envFrom: - configMapRef: - name: db-verify-init-env-config + name: db-inji-verify-init-env-config {{- end }} diff --git a/helm/postgres-init/values.yaml b/helm/postgres-init/values.yaml index 11cab5c..e847b18 100644 --- a/helm/postgres-init/values.yaml +++ b/helm/postgres-init/values.yaml @@ -345,5 +345,5 @@ databases: name: postgres-postgresql key: postgres-password dml: 1 - repoUrl: https://github.com/mosip/inji-certify.git + repoUrl: https://github.com/mosip/inji-verify.git branch: develop