From 4e17b76d904bfd2581e7bebd725cc106cd31024d Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 1 Jun 2023 15:09:10 +0200 Subject: [PATCH] feat: add bria config to galoy chart --- charts/galoy/templates/_helpers.tpl | 12 ++++++++++++ charts/galoy/templates/api-deployment.yaml | 1 + charts/galoy/templates/galoy-cronjob.yaml | 1 + charts/galoy/templates/galoy-secrets.yaml | 14 ++++++++++++++ charts/galoy/templates/trigger-deployment.yaml | 1 + charts/galoy/values.yaml | 14 ++++++++++++++ ci/testflight/galoy/main.tf | 11 +++++++++++ ci/testflight/galoy/testflight-values.yml | 3 +++ dev/galoy/main.tf | 11 +++++++++++ 9 files changed, 68 insertions(+) diff --git a/charts/galoy/templates/_helpers.tpl b/charts/galoy/templates/_helpers.tpl index 401db0c597..880d95d3dc 100644 --- a/charts/galoy/templates/_helpers.tpl +++ b/charts/galoy/templates/_helpers.tpl @@ -195,6 +195,18 @@ Return Galoy environment variables for LND 2 configuration {{ end }} {{- end -}} +{{- define "galoy.bria.env" -}} +- name: BRIA_HOST + value: {{ .Values.galoy.bria.host | quote }} +- name: BRIA_PORT + value: {{ .Values.galoy.bria.port | quote }} +- name: BRIA_PROFILE_API_KEY + valueFrom: + secretKeyRef: + name: {{ .Values.galoy.bria.apiKeyExistingSecret.name | quote }} + key: {{ .Values.galoy.bria.apiKeyExistingSecret.key | quote }} +{{- end -}} + {{/* Return Galoy environment variables for Redis configuration */}} diff --git a/charts/galoy/templates/api-deployment.yaml b/charts/galoy/templates/api-deployment.yaml index 2be023d777..40c32a8389 100644 --- a/charts/galoy/templates/api-deployment.yaml +++ b/charts/galoy/templates/api-deployment.yaml @@ -88,6 +88,7 @@ spec: {{ include "galoy.bitcoind.env" . | indent 8 }} {{ include "galoy.lnd1.env" . | indent 8 }} {{ include "galoy.lnd2.env" . | indent 8 }} +{{ include "galoy.bria.env" . | indent 8 }} {{/* API Specifics */}} {{ include "galoy.twilio.env" . | indent 8 }} diff --git a/charts/galoy/templates/galoy-cronjob.yaml b/charts/galoy/templates/galoy-cronjob.yaml index 1a3594ca68..83aeb72b61 100644 --- a/charts/galoy/templates/galoy-cronjob.yaml +++ b/charts/galoy/templates/galoy-cronjob.yaml @@ -68,6 +68,7 @@ spec: {{ include "galoy.bitcoind.env" . | indent 12 }} {{ include "galoy.lnd1.env" . | indent 12 }} {{ include "galoy.lnd2.env" . | indent 12 }} +{{ include "galoy.bria.env" . | indent 12 }} {{ include "galoy.jwt.env" . | indent 12 }} diff --git a/charts/galoy/templates/galoy-secrets.yaml b/charts/galoy/templates/galoy-secrets.yaml index daa5cfced3..3bea91c584 100644 --- a/charts/galoy/templates/galoy-secrets.yaml +++ b/charts/galoy/templates/galoy-secrets.yaml @@ -33,6 +33,20 @@ data: --- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.galoy.bria.apiKeyExistingSecret.name }} + labels: + app: {{ template "galoy.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" +type: Opaque +data: + {{ .Values.bria.apiKeyExistingSecret.key }}: {{ .Values.secrets.briaApiKey | toString | b64enc }} + +--- + {{ if .Values.postgresql.enabled }} apiVersion: v1 diff --git a/charts/galoy/templates/trigger-deployment.yaml b/charts/galoy/templates/trigger-deployment.yaml index 19e462dcf8..38785d7350 100644 --- a/charts/galoy/templates/trigger-deployment.yaml +++ b/charts/galoy/templates/trigger-deployment.yaml @@ -81,6 +81,7 @@ spec: {{ include "galoy.bitcoind.env" . | indent 8 }} {{ include "galoy.lnd1.env" . | indent 8 }} {{ include "galoy.lnd2.env" . | indent 8 }} +{{ include "galoy.bria.env" . | indent 8 }} {{/* API Specifics */}} {{ include "galoy.twilio.env" . | indent 8 }} diff --git a/charts/galoy/values.yaml b/charts/galoy/values.yaml index 4faca44dc6..54b97073bc 100644 --- a/charts/galoy/values.yaml +++ b/charts/galoy/values.yaml @@ -32,6 +32,10 @@ galoy: cronConfig: rebalanceEnabled: true swapEnabled: true + bria: + hotWalletName: dev + queueNames: + fast: fast ## Docker Images for running Galoy Banking Codebase ## images: @@ -395,6 +399,14 @@ galoy: name: bitcoind-rpcpassword ## Secret Key key: password + + bria: + host: bria.default.svc.cluster.local + port: 2742 + apiKeyExistingSecret: + name: bria-api-key + key: api-key + ## Dealer Service Connection details ## dealer: @@ -553,6 +565,8 @@ secrets: lnd2LoopMacaroon: lnd2LoopTls: lnd2PubKey: + ## Secrets for Bria + briaApiKey: ## Secret for Galoy app kratosMasterUserPassword: kratosCallbackApiKey: diff --git a/ci/testflight/galoy/main.tf b/ci/testflight/galoy/main.tf index eabdd6a15c..21fdb4cd2b 100644 --- a/ci/testflight/galoy/main.tf +++ b/ci/testflight/galoy/main.tf @@ -41,6 +41,17 @@ resource "kubernetes_secret" "network" { data = data.kubernetes_secret.network.data } +resource "kubernetes_secret" "bria" { + metadata { + name = "bria-api-key" + namespace = kubernetes_namespace.testflight.metadata[0].name + } + + data = { + key = "" + } +} + resource "kubernetes_secret" "gcs_sa_key" { metadata { name = "gcs-sa-key" diff --git a/ci/testflight/galoy/testflight-values.yml b/ci/testflight/galoy/testflight-values.yml index 3d9ddfd1c5..5d2221abc3 100644 --- a/ci/testflight/galoy/testflight-values.yml +++ b/ci/testflight/galoy/testflight-values.yml @@ -23,6 +23,9 @@ galoy: lnd2: dns: lnd2.galoy-staging-bitcoin.svc.cluster.local + bria: + host: bria.galoy-staging-bitcoin.svc.cluster.local + dealer: host: dealer-price.galoy-staging-addons.svc.cluster.local diff --git a/dev/galoy/main.tf b/dev/galoy/main.tf index 6393170ef2..07703fb043 100644 --- a/dev/galoy/main.tf +++ b/dev/galoy/main.tf @@ -53,6 +53,17 @@ resource "kubernetes_secret" "jwt_secret" { } } +resource "kubernetes_secret" "bria" { + metadata { + name = "bria-api-key" + namespace = kubernetes_namespace.galoy.metadata[0].name + } + + data = { + key = "" + } +} + resource "kubernetes_secret" "gcs_sa_key" { metadata { name = "gcs-sa-key"