From 33e32a2a2d37428050fa42a961a2b9c0f543594c Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Fri, 13 Oct 2023 11:59:23 -0600 Subject: [PATCH] Chart/improvements rebased (#13) Signed-off-by: Alfredo Gutierrez --- .github/workflows/charts.yml | 2 +- .../templates/configmap.yaml | 10 ++-- .../templates/deployment-index.yaml | 13 ++--- .../templates/deployment-query.yaml | 13 ++--- .../templates/secret.yaml | 1 - charts/hedera-the-graph-node/values.yaml | 48 +++++-------------- 6 files changed, 25 insertions(+), 62 deletions(-) diff --git a/.github/workflows/charts.yml b/.github/workflows/charts.yml index 79eaf56..a269865 100644 --- a/.github/workflows/charts.yml +++ b/.github/workflows/charts.yml @@ -32,7 +32,7 @@ jobs: run: curl --retry 3 -fsL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash - name: Create k3d cluster - run: k3d cluster create relay --agents 1 --timeout 5m --registry-create registry:0.0.0.0:5001 --image rancher/k3s:v1.25.9-k3s1 + run: k3d cluster create hedera-graph-node --agents 1 --timeout 5m --registry-create registry:0.0.0.0:5001 --image rancher/k3s:v1.25.9-k3s1 timeout-minutes: 3 - name: Set up Docker Qemu diff --git a/charts/hedera-the-graph-node/templates/configmap.yaml b/charts/hedera-the-graph-node/templates/configmap.yaml index f5b5ab2..ca0a55a 100644 --- a/charts/hedera-the-graph-node/templates/configmap.yaml +++ b/charts/hedera-the-graph-node/templates/configmap.yaml @@ -4,13 +4,15 @@ metadata: name: {{ include "hedera-the-graph-node.fullname" . }}-config labels: {{- include "hedera-the-graph-node.labels" . | nindent 4 }} -data: - {{- if not (hasKey .Values.config.ipfs "fromConfigMap") }} +data: + {{- if not (hasKey .Values.config.ipfs "fromConfigMap") }} IPFS: {{ .Values.config.ipfs.value | quote }} {{- end }} - {{- if not (hasKey .Values.postgres.host "fromConfigMap") }} + {{- if not (hasKey .Values.postgres.host "fromConfigMap") }} PG_HOST: {{ .Values.postgres.host.value | quote }} {{- end }} - {{- if not (hasKey .Values.postgres.db "fromConfigMap") }} + {{- if not (hasKey .Values.postgres.db "fromConfigMap") }} PG_DB: {{ .Values.postgres.db.value | quote }} {{- end }} + # add hedera env vars from values.yaml + {{- .Values.config.hederaEnvVars | toYaml | trim | nindent 2 -}} diff --git a/charts/hedera-the-graph-node/templates/deployment-index.yaml b/charts/hedera-the-graph-node/templates/deployment-index.yaml index 2b8f73a..c13f18e 100644 --- a/charts/hedera-the-graph-node/templates/deployment-index.yaml +++ b/charts/hedera-the-graph-node/templates/deployment-index.yaml @@ -115,16 +115,9 @@ spec: name: {{ include "hedera-the-graph-node.fullname" . }}-config key: PG_DB {{- end }} - # Env Config for Index-Node - {{- range .Values.hederaEnvVars.indexNode }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} - # Extra Env vars - {{- range .Values.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + envFrom: + - configMapRef: + name: {{ include "hedera-the-graph-node.fullname" . }}-config ports: - name: metrics containerPort: 8040 diff --git a/charts/hedera-the-graph-node/templates/deployment-query.yaml b/charts/hedera-the-graph-node/templates/deployment-query.yaml index 3a6538e..474c188 100644 --- a/charts/hedera-the-graph-node/templates/deployment-query.yaml +++ b/charts/hedera-the-graph-node/templates/deployment-query.yaml @@ -113,16 +113,9 @@ spec: name: {{ include "hedera-the-graph-node.fullname" . }}-config key: PG_DB {{- end }} - # Env Config for Query-Node - {{- range .Values.hederaEnvVars.queryNode }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} - # Extra Env vars values - {{- range .Values.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + envFrom: + - configMapRef: + name: {{ include "hedera-the-graph-node.fullname" . }}-config ports: - name: metrics containerPort: 8040 diff --git a/charts/hedera-the-graph-node/templates/secret.yaml b/charts/hedera-the-graph-node/templates/secret.yaml index 3834831..f6bbc5f 100644 --- a/charts/hedera-the-graph-node/templates/secret.yaml +++ b/charts/hedera-the-graph-node/templates/secret.yaml @@ -12,4 +12,3 @@ data: {{- if not (hasKey .Values.postgres.user "fromSecret") }} PG_USERNAME: {{ .Values.postgres.user.value | b64enc | quote }} {{- end }} - diff --git a/charts/hedera-the-graph-node/values.yaml b/charts/hedera-the-graph-node/values.yaml index 6383e9d..c7c149b 100644 --- a/charts/hedera-the-graph-node/values.yaml +++ b/charts/hedera-the-graph-node/values.yaml @@ -19,45 +19,21 @@ config: # fromConfigMap: # name: # key: - -extraEnvVars: [] - # - name: key1 - # value: value1 - # - name: key2 - # value: value2 + hederaEnvVars: + ETHEREUM_BLOCK_BATCH_SIZE: "1" + ETHEREUM_POLLING_INTERVAL: "1000" + ETHEREUM_REORG_THRESHOLD: "0" + GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS: "100" + GRAPH_ETHEREUM_CLEANUP_BLOCKS: "true" + GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER: "0" + GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE: "1000" + GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE: "50" + GRAPH_KILL_IF_UNRESPONSIVE: "false" + GRAPH_LOG: "debug" + extraEnvVars: {} fullnameOverride: '' -hederaEnvVars: - queryNode: - - name: "GRAPH_KILL_IF_UNRESPONSIVE" - value: "false" - - name: "GRAPH_LOG" - value: "debug" - - name: "GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER" - value: "0" - indexNode: - - name: "GRAPH_KILL_IF_UNRESPONSIVE" - value: "false" - - name: "GRAPH_LOG" - value: "debug" - - name: "GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE" - value: "1000" - - name: "GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER" - value: "0" - - name: "ETHEREUM_REORG_THRESHOLD" - value: "0" - - name: "ETHEREUM_POLLING_INTERVAL" - value: "1000" - - name: "ETHEREUM_BLOCK_BATCH_SIZE" - value: "1" - - name: "GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE" - value: "50" - - name: "GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS" - value: "100" - - name: "GRAPH_ETHEREUM_CLEANUP_BLOCKS" - value: "true" - image: pullPolicy: IfNotPresent repository: graphprotocol/graph-node