Skip to content

Commit

Permalink
Improving docs, adding env variables as a values.yaml collection to s…
Browse files Browse the repository at this point in the history
…implify the process of env tweaking and optimization

Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Oct 11, 2023
1 parent 47ef40b commit e2d0c9d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 31 deletions.
32 changes: 17 additions & 15 deletions charts/hedera-the-graph-node/templates/deployment-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.host "fromConfigMap" }}
name: {{ .Values.postgres.host.fromConfigMap.name }}
key: {{ .Values.postgres.host.fromConfigMap.key }}
key: {{ .Values.postgres.host.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: PG_HOST
Expand All @@ -61,20 +61,12 @@ spec:
value: {{ .Values.blockIngestorNodeId | quote }}
- name: node_role
value: {{ .Values.role | quote }}
- 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: "1"
- name: ipfs
valueFrom:
configMapKeyRef:
configMapKeyRef:
{{- if hasKey .Values.config.ipfs "fromConfigMap" }}
name: {{ .Values.config.ipfs.fromConfigMap.name }}
key: {{ .Values.config.ipfs.fromConfigMap.key }}
key: {{ .Values.config.ipfs.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: IPFS
Expand All @@ -88,7 +80,7 @@ spec:
secretKeyRef:
{{- if hasKey .Values.postgres.user "fromSecret" }}
name: {{ .Values.postgres.user.fromSecret.name }}
key: {{ .Values.postgres.user.fromSecret.key }}
key: {{ .Values.postgres.user.fromSecret.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}
key: PG_USERNAME
Expand All @@ -98,7 +90,7 @@ spec:
secretKeyRef:
{{- if hasKey .Values.postgres.password "fromSecret" }}
name: {{ .Values.postgres.password.fromSecret.name }}
key: {{ .Values.postgres.password.fromSecret.key }}
key: {{ .Values.postgres.password.fromSecret.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}
key: PG_PASSWORD
Expand All @@ -108,7 +100,7 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.host "fromConfigMap" }}
name: {{ .Values.postgres.host.fromConfigMap.name }}
key: {{ .Values.postgres.host.fromConfigMap.key }}
key: {{ .Values.postgres.host.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: PG_HOST
Expand All @@ -118,11 +110,21 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.db "fromConfigMap" }}
name: {{ .Values.postgres.db.fromConfigMap.name }}
key: {{ .Values.postgres.db.fromConfigMap.key }}
key: {{ .Values.postgres.db.fromConfigMap.key | quote }}
{{- else }}
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 }}
ports:
- name: metrics
containerPort: 8040
Expand Down
30 changes: 16 additions & 14 deletions charts/hedera-the-graph-node/templates/deployment-query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.host "fromConfigMap" }}
name: {{ .Values.postgres.host.fromConfigMap.name }}
key: {{ .Values.postgres.host.fromConfigMap.key }}
key: {{ .Values.postgres.host.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: PG_HOST
Expand All @@ -59,20 +59,12 @@ spec:
fieldPath: metadata.name
- name: node_role
value: {{ .Values.role | quote }}
- 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: "1"
- name: ipfs
valueFrom:
configMapKeyRef:
{{- if hasKey .Values.config.ipfs "fromConfigMap" }}
name: {{ .Values.config.ipfs.fromConfigMap.name }}
key: {{ .Values.config.ipfs.fromConfigMap.key }}
key: {{ .Values.config.ipfs.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: IPFS
Expand All @@ -86,7 +78,7 @@ spec:
secretKeyRef:
{{- if hasKey .Values.postgres.user "fromSecret" }}
name: {{ .Values.postgres.user.fromSecret.name }}
key: {{ .Values.postgres.user.fromSecret.key }}
key: {{ .Values.postgres.user.fromSecret.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}
key: PG_USERNAME
Expand All @@ -96,7 +88,7 @@ spec:
secretKeyRef:
{{- if hasKey .Values.postgres.password "fromSecret" }}
name: {{ .Values.postgres.password.fromSecret.name }}
key: {{ .Values.postgres.password.fromSecret.key }}
key: {{ .Values.postgres.password.fromSecret.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}
key: PG_PASSWORD
Expand All @@ -106,7 +98,7 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.host "fromConfigMap" }}
name: {{ .Values.postgres.host.fromConfigMap.name }}
key: {{ .Values.postgres.host.fromConfigMap.key }}
key: {{ .Values.postgres.host.fromConfigMap.key | quote }}
{{- else }}
name: {{ include "hedera-the-graph-node.fullname" . }}-config
key: PG_HOST
Expand All @@ -116,11 +108,21 @@ spec:
configMapKeyRef:
{{- if hasKey .Values.postgres.db "fromConfigMap" }}
name: {{ .Values.postgres.db.fromConfigMap.name }}
key: {{ .Values.postgres.db.fromConfigMap.key }}
key: {{ .Values.postgres.db.fromConfigMap.key | quote }}
{{- else }}
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 }}
ports:
- name: metrics
containerPort: 8040
Expand Down
36 changes: 36 additions & 0 deletions charts/hedera-the-graph-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,44 @@ config:
# name:
# key:

extraEnvVars: []
# - name: key1
# value: value1
# - name: key2
# value: value2

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
Expand Down
16 changes: 14 additions & 2 deletions charts/hedera-the-graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,25 @@ Is possible to do queries using the index node, so for small testing environment
To install the chart with the release name `my-release`:

```bash
$ helm install my-release hedera-the-graph
helm install my-release hedera-the-graph
```

By default it will use testnet, to use mainnet set the following value file:

```bash
helm install sl charts/hedera-the-graph -f charts/hedera-the-graph/values-overrides/values-mainnet.yaml
```

same for previewnet:

```bash
helm install sl charts/hedera-the-graph -f charts/hedera-the-graph/values-overrides/values-previewnet.yaml
```

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```bash
$ helm uninstall my-release
helm uninstall my-release
```

0 comments on commit e2d0c9d

Please sign in to comment.