From 5575f46c4bf85309f25c537237192f4063b05a5f Mon Sep 17 00:00:00 2001 From: siddharth Date: Tue, 21 May 2024 21:18:25 +0530 Subject: [PATCH] chore: adding pg for voucher --- charts/voucher/Chart.lock | 6 ++++++ charts/voucher/Chart.yaml | 5 +++++ charts/voucher/values.yaml | 7 +++++++ ci/testflight/voucher/main.tf | 8 +++++++- ci/testflight/voucher/testflight-values.yml | 6 ++++++ dev/addons/Tiltfile | 2 +- 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 charts/voucher/Chart.lock diff --git a/charts/voucher/Chart.lock b/charts/voucher/Chart.lock new file mode 100644 index 0000000000..ee0e9caf91 --- /dev/null +++ b/charts/voucher/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 11.9.6 +digest: sha256:e9f252a13edc2a9ecde83ea222591e1767aa08f97fb7c9071d69c49bff78a481 +generated: "2024-05-22T17:49:55.172043+05:30" diff --git a/charts/voucher/Chart.yaml b/charts/voucher/Chart.yaml index f8ead73fd1..bb3a80b9ff 100644 --- a/charts/voucher/Chart.yaml +++ b/charts/voucher/Chart.yaml @@ -18,3 +18,8 @@ version: 0.1.0-dev # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. appVersion: 0.1.0 +dependencies: + - name: postgresql + version: 11.9.6 + repository: https://charts.bitnami.com/bitnami + condition: postgresql.enabled diff --git a/charts/voucher/values.yaml b/charts/voucher/values.yaml index bc2e7802d9..22227fffec 100644 --- a/charts/voucher/values.yaml +++ b/charts/voucher/values.yaml @@ -20,4 +20,11 @@ ingress: service: port: 3000 type: ClusterIP +postgresql: + enabled: true + auth: + enablePostgresUser: false + username: voucher + password: voucher + database: voucher resources: {} diff --git a/ci/testflight/voucher/main.tf b/ci/testflight/voucher/main.tf index a0be9ce59f..4f59e4b8db 100644 --- a/ci/testflight/voucher/main.tf +++ b/ci/testflight/voucher/main.tf @@ -26,6 +26,11 @@ resource "kubernetes_secret" "smoketest" { } } +resource "random_password" "postgresql" { + length = 20 + special = false +} + resource "kubernetes_secret" "voucher" { metadata { name = "voucher" @@ -36,7 +41,8 @@ resource "kubernetes_secret" "voucher" { "next-auth-secret" : "dummy123" "client-secret" : "dummy" "escrow-api-key" : "dummy" - "pg-con" : "dummy" + pg-user-pw : random_password.postgresql.result + pg-con : "postgres://voucher:${random_password.postgresql.result}@voucher-postgresql:5432/voucher" } } diff --git a/ci/testflight/voucher/testflight-values.yml b/ci/testflight/voucher/testflight-values.yml index 5b6dc30cf9..3060af00e8 100644 --- a/ci/testflight/voucher/testflight-values.yml +++ b/ci/testflight/voucher/testflight-values.yml @@ -6,3 +6,9 @@ voucher: coreUrl: "http://galoy-oathkeeper-proxy.galoy-staging-galoy.svc.cluster.local:4455/graphql" voucherUrl: "http://localhost:3000" nextAuthUrl: "http://voucher:3000" + +postgresql: + auth: + existingSecret: voucher + secretKeys: + userPasswordKey: "pg-user-pw" diff --git a/dev/addons/Tiltfile b/dev/addons/Tiltfile index b207ca9dd3..122f0a385f 100644 --- a/dev/addons/Tiltfile +++ b/dev/addons/Tiltfile @@ -139,7 +139,7 @@ k8s_yaml(secret_from_dict( "next-auth-secret" : "dummy", "client-secret" : "dummy", "escrow-api-key" : "dummy", - "pg-con" : "dummy" + "pg-con" : 'postgres://voucher:voucher@voucher-postgresql:5432/voucher' } ))