|
| 1 | +{{ if .Values.aggregation.enabled }} |
| 2 | +--- |
| 3 | +apiVersion: apps/v1 |
| 4 | +kind: Deployment |
| 5 | +metadata: |
| 6 | + name: {{ include "cf-ledger-sync.fullname" . }}{{ print "-aggregation" }} |
| 7 | + labels: |
| 8 | + {{- include "cf-ledger-sync-aggregation.labels" . | nindent 4 }} |
| 9 | +spec: |
| 10 | + replicas: {{ .Values.replicaCount }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "cf-ledger-sync-aggregation.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + labels: |
| 17 | + {{- include "cf-ledger-sync-aggregation.selectorLabels" . | nindent 8 }} |
| 18 | + spec: |
| 19 | + {{- with .Values.imagePullSecrets }} |
| 20 | + imagePullSecrets: |
| 21 | + {{- toYaml . | nindent 8 }} |
| 22 | + {{- end }} |
| 23 | + containers: |
| 24 | + - name: "{{ .Chart.Name }}-aggregation" |
| 25 | + image: "{{ .Values.aggregation.image.repository }}:{{ .Values.aggregation.image.tag | default .Chart.AppVersion }}" |
| 26 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 27 | + env: |
| 28 | + - name: NETWORK |
| 29 | + value: {{ .Values.network | default "preprod" }} |
| 30 | + - name: DB_DIALECT |
| 31 | + value: {{ .Values.aggregation.dbDialect | default "org.hibernate.dialect.PostgreSQLDialect" }} |
| 32 | + |
| 33 | + {{ if .Values.useLocalCardanoNode }} |
| 34 | + - name: STORE_CARDANO_HOST |
| 35 | + value: "cardano-node" |
| 36 | + - name: STORE_CARDANO_PORT |
| 37 | + value: "3001" |
| 38 | + {{ if eq .Values.localCardanoNode.network "preview" }} |
| 39 | + - name: STORE_CARDANO_PROTOCOL_MAGIC |
| 40 | + value: "2" |
| 41 | + {{- else if eq .Values.localCardanoNode.network "preprod" }} |
| 42 | + - name: STORE_CARDANO_PROTOCOL_MAGIC |
| 43 | + value: "1" |
| 44 | + {{- else if eq .Values.localCardanoNode.network "mainnet" }} |
| 45 | + - name: STORE_CARDANO_PROTOCOL_MAGIC |
| 46 | + value: "764824073" |
| 47 | + {{- else if eq .Values.localCardanoNode.network "sanchonet" }} |
| 48 | + - name: STORE_CARDANO_PROTOCOL_MAGIC |
| 49 | + value: "4" |
| 50 | + {{- end }} |
| 51 | + {{- else }} |
| 52 | + - name: STORE_CARDANO_HOST |
| 53 | + value: {{ .Values.storeCardanoHost | default "preprod-node.world.dev.cardano.org" }} |
| 54 | + - name: STORE_CARDANO_PORT |
| 55 | + value: {{ .Values.storeCardanoPort | default "30000" | quote }} |
| 56 | + - name: STORE_CARDANO_PROTOCOL_MAGIC |
| 57 | + value: {{ .Values.storeCardanoProtocolMagic | default "1" | quote }} |
| 58 | + {{- end }} |
| 59 | + |
| 60 | + ## Postgres |
| 61 | + - name: POSTGRES_HOST |
| 62 | + valueFrom: |
| 63 | + secretKeyRef: |
| 64 | + name: postgres-secrets |
| 65 | + key: POSTGRES_HOST |
| 66 | + - name: POSTGRES_PORT |
| 67 | + valueFrom: |
| 68 | + secretKeyRef: |
| 69 | + name: postgres-secrets |
| 70 | + key: POSTGRES_PORT |
| 71 | + - name: POSTGRES_DB |
| 72 | + valueFrom: |
| 73 | + secretKeyRef: |
| 74 | + name: postgres-secrets |
| 75 | + key: POSTGRES_DB |
| 76 | + - name: SPRING_DATASOURCE_URL |
| 77 | + value: jdbc:postgresql://$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DB)?currentSchema={{ .Values.aggregation.dbSchema | default "public" }} |
| 78 | + - name: SPRING_DATASOURCE_USERNAME |
| 79 | + valueFrom: |
| 80 | + secretKeyRef: |
| 81 | + name: postgres-secrets |
| 82 | + key: POSTGRES_USER |
| 83 | + - name: SPRING_DATASOURCE_PASSWORD |
| 84 | + valueFrom: |
| 85 | + secretKeyRef: |
| 86 | + name: postgres-secrets |
| 87 | + key: POSTGRES_PASSWORD |
| 88 | + |
| 89 | + - name: STORE_ACCOUNT_HISTORYCLEANUPENABLED |
| 90 | + value: {{ .Values.aggregation.store.account.history_cleanup_enabled | quote }} |
| 91 | + resources: |
| 92 | + {{- toYaml .Values.aggregation.resources | nindent 12 }} |
| 93 | +{{{ end }}} |
0 commit comments