From d4421e84890bff84f9004d2a7593ce4ff6fc21c8 Mon Sep 17 00:00:00 2001 From: Alis Akers Date: Wed, 18 Sep 2024 11:38:52 -0700 Subject: [PATCH] setup an initContainer for flyway to run migrations for tefca --- charts/ecr-viewer/Chart.yaml | 2 +- .../templates/tests/test-connection.yaml | 2 +- charts/fhir-converter/Chart.yaml | 2 +- charts/ingestion/Chart.yaml | 2 +- charts/message-parser/Chart.yaml | 2 +- charts/orchestration/Chart.yaml | 2 +- charts/tefca-viewer/Chart.yaml | 2 +- charts/tefca-viewer/templates/deployment.yaml | 8 ++++++-- charts/tefca-viewer/templates/serviceAccount.yaml | 6 ++++++ .../templates/tests/test-connection.yaml | 14 +++++++++++++- charts/tefca-viewer/values.yaml | 8 ++++++-- charts/trigger-code-reference/Chart.yaml | 2 +- charts/validation/Chart.yaml | 2 +- 13 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 charts/tefca-viewer/templates/serviceAccount.yaml diff --git a/charts/ecr-viewer/Chart.yaml b/charts/ecr-viewer/Chart.yaml index eb2f6cd..95419e7 100644 --- a/charts/ecr-viewer/Chart.yaml +++ b/charts/ecr-viewer/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: ecr-viewer description: A Helm chart for the DIBBs eCR Viewer type: application -version: 0.2.0 +version: 0.2.1 diff --git a/charts/ecr-viewer/templates/tests/test-connection.yaml b/charts/ecr-viewer/templates/tests/test-connection.yaml index 76f8337..ae7ace8 100644 --- a/charts/ecr-viewer/templates/tests/test-connection.yaml +++ b/charts/ecr-viewer/templates/tests/test-connection.yaml @@ -12,6 +12,6 @@ spec: image: busybox command: ['wget'] args: [ - "{{.Release.Name}}-{{.Values.serviceName}}:{{ .Values.service.port}}" + "{{.Release.Name}}-{{.Values.serviceName}}:{{ .Values.service.port}}/ecr-viewer" ] restartPolicy: Never diff --git a/charts/fhir-converter/Chart.yaml b/charts/fhir-converter/Chart.yaml index ab23573..a1633f7 100644 --- a/charts/fhir-converter/Chart.yaml +++ b/charts/fhir-converter/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: fhir-converter description: A Helm chart for Kubernetes type: application -version: 0.2.0 +version: 0.3.0 diff --git a/charts/ingestion/Chart.yaml b/charts/ingestion/Chart.yaml index 7f41298..454f21d 100644 --- a/charts/ingestion/Chart.yaml +++ b/charts/ingestion/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: ingestion description: A Helm chart for the DIBBs ingestion service type: application -version: 0.2.0 +version: 0.2.1 diff --git a/charts/message-parser/Chart.yaml b/charts/message-parser/Chart.yaml index ee90038..9271b66 100644 --- a/charts/message-parser/Chart.yaml +++ b/charts/message-parser/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: message-parser description: A Helm chart for Kubernetes type: application -version: 0.2.0 +version: 0.2.1 diff --git a/charts/orchestration/Chart.yaml b/charts/orchestration/Chart.yaml index aab42d1..2268a98 100644 --- a/charts/orchestration/Chart.yaml +++ b/charts/orchestration/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: orchestration description: A Helm chart for Kubernetes type: application -version: 0.2.0 +version: 0.2.1 diff --git a/charts/tefca-viewer/Chart.yaml b/charts/tefca-viewer/Chart.yaml index b83bc6c..c369c9d 100644 --- a/charts/tefca-viewer/Chart.yaml +++ b/charts/tefca-viewer/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: tefca-viewer description: A Helm chart for Kubernetes type: application -version: 0.3.0 +version: 0.4.8 diff --git a/charts/tefca-viewer/templates/deployment.yaml b/charts/tefca-viewer/templates/deployment.yaml index 3fd1e9f..a4f5d83 100644 --- a/charts/tefca-viewer/templates/deployment.yaml +++ b/charts/tefca-viewer/templates/deployment.yaml @@ -18,7 +18,7 @@ spec: imagePullSecrets: containers: - name: {{.Chart.Name}} - image: ghcr.io/cdcgov/phdi/{{.Values.name}}:{{ .Values.image.tag }} + image: ghcr.io/cdcgov/phdi/{{.Values.name}}:{{.Values.image.tag}} imagePullPolicy: {{.Values.image.pullPolicy}} ports: - name: {{.Chart.Name | trunc 15}} @@ -29,4 +29,8 @@ spec: - name: cred_manager value: {{.Values.credManager}} - name: database_url - value: {{.Values.databaseUrl}} + value: {{.Values.databaseConnectionString}} + # initContainers: + - name: flyway + image: ghcr.io/cdcgov/phdi/{{.Values.name}}-flyway:{{.Values.image.tag}} + args: ["-schemas=public", "-connectRetries=10", "-url={{.Values.jdbcDatabaseConnectionString}}", "migrate"] diff --git a/charts/tefca-viewer/templates/serviceAccount.yaml b/charts/tefca-viewer/templates/serviceAccount.yaml new file mode 100644 index 0000000..11ba63a --- /dev/null +++ b/charts/tefca-viewer/templates/serviceAccount.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{.Values.name}} + annotations: + eks.amazonaws.com/role-arn: {{.Values.tefcaViewerDBRoleArn}} \ No newline at end of file diff --git a/charts/tefca-viewer/templates/tests/test-connection.yaml b/charts/tefca-viewer/templates/tests/test-connection.yaml index f96b202..e272cad 100644 --- a/charts/tefca-viewer/templates/tests/test-connection.yaml +++ b/charts/tefca-viewer/templates/tests/test-connection.yaml @@ -12,6 +12,18 @@ spec: image: busybox command: ["wget"] args: [ - "{{.Release.Name}}-{{.Values.serviceName}}:{{ .Values.service.port}}/tefca-viewer" + "{{.Release.Name}}-{{.Values.serviceName}}:{{.Values.service.port}}/tefca-viewer" ] + # initContainers: + # - name: db + # image: postgres:alpine + # ports: + # - containerPort: 5432 + # env: + # - name: POSTGRES_DB + # value: tefca_db + # - name: POSTGRES_USER + # value: postgres + # - name: POSTGRES_PASSWORD + # value: pw restartPolicy: Never diff --git a/charts/tefca-viewer/values.yaml b/charts/tefca-viewer/values.yaml index f434ddf..fe69c43 100644 --- a/charts/tefca-viewer/values.yaml +++ b/charts/tefca-viewer/values.yaml @@ -4,7 +4,7 @@ replicaCount: 1 image: repository: ghcr.io/cdcgov/phdi/tefca-viewer pullPolicy: Always - tag: dev + tag: v1.6.6 service: port: 3000 @@ -12,4 +12,8 @@ service: name: tefca-viewer appName: tefca-viewer-app serviceName: tefca-viewer-service -databaseUrl: database-url +tefcaViewerDBRoleArn: placeholder-arn +jdbcDatabaseConnectionString: jdbc-placeholder-string +#jdbc:postgresql://db:5432/tefca_db?user=postgres&password=pw&ssl=true +databaseConnectionString: jdbc-placeholder-string +#postgres://postgres:pw@db:5432/tefca_db diff --git a/charts/trigger-code-reference/Chart.yaml b/charts/trigger-code-reference/Chart.yaml index acd483f..3607c78 100644 --- a/charts/trigger-code-reference/Chart.yaml +++ b/charts/trigger-code-reference/Chart.yaml @@ -3,4 +3,4 @@ apiVersion: v2 name: trigger-code-reference description: A Helm chart for Kubernetes type: application -version: 0.2.0 +version: 0.2.1 diff --git a/charts/validation/Chart.yaml b/charts/validation/Chart.yaml index 55866be..8f0418e 100644 --- a/charts/validation/Chart.yaml +++ b/charts/validation/Chart.yaml @@ -3,5 +3,5 @@ apiVersion: v2 name: validation description: A Helm chart for the DIBBs Validation Service type: application -version: 0.2.0 +version: 0.2.1 icon: https://commons.wikimedia.org/wiki/File:US_CDC_logo.svg