From 69595b6d21d71ae5d81b330d2c2e46209d753526 Mon Sep 17 00:00:00 2001 From: Nick Kou Date: Fri, 12 Aug 2022 16:42:47 +1200 Subject: [PATCH 1/2] add graphprotocol --- graphprotocol-node/.helmignore | 23 ++ graphprotocol-node/Chart.yaml | 15 + graphprotocol-node/templates/_config.tpl | 42 +++ graphprotocol-node/templates/_helpers.tpl | 52 ++++ graphprotocol-node/templates/deployment.yaml | 130 +++++++++ graphprotocol-node/templates/ingress.yaml | 71 +++++ graphprotocol-node/templates/secret.yaml | 11 + graphprotocol-node/templates/service.yaml | 37 +++ .../templates/servicemonitor.yaml | 14 + graphprotocol-node/values.schema.json | 261 ++++++++++++++++++ graphprotocol-node/values.yaml | 110 ++++++++ 11 files changed, 766 insertions(+) create mode 100644 graphprotocol-node/.helmignore create mode 100644 graphprotocol-node/Chart.yaml create mode 100644 graphprotocol-node/templates/_config.tpl create mode 100644 graphprotocol-node/templates/_helpers.tpl create mode 100644 graphprotocol-node/templates/deployment.yaml create mode 100644 graphprotocol-node/templates/ingress.yaml create mode 100644 graphprotocol-node/templates/secret.yaml create mode 100644 graphprotocol-node/templates/service.yaml create mode 100644 graphprotocol-node/templates/servicemonitor.yaml create mode 100644 graphprotocol-node/values.schema.json create mode 100644 graphprotocol-node/values.yaml diff --git a/graphprotocol-node/.helmignore b/graphprotocol-node/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/graphprotocol-node/.helmignore @@ -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/ diff --git a/graphprotocol-node/Chart.yaml b/graphprotocol-node/Chart.yaml new file mode 100644 index 0000000..9bb99ea --- /dev/null +++ b/graphprotocol-node/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +name: graphprotocol-node +description: A Helm chart for Graph Protocol Nodes +type: application +version: 0.1.0 +keywords: + - graphprotocol + - ethereum +home: https://thegraph.com/ +sources: + - https://github.com/graphprotocol/graph-node +maintainers: + - email: dm3ch@dm3ch.net + name: dm3ch (original author) +appVersion: v0.24.1 diff --git a/graphprotocol-node/templates/_config.tpl b/graphprotocol-node/templates/_config.tpl new file mode 100644 index 0000000..8bd7346 --- /dev/null +++ b/graphprotocol-node/templates/_config.tpl @@ -0,0 +1,42 @@ +# Config.toml based on https://github.com/graphprotocol/graph-node/blob/5613dca92213810b3cca57979f5facc2d670e34a/docs/config.md#configuring-multiple-databases +{{- define "graphprotocol-node.config" -}} +{{- $pgHost := required "postgres.host wasn't specified" .Values.postgres.host }} +{{- $pgDB := required "postgres.db wasn't specified" .Values.postgres.db }} +{{- $pgUser := required "postgres.user wasn't specified" .Values.postgres.user }} +[store] +[store.primary] + connection = "postgresql://{{ $pgUser }}:$PG_PASS@{{ $pgHost }}/{{ $pgDB }}" + weight = 1 + pool_size = 10 + +{{- if .Values.postgres.replicaHost }} +[store.primary.replicas.replica] + connection = "postgresql://{{ $pgUser }}:$PG_PASS@{{ .Values.postgres.replicaHost }}/{{ $pgDB }}" + weight = 1 +{{- end }} + +[chains] + ingestor = "{{ .Values.blockIngestorNodeId }}" + {{- range $name, $conf := .Values.config.chains }} + [chains.{{ $name }}] + shard = "primary" + {{- range $conf.providers }} + [[chains.{{ $name }}.provider]] + label = {{ .label | quote }} + url = {{ .url | quote }} + features = {{ toJson .features }} + transport = {{ default "rpc" .transport | quote }} + {{- with .headers }} + [headers] + {{- range $k, $v := . }} + {{ $k }} = {{ $v | quote }} + {{- end }} + {{- end}} + {{- end }} + {{- end }} + +[deployment] +[[deployment.rule]] + shard = "primary" + indexers = [ "{{ .Values.blockIngestorNodeId }}" ] +{{- end }} diff --git a/graphprotocol-node/templates/_helpers.tpl b/graphprotocol-node/templates/_helpers.tpl new file mode 100644 index 0000000..1fb12f3 --- /dev/null +++ b/graphprotocol-node/templates/_helpers.tpl @@ -0,0 +1,52 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "graphprotocol-node.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "graphprotocol-node.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "graphprotocol-node.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "graphprotocol-node.labels" -}} +helm.sh/chart: {{ include "graphprotocol-node.chart" . }} +{{ include "graphprotocol-node.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "graphprotocol-node.selectorLabels" -}} +app.kubernetes.io/name: {{ include "graphprotocol-node.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/graphprotocol-node/templates/deployment.yaml b/graphprotocol-node/templates/deployment.yaml new file mode 100644 index 0000000..8974d1b --- /dev/null +++ b/graphprotocol-node/templates/deployment.yaml @@ -0,0 +1,130 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "graphprotocol-node.fullname" . }} + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} +spec: + {{/* There shouldn't be more than 1 index (ingest) graph-protocol node in installation */}} + {{- if eq .Values.role "index-node" -}} + replicas: 1 + strategy: + type: Recreate + {{- else -}} + replicas: {{ .Values.replicaCount }} + strategy: + type: RollingUpdate + {{- end }} + selector: + matchLabels: + {{- include "graphprotocol-node.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/secret.yaml: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "graphprotocol-node.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + - name: wait-for-rta + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["/bin/sh", "-c"] + args: + - "until nc -z -w2 {{ .Values.postgres.host }} 5432; do echo 'waiting for postgres'; sleep 2; done;" + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{ if eq .Values.role "index-node" }} + {{- /* Index (ingest) node_id should equal BLOCK_INGESTOR env value to work in this mode */}} + - name: BLOCK_INGESTOR + value: {{ .Values.blockIngestorNodeId | quote }} + - name: node_id + value: {{ .Values.blockIngestorNodeId | quote }} + {{- else -}} + - name: node_id + valueFrom: + fieldRef: + fieldPath: metadata.name + {{- end }} + - name: node_role + value: {{ .Values.role | quote }} + - name: GRAPH_KILL_IF_UNRESPONSIVE + value: "false" + - name: ipfs + value: {{ required "config.ipfs wasn't specified" .Values.config.ipfs | quote }} + - name: GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH + value: "true" + - name: GRAPH_NODE_CONFIG + value: "/etc/graph-node/config.toml" + - name: PG_PASS + valueFrom: + secretKeyRef: + {{- if hasKey .Values.postgres.password "fromSecret" }} + name: {{ .Values.postgres.password.fromSecret.name }} + key: {{ .Values.postgres.password.fromSecret.key }} + {{- else }} + name: {{ include "graphprotocol-node.fullname" . }} + key: pgPass + {{- end }} + ports: + - name: metrics + containerPort: 8040 + protocol: TCP + - name: json-rpc + containerPort: 8020 + protocol: TCP + - name: graphql + containerPort: 8000 + protocol: TCP + - name: graphql-ws + containerPort: 8001 + protocol: TCP + {{- if eq .Values.role "index-node" }} + - name: index + containerPort: 8030 + protocol: TCP + {{- end }} + livenessProbe: + httpGet: + path: / + port: metrics + readinessProbe: + httpGet: + path: / + port: metrics + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config + mountPath: "/etc/graph-node" + readOnly: true + volumes: + - name: config + secret: + secretName: {{ include "graphprotocol-node.fullname" . }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/graphprotocol-node/templates/ingress.yaml b/graphprotocol-node/templates/ingress.yaml new file mode 100644 index 0000000..d1311a0 --- /dev/null +++ b/graphprotocol-node/templates/ingress.yaml @@ -0,0 +1,71 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "graphprotocol-node.fullname" . }} + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "graphprotocol-node.fullname" $ }} + port: + number: 8000 + {{- end }} +{{- end }} +--- +{{- if .Values.ingressWebsocket.enabled -}} +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: {{ include "graphprotocol-node.fullname" . }}-ws + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} + {{- with .Values.ingressWebsocket.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingressWebsocket.tls }} + tls: + {{- range .Values.ingressWebsocket.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingressWebsocket.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: / + pathType: Prefix + backend: + serviceName: {{ include "graphprotocol-node.fullname" $ }} + servicePort: graphql-ws + {{- end }} +{{- end }} diff --git a/graphprotocol-node/templates/secret.yaml b/graphprotocol-node/templates/secret.yaml new file mode 100644 index 0000000..7779512 --- /dev/null +++ b/graphprotocol-node/templates/secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "graphprotocol-node.fullname" . }} + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} +data: + config.toml: {{ include "graphprotocol-node.config" . | b64enc }} + {{- if not (hasKey .Values.postgres.password "fromSecret") }} + pgPass: {{ .Values.postgres.password.value | b64enc | quote }} + {{- end }} diff --git a/graphprotocol-node/templates/service.yaml b/graphprotocol-node/templates/service.yaml new file mode 100644 index 0000000..d35f435 --- /dev/null +++ b/graphprotocol-node/templates/service.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "graphprotocol-node.fullname" . }} + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.metricsPort }} + targetPort: metrics + protocol: TCP + name: metrics + - port: {{ .Values.service.jsonRpcPort }} + targetPort: json-rpc + protocol: TCP + name: json-rpc + - port: {{ .Values.service.graphqlPort }} + targetPort: graphql + protocol: TCP + name: graphql + - port: {{ .Values.service.graphqlWsPort }} + targetPort: graphql-ws + protocol: TCP + name: graphql-ws + {{- if eq .Values.role "index-node" }} + - port: {{ .Values.service.indexPort }} + targetPort: index + protocol: TCP + name: index + {{- end }} + selector: + {{- include "graphprotocol-node.selectorLabels" . | nindent 4 }} diff --git a/graphprotocol-node/templates/servicemonitor.yaml b/graphprotocol-node/templates/servicemonitor.yaml new file mode 100644 index 0000000..83c8d6c --- /dev/null +++ b/graphprotocol-node/templates/servicemonitor.yaml @@ -0,0 +1,14 @@ +{{- if .Values.monitoring.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "graphprotocol-node.fullname" . }} + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "graphprotocol-node.selectorLabels" . | nindent 6 }} + endpoints: + - port: metrics +{{- end -}} diff --git a/graphprotocol-node/values.schema.json b/graphprotocol-node/values.schema.json new file mode 100644 index 0000000..3ea3bca --- /dev/null +++ b/graphprotocol-node/values.schema.json @@ -0,0 +1,261 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "Values", + "type": "object", + "required": [ + "image", + "imagePullSecrets", + "nameOverride", + "fullnameOverride", + "podSecurityContext", + "securityContext", + "service", + "resources", + "nodeSelector", + "tolerations", + "affinity", + "config", + "postgres", + "blockIngestorNodeId", + "role", + "monitoring", + "ingress", + "ingressWebsocket" + ], + "properties": { + "image": { + "description": "Container Image", + "required": [ + "repository", + "tag", + "pullPolicy" + ], + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "pullPolicy": { + "type": "string", + "enum": [ + "Always", + "IfNotPresent", + "Never" + ] + } + }, + "type": "object" + }, + "imagePullSecrets": { + "type": "array" + }, + "nameOverride": { + "type": "string" + }, + "fullnameOverride": { + "type": "string" + }, + "podSecurityContext": { + "type": "object" + }, + "securityContext": { + "type": "object" + }, + "service": { + "type": "object", + "required": [ + "annotations", + "type", + "metricsPort", + "jsonRpcPort", + "graphqlPort", + "graphqlWsPort", + "indexPort" + ], + "properties": { + "annotations": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "ClusterIP", + "ExternalName", + "LoadBalancer", + "NodePort" + ] + }, + "metricsPort": { + "type": "integer" + }, + "jsonRpcPort": { + "type": "integer" + }, + "graphqlPort": { + "type": "integer" + }, + "graphqlWsPort": { + "type": "integer" + }, + "indexPort": { + "type": "integer" + } + } + }, + "resources": { + "type": "object" + }, + "nodeSelector": { + "type": "object" + }, + "tolerations": { + "type": "array" + }, + "affinity": { + "type": "object" + }, + "config": { + "description": "Graph indexer agent config options", + "type": "object", + "required": [ + "ipfs", + "chains" + ], + "properties": { + "ipfs": { + "type": "string", + "description": "IPFS storage endpoint" + }, + "chains": { + "type": "object", + "description": "Definition of network providers for different blockchain networks" + } + } + }, + "postgres": { + "description": "Postgres DB configuration", + "type": "object", + "required": [ + "db", + "host", + "user", + "password" + ], + "properties": { + "db": { + "type": "string", + "description": "database name" + }, + "host": { + "type": "string", + "description": "host" + }, + "replicaHost": { + "type": "string", + "description": "replica host" + }, + "user": { + "type": "string", + "description": "user" + }, + "password": { + "type": "object", + "description": "password", + "properties": { + "fromSecret": { + "type": "object", + "required": [ + "key", + "name" + ], + "properties": { + "key": { + "type": "string", + "description": "key containing postgres password in secret" + }, + "name": { + "type": "string", + "description": "name of secret containing postgres password" + } + } + }, + "value": { + "type": "string", + "description": "postgres password" + } + } + } + } + }, + "blockIngestorNodeId": { + "type": "string", + "description": "graphprotocol ingest node id" + }, + "role": { + "type": "string", + "description": "role of the deployed graphprotocol node", + "enum": [ + "query-node", + "index-node" + ] + }, + "monitoring": { + "type": "object", + "required": [ + "enabled" + ], + "enabled": { + "type": "boolean", + "description": "enabled ServiceMonitor object creation" + } + } + }, + "ingress": { + "type": "object", + "required": [ + "enabled", + "annotations", + "hosts", + "tls" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "hosts": { + "type": "array" + }, + "tls": { + "type": "array" + } + } + }, + "ingressWebsocket": { + "type": "object", + "required": [ + "enabled", + "annotations", + "hosts", + "tls" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "hosts": { + "type": "array" + }, + "tls": { + "type": "array" + } + } + } +} diff --git a/graphprotocol-node/values.yaml b/graphprotocol-node/values.yaml new file mode 100644 index 0000000..8310adc --- /dev/null +++ b/graphprotocol-node/values.yaml @@ -0,0 +1,110 @@ +# Default values for graphprotocol-node. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: graphprotocol/graph-node + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + annotations: {} + type: ClusterIP + metricsPort: 8040 + jsonRpcPort: 8020 + graphqlPort: 8000 + graphqlWsPort: 8001 + indexPort: 8030 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +config: + ipfs: "" + chains: {} + # mainnet: + # providers: + # - label: name + # transport: rpc + # url: url + # features: [ archive ] + # headers: {"Authorization": "Bearer foo"} + +postgres: + db: "" + host: "" + replicaHost: "" + user: "" + password: + value: "" + # fromSecret: + # name: + # key: + +# Shouldn't have - sign, cause it would be replaced with _ +blockIngestorNodeId: index_node + +# Possible values: query-node, index-node +role: "query-node" + +monitoring: + enabled: false + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + # - host: chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressWebsocket: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + # - host: chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local From 8a9d6fee009d426e0fee6c5f1e8d0aebbae64847 Mon Sep 17 00:00:00 2001 From: Nick Kou Date: Mon, 15 Aug 2022 09:14:05 +1200 Subject: [PATCH 2/2] add piipeline --- .github/workflows/helm-release.yml | 34 +++++++++++++++++++ .../graphprotocol-node}/.helmignore | 0 .../graphprotocol-node}/Chart.yaml | 0 .../graphprotocol-node}/templates/_config.tpl | 0 .../templates/_helpers.tpl | 0 .../templates/deployment.yaml | 0 .../templates/ingress.yaml | 0 .../graphprotocol-node}/templates/secret.yaml | 0 .../templates/service.yaml | 0 .../templates/servicemonitor.yaml | 0 .../graphprotocol-node}/values.schema.json | 0 .../graphprotocol-node}/values.yaml | 0 12 files changed, 34 insertions(+) create mode 100644 .github/workflows/helm-release.yml rename {graphprotocol-node => charts/graphprotocol-node}/.helmignore (100%) rename {graphprotocol-node => charts/graphprotocol-node}/Chart.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/_config.tpl (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/_helpers.tpl (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/deployment.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/ingress.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/secret.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/service.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/templates/servicemonitor.yaml (100%) rename {graphprotocol-node => charts/graphprotocol-node}/values.schema.json (100%) rename {graphprotocol-node => charts/graphprotocol-node}/values.yaml (100%) diff --git a/.github/workflows/helm-release.yml b/.github/workflows/helm-release.yml new file mode 100644 index 0000000..039bc04 --- /dev/null +++ b/.github/workflows/helm-release.yml @@ -0,0 +1,34 @@ +name: Release Charts + +on: + push: + branches: + - main + +jobs: + release: + # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions + # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.4.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/graphprotocol-node/.helmignore b/charts/graphprotocol-node/.helmignore similarity index 100% rename from graphprotocol-node/.helmignore rename to charts/graphprotocol-node/.helmignore diff --git a/graphprotocol-node/Chart.yaml b/charts/graphprotocol-node/Chart.yaml similarity index 100% rename from graphprotocol-node/Chart.yaml rename to charts/graphprotocol-node/Chart.yaml diff --git a/graphprotocol-node/templates/_config.tpl b/charts/graphprotocol-node/templates/_config.tpl similarity index 100% rename from graphprotocol-node/templates/_config.tpl rename to charts/graphprotocol-node/templates/_config.tpl diff --git a/graphprotocol-node/templates/_helpers.tpl b/charts/graphprotocol-node/templates/_helpers.tpl similarity index 100% rename from graphprotocol-node/templates/_helpers.tpl rename to charts/graphprotocol-node/templates/_helpers.tpl diff --git a/graphprotocol-node/templates/deployment.yaml b/charts/graphprotocol-node/templates/deployment.yaml similarity index 100% rename from graphprotocol-node/templates/deployment.yaml rename to charts/graphprotocol-node/templates/deployment.yaml diff --git a/graphprotocol-node/templates/ingress.yaml b/charts/graphprotocol-node/templates/ingress.yaml similarity index 100% rename from graphprotocol-node/templates/ingress.yaml rename to charts/graphprotocol-node/templates/ingress.yaml diff --git a/graphprotocol-node/templates/secret.yaml b/charts/graphprotocol-node/templates/secret.yaml similarity index 100% rename from graphprotocol-node/templates/secret.yaml rename to charts/graphprotocol-node/templates/secret.yaml diff --git a/graphprotocol-node/templates/service.yaml b/charts/graphprotocol-node/templates/service.yaml similarity index 100% rename from graphprotocol-node/templates/service.yaml rename to charts/graphprotocol-node/templates/service.yaml diff --git a/graphprotocol-node/templates/servicemonitor.yaml b/charts/graphprotocol-node/templates/servicemonitor.yaml similarity index 100% rename from graphprotocol-node/templates/servicemonitor.yaml rename to charts/graphprotocol-node/templates/servicemonitor.yaml diff --git a/graphprotocol-node/values.schema.json b/charts/graphprotocol-node/values.schema.json similarity index 100% rename from graphprotocol-node/values.schema.json rename to charts/graphprotocol-node/values.schema.json diff --git a/graphprotocol-node/values.yaml b/charts/graphprotocol-node/values.yaml similarity index 100% rename from graphprotocol-node/values.yaml rename to charts/graphprotocol-node/values.yaml