-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add
graph-node
to charts. (#1489)
Added a `graph-node` helm chart to the charts. --------- Co-authored-by: Jordan Oroshiba <[email protected]>
- Loading branch information
1 parent
790af57
commit 77c70bf
Showing
13 changed files
with
497 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v2 | ||
name: graph-node | ||
description: A Helm chart for Graph Node deployment | ||
version: 0.1.0 | ||
appVersion: "0.0.1" | ||
|
||
maintainers: | ||
- name: wafflesvonmaple | ||
url: astria.org | ||
- name: quasystaty1 | ||
url: astria.org | ||
- name: joroshiba | ||
url: astria.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- define "graphnode.name" -}} | ||
{{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{- define "graphnode.fullname" -}} | ||
{{ include "graphnode.name" . }}-graph-node | ||
{{- end }} | ||
|
||
{{/* | ||
Namepsace to deploy elements into. | ||
*/}} | ||
{{- define "graphnode.namespace" -}} | ||
{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: graph-node-config | ||
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }} | ||
data: | ||
postgres_host: postgres | ||
postgres_user: {{ .Values.postgres.user }} | ||
postgres_pass: {{ .Values.postgres.password }} | ||
postgres_db: {{ .Values.postgres.database }} | ||
ipfs: ipfs:{{ .Values.ipfs.ports.api }} | ||
ethereum: {{ .Values.environment.ethereumNetwork }}:{{ .Values.environment.ethereumRPC }} | ||
GRAPH_LOG: info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: graph-node | ||
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }} | ||
spec: | ||
replicas: {{ .Values.graphNode.replicas }} | ||
selector: | ||
matchLabels: | ||
app: graph-node | ||
template: | ||
metadata: | ||
labels: | ||
app: graph-node | ||
spec: | ||
containers: | ||
- name: graph-node | ||
envFrom: | ||
- configMapRef: | ||
name: graph-node-config | ||
image: {{ .Values.graphNode.image }}:{{ .Values.graphNode.tag }} | ||
ports: | ||
- containerPort: {{ .Values.graphNode.ports.http }} | ||
- containerPort: {{ .Values.graphNode.ports.jsonRpc }} | ||
- containerPort: {{ .Values.graphNode.ports.indexNode }} | ||
- containerPort: {{ .Values.graphNode.ports.metrics }} | ||
- containerPort: {{ .Values.graphNode.ports.subgraphMetrics }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: graph-node | ||
annotations: | ||
{{- with .Values.ingress.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.ingress.className }} | ||
ingressClassName: {{ .Values.ingress.className }} | ||
{{- end }} | ||
rules: | ||
- host: {{ .Values.ingress.host | quote }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: graph-node | ||
port: | ||
number: {{ .Values.graphNode.ports.http }} | ||
{{- if .Values.ingress.tls }} | ||
tls: | ||
{{- range .Values.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{- if and .Values.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: graph-node-metrics | ||
labels: | ||
app: graph-node | ||
{{- with .Values.serviceMonitor.additionalLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
jobLabel: graph-node-metrics | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
selector: | ||
matchLabels: | ||
app: graph-node | ||
endpoints: | ||
- port: metrics | ||
path: /metrics | ||
{{- with .Values.serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .Values.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
- port: subgraph-metrics | ||
path: /metrics | ||
{{- with .Values.serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .Values.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: graph-node | ||
namespace: {{ include "graphnode.namespace" . }} | ||
spec: | ||
selector: | ||
app: graph-node | ||
ports: | ||
- name: http | ||
port: {{ .Values.graphNode.ports.http }} | ||
targetPort: {{ .Values.graphNode.ports.http }} | ||
- name: json-rpc | ||
port: {{ .Values.graphNode.ports.jsonRpc }} | ||
targetPort: {{ .Values.graphNode.ports.jsonRpc }} | ||
- name: index-node | ||
port: {{ .Values.graphNode.ports.indexNode }} | ||
targetPort: {{ .Values.graphNode.ports.indexNode }} | ||
- name: metrics | ||
port: {{ .Values.graphNode.ports.metrics }} | ||
targetPort: {{ .Values.graphNode.ports.metrics }} | ||
- name: subgraph-metrics | ||
port: {{ .Values.graphNode.ports.subgraphMetrics }} | ||
targetPort: {{ .Values.graphNode.ports.subgraphMetrics }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ipfs | ||
namespace: {{ include "graphnode.namespace" . }} | ||
spec: | ||
selector: | ||
app: ipfs | ||
ports: | ||
- name: api | ||
port: {{ .Values.ipfs.ports.api }} | ||
targetPort: {{ .Values.ipfs.ports.api }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres | ||
namespace: {{ include "graphnode.namespace" . }} | ||
spec: | ||
selector: | ||
app: postgres | ||
ports: | ||
- name: postgres | ||
port: {{ .Values.postgres.ports.postgres }} | ||
targetPort: {{ .Values.postgres.ports.postgres }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: ipfs | ||
namespace: {{ include "graphnode.namespace" . }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: ipfs | ||
template: | ||
metadata: | ||
labels: | ||
app: ipfs | ||
spec: | ||
containers: | ||
- name: ipfs | ||
image: {{ .Values.ipfs.image }}:{{ .Values.ipfs.tag }} | ||
ports: | ||
- containerPort: {{ .Values.ipfs.ports.api }} | ||
volumeMounts: | ||
- name: ipfs-storage | ||
mountPath: /data/ipfs | ||
volumes: | ||
- name: ipfs-storage | ||
{{- if .Values.ipfs.storage.enabled }} | ||
persistentVolumeClaim: | ||
claimName: ipfs-pvc | ||
{{- else }} | ||
emptyDir: {} | ||
{{- end }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: postgres | ||
namespace: {{ include "graphnode.namespace" . }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: postgres | ||
template: | ||
metadata: | ||
labels: | ||
app: postgres | ||
spec: | ||
securityContext: | ||
fsGroup: 999 | ||
containers: | ||
- name: postgres | ||
image: {{ .Values.postgres.image }}:{{ .Values.postgres.tag }} | ||
ports: | ||
- containerPort: {{ .Values.postgres.ports.postgres }} | ||
env: | ||
- name: POSTGRES_USER | ||
value: {{ .Values.postgres.user }} | ||
- name: POSTGRES_PASSWORD | ||
value: {{ .Values.postgres.password }} | ||
- name: POSTGRES_DB | ||
value: {{ .Values.postgres.database }} | ||
- name: PGDATA | ||
value: /var/lib/postgresql/data/pgdata | ||
- name: POSTGRES_INITDB_ARGS | ||
value: "--lc-collate=C --lc-ctype=C --encoding=UTF8" | ||
securityContext: | ||
runAsUser: 999 | ||
runAsGroup: 999 | ||
volumeMounts: | ||
- name: postgres-storage | ||
mountPath: /var/lib/postgresql/data | ||
readinessProbe: | ||
exec: | ||
command: ["pg_isready", "-U", "{{ .Values.postgres.user }}"] | ||
initialDelaySeconds: 10 | ||
periodSeconds: 5 | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 256Mi | ||
volumes: | ||
- name: postgres-storage | ||
{{- if .Values.postgres.storage.enabled }} | ||
persistentVolumeClaim: | ||
claimName: postgres-pvc | ||
{{- else }} | ||
emptyDir: {} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{/* We only want to create a storage class if we are local. */}} | ||
{{/* For production, you need to create a StorageClass on GKE. */}} | ||
{{- if or (and .Values.ipfs.storage.enabled .Values.ipfs.storage.local) (and .Values.postgres.storage.enabled .Values.postgres.storage.local) }} | ||
{{- range $key, $value := .Values.storage.entities }} | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: {{ include "graphnode.name" $ }}-{{ $value.persistentVolumeName }}-graph-node-local | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: Retain | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.