diff --git a/infrastructure/charts/node/templates/deployment.yaml b/infrastructure/charts/node/templates/deployment.yaml index bee9c4f48..486506f84 100644 --- a/infrastructure/charts/node/templates/deployment.yaml +++ b/infrastructure/charts/node/templates/deployment.yaml @@ -47,6 +47,26 @@ spec: value: {{ .Values.server.refereshAndSubmitPeriod | quote }} - name: NODE_CARDANO_CONFIRMATION_BLOCKS value: {{ .Values.server.confirmationBlocks | quote }} + {{- if and (eq "cardano" .Values.server.ledger) (not (empty .Values.vdr.externalResources.wallet.host)) }} + - name: NODE_CARDANO_WALLET_API_HOST + value: "{{ .Values.vdr.externalResources.wallet.host }}" + - name: NODE_CARDANO_WALLET_API_PORT + value: "{{ .Values.vdr.externalResources.wallet.port }}" + - name: NODE_CARDANO_WALLET_ID + valueFrom: + secretKeyRef: + name: "{{ .Values.secrets.cardanoWallet }}" + key: wallet_id + optional: false + - name: NODE_CARDANO_WALLET_PASSPHRASE + valueFrom: + secretKeyRef: + name: "{{ .Values.secrets.cardanoWallet }}" + key: passphrase + optional: false + - name: NODE_CARDANO_PAYMENT_ADDRESS + value: "{{ .Values.vdr.externalResources.wallet.payment_address }}" + {{- else if eq "cardano" .Values.server.ledger }} - name: NODE_CARDANO_WALLET_API_HOST value: "{{ .Values.vdr.cardanoNode }}.{{ .Values.vdr.cardanoNamespace }}" - name: NODE_CARDANO_WALLET_ID @@ -69,7 +89,25 @@ spec: name: "{{ .Values.vdr.cardanoNode }}-{{ .Values.vdr.cardanoWallet }}" key: address optional: false - {{- if eq "cardano" .Values.server.ledger }} + {{- end }} + {{- if and (eq "cardano" .Values.server.ledger) (not (empty .Values.vdr.externalResources.db_sync.host)) }} + - name: NODE_CARDANO_DB_SYNC_USERNAME + valueFrom: + secretKeyRef: + name: "{{ .Values.secrets.cardanoDbSync }}" + key: username + optional: false + - name: NODE_CARDANO_DB_SYNC_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Values.secrets.cardanoDbSync }}" + key: password + optional: false + - name: NODE_CARDANO_DB_SYNC_DATABASE + value: "{{ .Values.vdr.externalResources.db_sync.database }}" + - name: NODE_CARDANO_DB_SYNC_HOST + value: "{{ .Values.vdr.externalResources.db_sync.host }}" + {{- else if eq "cardano" .Values.server.ledger }} - name: NODE_CARDANO_DB_SYNC_USERNAME valueFrom: secretKeyRef: diff --git a/infrastructure/charts/node/templates/externalsecret.yaml b/infrastructure/charts/node/templates/externalsecret.yaml index dad4534bd..6548fe972 100644 --- a/infrastructure/charts/node/templates/externalsecret.yaml +++ b/infrastructure/charts/node/templates/externalsecret.yaml @@ -18,9 +18,9 @@ spec: dataFrom: - extract: key: {{ .Values.secrets.dockerRegistryToken }} - --- -# Requires wallet to be created (atm it's done through terraform module) +{{- if and (empty .Values.vdr.externalResources.wallet.host) + (empty .Values.vdr.externalResources.db_sync.host) }} apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: @@ -36,3 +36,41 @@ spec: dataFrom: - extract: key: {{ .Values.vdr.cardanoWallet }} +--- +{{- end }} +{{- if not (empty .Values.vdr.externalResources.wallet.host) }} +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: "{{ .Values.secrets.cardanoWallet }}" + namespace: {{ .Release.Namespace }} + labels: + {{ template "labels.common" . }} +spec: + refreshInterval: "0" + secretStoreRef: + name: {{ .Values.secrets.secretStore }} + kind: ClusterSecretStore + dataFrom: + - extract: + key: "{{ .Values.secrets.cardanoWallet }}" +--- +{{- end }} +{{- if not (empty .Values.vdr.externalResources.db_sync.host) }} +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: "{{ .Values.secrets.cardanoDbSync }}" + namespace: {{ .Release.Namespace }} + labels: + {{ template "labels.common" . }} +spec: + refreshInterval: "0" + secretStoreRef: + name: {{ .Values.secrets.secretStore }} + kind: ClusterSecretStore + dataFrom: + - extract: + key: "{{ .Values.secrets.cardanoDbSync }}" +--- +{{- end }} diff --git a/infrastructure/charts/node/values.yaml b/infrastructure/charts/node/values.yaml index 0e7578754..ec1428a76 100644 --- a/infrastructure/charts/node/values.yaml +++ b/infrastructure/charts/node/values.yaml @@ -11,6 +11,8 @@ ingress: secrets: secretStore: chart-base-secretstore dockerRegistryToken: chart-base-docker-registry-token + # cardanoWallet: must contain wallet_id and passphrase + # cardanoDbSync: must contain username and password server: ledger: "in-memory" @@ -39,6 +41,14 @@ database: numberOfInstances: 2 vdr: + externalResources: + wallet: + host: + payment_address: + port: "443" + db_sync: + host: + database: cardanoNode: atala-cardano-dev-preprod cardanoNamespace: cardano-stack cardanoWallet: dev-k8s-cardano-wallet