Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow external cardano-wallet (tls) and cardano-db-sync #856

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion infrastructure/charts/node/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
42 changes: 40 additions & 2 deletions infrastructure/charts/node/templates/externalsecret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
10 changes: 10 additions & 0 deletions infrastructure/charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Loading