Skip to content

Commit

Permalink
chore: adding pg for voucher (#6557)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhart1o1 authored May 23, 2024
1 parent 4139132 commit 6c9618d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
6 changes: 6 additions & 0 deletions charts/voucher/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions charts/voucher/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions charts/voucher/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ ingress:
service:
port: 3000
type: ClusterIP
postgresql:
enabled: true
auth:
enablePostgresUser: false
username: voucher
password: voucher
database: voucher
resources: {}
8 changes: 7 additions & 1 deletion ci/testflight/voucher/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ resource "kubernetes_secret" "smoketest" {
}
}

resource "random_password" "postgresql" {
length = 20
special = false
}

resource "kubernetes_secret" "voucher" {
metadata {
name = "voucher"
Expand All @@ -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"
}
}

Expand Down
6 changes: 6 additions & 0 deletions ci/testflight/voucher/testflight-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
11 changes: 7 additions & 4 deletions dev/addons/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load('ext://helm_resource', 'helm_resource')
load('ext://namespace', 'namespace_create')
load('ext://secret', 'secret_from_dict')
load('../common/Tiltfile', 'copy_secret')
load('../common/Tiltfile', 'helm_release')

name_prefix = 'galoy-dev'
galoy_namespace = '{}-galoy'.format(name_prefix)
Expand Down Expand Up @@ -139,15 +140,17 @@ 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'
}
))

k8s_yaml(helm(
helm_release(
'../../charts/voucher',
name = 'voucher',
namespace = addons_namespace,
values = ['./voucher-values.yml']
))
values = ['./voucher-values.yml'],
dependency_build=True,
add_repos=True
)

k8s_resource(workload='voucher', labels='addons')
5 changes: 5 additions & 0 deletions dev/addons/voucher-values.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
secrets:
create: false

postgresql:
primary:
persistence:
enabled: false

0 comments on commit 6c9618d

Please sign in to comment.