From 8cf67bbbf9d74141f5ed8b1d33edb3ed3baa5598 Mon Sep 17 00:00:00 2001 From: "Ruben L. Mendoza" Date: Fri, 31 May 2024 08:16:56 -0500 Subject: [PATCH] Tasking Manager DB charts (#331) * Add TM database * Add values * Fix tm postgres uri * Add a section in cronjob to backup TM - DB * Add values to create ClusterIssuer * Update if statement * Update name for tm - db * Update tm-db endpoint * Update pv claim for tmdb * Update tm api name * Update tm api name - deployment * Update postgres URI for tm - api * Update tiler db for backup * Fix endpoint for tm db --- osm-seed/templates/db/db-backup-job.yaml | 2 +- .../templates/tasking-manager-api/tm-deployment.yaml | 6 +++--- .../templates/tasking-manager-api/tm-ingress.yaml | 2 +- .../templates/tasking-manager-api/tm-service.yaml | 2 +- osm-seed/templates/tasking-manager-db/tm-db-pd.yaml | 6 +++--- .../templates/tasking-manager-db/tm-db-service.yaml | 4 ++-- .../tasking-manager-db/tm-db-statefulset.yaml | 12 ++++++------ 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/osm-seed/templates/db/db-backup-job.yaml b/osm-seed/templates/db/db-backup-job.yaml index 45ef441d..bd1e1aec 100644 --- a/osm-seed/templates/db/db-backup-job.yaml +++ b/osm-seed/templates/db/db-backup-job.yaml @@ -59,7 +59,7 @@ spec: {{ if eq $job.name "tm-db" }} # DB credentials - name: POSTGRES_HOST - value: {{ $.Release.Name }}-tm-db + value: {{ $.Release.Name }}-tasking-manager-db - name: POSTGRES_DB value: {{ $.Values.tmDb.env.POSTGRES_DB }} - name: POSTGRES_PASSWORD diff --git a/osm-seed/templates/tasking-manager-api/tm-deployment.yaml b/osm-seed/templates/tasking-manager-api/tm-deployment.yaml index 1682e0d0..f6f6306e 100644 --- a/osm-seed/templates/tasking-manager-api/tm-deployment.yaml +++ b/osm-seed/templates/tasking-manager-api/tm-deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ template "osm-seed.fullname" . }}-tasking-manager-api + name: {{ .Release.Name }}-tasking-manager-api labels: app: {{ template "osm-seed.name" . }} component: tasking-manager-api-deployment @@ -46,7 +46,7 @@ spec: {{- end }} env: - name: POSTGRES_HOST - value: {{ .Release.Name }}-tm-db + value: {{ .Release.Name }}-tasking-manager-db - name: POSTGRES_DB value: {{ .Values.tmDb.env.POSTGRES_DB }} - name: POSTGRES_PASSWORD @@ -56,7 +56,7 @@ spec: - name: POSTGRES_PORT value: "5432" - name: TM_DB - value: {{ printf "postgresql://%s:%s@%s-tm-db/%s" .Values.tmDb.env.POSTGRES_USER .Values.tmDb.env.POSTGRES_PASSWORD .Release.Name .Values.tmDb.env.POSTGRES_DB }} + value: {{ printf "postgresql://%s:%s@%s-tasking-manager-db/%s" .Values.tmDb.env.POSTGRES_USER .Values.tmDb.env.POSTGRES_PASSWORD .Release.Name .Values.tmDb.env.POSTGRES_DB }} - name: TM_ORG_NAME value: {{ .Values.tmApi.env.TM_ORG_NAME }} - name: TM_ORG_CODE diff --git a/osm-seed/templates/tasking-manager-api/tm-ingress.yaml b/osm-seed/templates/tasking-manager-api/tm-ingress.yaml index f51739c0..d8dda37c 100644 --- a/osm-seed/templates/tasking-manager-api/tm-ingress.yaml +++ b/osm-seed/templates/tasking-manager-api/tm-ingress.yaml @@ -25,7 +25,7 @@ spec: pathType: Prefix backend: service: - name: {{ template "osm-seed.fullname" . }}-tasking-manager-api + name: {{ .Release.Name }}-tasking-manager-api port: number: 80 {{- end }} \ No newline at end of file diff --git a/osm-seed/templates/tasking-manager-api/tm-service.yaml b/osm-seed/templates/tasking-manager-api/tm-service.yaml index 3f6afa18..33d13b23 100644 --- a/osm-seed/templates/tasking-manager-api/tm-service.yaml +++ b/osm-seed/templates/tasking-manager-api/tm-service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "osm-seed.fullname" . }}-tasking-manager-api + name: {{ .Release.Name }}-tasking-manager-api labels: app: {{ template "osm-seed.name" . }} component: tasking-manager-api-service diff --git a/osm-seed/templates/tasking-manager-db/tm-db-pd.yaml b/osm-seed/templates/tasking-manager-db/tm-db-pd.yaml index 0e05952d..01bcf870 100644 --- a/osm-seed/templates/tasking-manager-db/tm-db-pd.yaml +++ b/osm-seed/templates/tasking-manager-db/tm-db-pd.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: {{ .Release.Name }}-tm-db-pv + name: {{ .Release.Name }}-tasking-manager-db-pv labels: app: {{ template "osm-seed.name" . }} component: tm-db-pd @@ -48,7 +48,7 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-tm-db-pv-claim + name: {{ .Release.Name }}-tasking-manager-db-pv-claim labels: app: {{ template "osm-seed.name" . }} component: db-pd @@ -62,7 +62,7 @@ spec: ############## Other providers ############## storageClassName: "" {{- end }} - volumeName: {{ .Release.Name }}-tm-db-pv + volumeName: {{ .Release.Name }}-tasking-manager-db-pv accessModes: - ReadWriteOnce resources: diff --git a/osm-seed/templates/tasking-manager-db/tm-db-service.yaml b/osm-seed/templates/tasking-manager-db/tm-db-service.yaml index d7855eba..d9717687 100644 --- a/osm-seed/templates/tasking-manager-db/tm-db-service.yaml +++ b/osm-seed/templates/tasking-manager-db/tm-db-service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-tm-db + name: {{ .Release.Name }}-tasking-manager-db labels: app: {{ template "osm-seed.name" . }} component: tm-db-service @@ -15,5 +15,5 @@ spec: selector: app: {{ template "osm-seed.name" . }} release: {{ .Release.Name }} - run: {{ .Release.Name }}-tm-db + run: {{ .Release.Name }}-tasking-manager-db {{- end }} \ No newline at end of file diff --git a/osm-seed/templates/tasking-manager-db/tm-db-statefulset.yaml b/osm-seed/templates/tasking-manager-db/tm-db-statefulset.yaml index 99b00271..04011193 100644 --- a/osm-seed/templates/tasking-manager-db/tm-db-statefulset.yaml +++ b/osm-seed/templates/tasking-manager-db/tm-db-statefulset.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ .Release.Name }}-tm-db + name: {{ .Release.Name }}-tasking-manager-db labels: app: {{ template "osm-seed.name" . }} component: db-tm-statefulset @@ -14,14 +14,14 @@ spec: matchLabels: app: {{ template "osm-seed.name" . }} release: {{ .Release.Name }} - run: {{ .Release.Name }}-tm-db - serviceName: {{ .Release.Name }}-tm-db + run: {{ .Release.Name }}-tasking-manager-db + serviceName: {{ .Release.Name }}-tasking-manager-db template: metadata: labels: app: {{ template "osm-seed.name" . }} release: {{ .Release.Name }} - run: {{ .Release.Name }}-tm-db + run: {{ .Release.Name }}-tasking-manager-db spec: containers: - name: {{ .Chart.Name }}-tm-db @@ -32,7 +32,7 @@ spec: protocol: TCP env: - name: POSTGRES_HOST - value: {{ .Release.Name }}-tm-db + value: {{ .Release.Name }}-tasking-manager-db - name: POSTGRES_DB value: {{ .Values.tmDb.env.POSTGRES_DB }} - name: POSTGRES_PASSWORD @@ -90,7 +90,7 @@ spec: - name: postgres-storage {{- if .Values.tmDb.persistenceDisk.enabled }} persistentVolumeClaim: - claimName: {{ .Release.Name }}-tm-db-pv-claim + claimName: {{ .Release.Name }}-tasking-manager-db-pv-claim {{- else }} emptyDir: {} {{- end }}