From f25d4a7f344627d4784770cfa66acff0683089e1 Mon Sep 17 00:00:00 2001 From: Paolo Facchinetti <51409747+paolofacchinetti@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:18:23 +0100 Subject: [PATCH] feat: add erpc chart (#345) * chore: wip draft of erpc chart * chore: progress * chore: remove postgresql * chore: update name * fix: deployment vol mounts, boot cmd * fix: set container to run as root for now * fix: helm test calls correct endpoint * fix: run erpc container as non root * feat: allow env substitution in the config file through secrets * docs: update readme * docs: update erpc readme --- charts/erpc/.helmignore | 23 ++ charts/erpc/Chart.yaml | 11 + charts/erpc/README.md | 84 ++++++ charts/erpc/README.md.gotmpl | 23 ++ charts/erpc/templates/_helpers.tpl | 62 +++++ charts/erpc/templates/configmap.yaml | 9 + charts/erpc/templates/deployment.yaml | 107 ++++++++ charts/erpc/templates/ingress.yaml | 61 +++++ charts/erpc/templates/secret.yaml | 10 + charts/erpc/templates/service.yaml | 22 ++ charts/erpc/templates/serviceaccount.yaml | 13 + charts/erpc/templates/servicemonitor.yaml | 43 ++++ .../erpc/templates/tests/test-connection.yaml | 15 ++ charts/erpc/values.yaml | 243 ++++++++++++++++++ 14 files changed, 726 insertions(+) create mode 100644 charts/erpc/.helmignore create mode 100644 charts/erpc/Chart.yaml create mode 100644 charts/erpc/README.md create mode 100644 charts/erpc/README.md.gotmpl create mode 100644 charts/erpc/templates/_helpers.tpl create mode 100644 charts/erpc/templates/configmap.yaml create mode 100644 charts/erpc/templates/deployment.yaml create mode 100644 charts/erpc/templates/ingress.yaml create mode 100644 charts/erpc/templates/secret.yaml create mode 100644 charts/erpc/templates/service.yaml create mode 100644 charts/erpc/templates/serviceaccount.yaml create mode 100644 charts/erpc/templates/servicemonitor.yaml create mode 100644 charts/erpc/templates/tests/test-connection.yaml create mode 100644 charts/erpc/values.yaml diff --git a/charts/erpc/.helmignore b/charts/erpc/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/erpc/.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/charts/erpc/Chart.yaml b/charts/erpc/Chart.yaml new file mode 100644 index 00000000..015a0fd7 --- /dev/null +++ b/charts/erpc/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +name: erpc +description: eRPC is a fault-tolerant EVM RPC proxy and re-org aware permanent caching solution. It is built with read-heavy use-cases in mind such as data indexing and high-load frontend usage. +home: https://github.com/erpc/erpc +type: application +version: 0.0.1 +maintainers: + - name: barnabasbusa + email: busa.barnabas@gmail.com + - name: pk910 + email: pk910@pk910.de diff --git a/charts/erpc/README.md b/charts/erpc/README.md new file mode 100644 index 00000000..9421a440 --- /dev/null +++ b/charts/erpc/README.md @@ -0,0 +1,84 @@ + +# erpc + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +eRPC is a fault-tolerant EVM RPC proxy and re-org aware permanent caching solution. It is built with read-heavy use-cases in mind such as data indexing and high-load frontend usage. + +**Homepage:** + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | Affinity configuration for pods | +| annotations | object | `{}` | Annotations for the StatefulSet | +| config | string | See `values.yaml` | Config file | +| containerSecurityContext | object | See `values.yaml` | The security context for containers | +| customCommand | list | `[]` | Command replacement for the erpc container | +| extraArgs | list | `[]` | Extra args for the erpc container | +| extraContainers | list | `[]` | Additional containers | +| extraEnv | list | `[]` | Additional env variables | +| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers | +| extraVolumeMounts | list | `[]` | Additional volume mounts | +| extraVolumes | list | `[]` | Additional volumes | +| fullnameOverride | string | `""` | Overrides the chart's computed fullname | +| httpPort | int | `4000` | | +| image.pullPolicy | string | `"IfNotPresent"` | erpc container pull policy | +| image.repository | string | `"ghcr.io/erpc/erpc"` | erpc container image repository | +| image.tag | string | `"0.0.26"` | erpc container image tag | +| imagePullSecrets | list | `[]` | Image pull secrets for Docker images | +| ingress.annotations | object | `{}` | Annotations for Ingress | +| ingress.enabled | bool | `false` | Ingress resource for the HTTP API | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths | list | `[]` | | +| ingress.tls | list | `[]` | Ingress TLS | +| initContainers | list | `[]` | Additional init containers | +| livenessProbe | object | See `values.yaml` | Liveness probe | +| metricsPort | int | `4001` | | +| nameOverride | string | `""` | Overrides the chart's name | +| nodeSelector | object | `{}` | Node selector for pods | +| persistence.accessModes | list | `["ReadWriteOnce"]` | Access mode for the volume claim template | +| persistence.annotations | object | `{}` | Annotations for volume claim template | +| persistence.enabled | bool | `false` | Uses an EmptyDir when not enabled | +| persistence.existingClaim | string | `nil` | Use an existing PVC when persistence.enabled | +| persistence.selector | object | `{}` | Selector for volume claim template | +| persistence.size | string | `"1Gi"` | Requested size for volume claim template | +| persistence.storageClassName | string | `nil` | Use a specific storage class E.g 'local-path' for local storage to achieve best performance Read more (https://github.com/rancher/local-path-provisioner) | +| podAnnotations | object | `{}` | Pod annotations | +| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created | +| podLabels | object | `{}` | Pod labels | +| podManagementPolicy | string | `"OrderedReady"` | Pod management policy | +| priorityClassName | string | `nil` | Pod priority class | +| readinessProbe | object | See `values.yaml` | Readiness probe | +| replicas | int | `1` | Number of replicas | +| resources | object | `{}` | Resource requests and limits | +| secretEnv | object | `{"ALCHEMY_API_KEY":"XXXXXXXXXX"}` | Secret env variables injected via a created secret These env variables can be used to populate the erpc config file with sensitive data such as RPC API keys | +| securityContext | object | See `values.yaml` | The security context for pods | +| service.type | string | `"ClusterIP"` | Service type | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations | +| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator | +| serviceMonitor.interval | string | `"1m"` | ServiceMonitor scrape interval | +| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels | +| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor | +| serviceMonitor.path | string | `"/metrics"` | Path to scrape | +| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings | +| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme | +| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout | +| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration | +| terminationGracePeriodSeconds | int | `30` | How long to wait until the pod is forcefully terminated | +| tolerations | list | `[]` | Tolerations for pods | +| topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pods | +| updateStrategy | object | `{"type":"RollingUpdate"}` | Update stategy for the Statefulset | +| updateStrategy.type | string | `"RollingUpdate"` | Update stategy type | + +# Getting Started + +Update the `config` field to configure the various upstreams that you want to proxy with eRPC. + +The `secretEnv` field can be used to securely add API keys to your configuration. + +For more information, check out the [eRPC repository](https://github.com/erpc/erpc). \ No newline at end of file diff --git a/charts/erpc/README.md.gotmpl b/charts/erpc/README.md.gotmpl new file mode 100644 index 00000000..7434485e --- /dev/null +++ b/charts/erpc/README.md.gotmpl @@ -0,0 +1,23 @@ + +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +# Getting Started + +Update the `config` field to configure the various upstreams that you want to proxy with eRPC. + +The `secretEnv` field can be used to securely add API keys to your configuration. + +For more information, check out the [eRPC repository](https://github.com/erpc/erpc). \ No newline at end of file diff --git a/charts/erpc/templates/_helpers.tpl b/charts/erpc/templates/_helpers.tpl new file mode 100644 index 00000000..086d888a --- /dev/null +++ b/charts/erpc/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "erpc.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 "erpc.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 "erpc.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "erpc.labels" -}} +helm.sh/chart: {{ include "erpc.chart" . }} +{{ include "erpc.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "erpc.selectorLabels" -}} +app.kubernetes.io/name: {{ include "erpc.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "erpc.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "erpc.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/erpc/templates/configmap.yaml b/charts/erpc/templates/configmap.yaml new file mode 100644 index 00000000..8c0b2e93 --- /dev/null +++ b/charts/erpc/templates/configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "erpc.fullname" . }}-config + labels: + {{- include "erpc.labels" . | nindent 4 }} +data: + erpc.yaml: | + {{- tpl .Values.config . | nindent 4 }} \ No newline at end of file diff --git a/charts/erpc/templates/deployment.yaml b/charts/erpc/templates/deployment.yaml new file mode 100644 index 00000000..96939d64 --- /dev/null +++ b/charts/erpc/templates/deployment.yaml @@ -0,0 +1,107 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "erpc.fullname" . }} + labels: + {{- include "erpc.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + {{- include "erpc.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "erpc.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ include "erpc.serviceAccountName" . }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 8 }} + initContainers: + {{- if .Values.initContainers }} + {{- toYaml .Values.initContainers | nindent 8 }} + {{- end }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + {{- if gt (len .Values.customCommand) 0 }} + {{- toYaml .Values.customCommand | nindent 12}} + {{- else }} + - ./erpc-server + - /erpc.yaml + {{- end }} + {{- if gt (len .Values.extraArgs) 0 }} + args: + {{- toYaml .Values.extraArgs | nindent 12}} + {{- end }} + securityContext: + {{- toYaml .Values.containerSecurityContext | nindent 12 }} + envFrom: + - secretRef: + name: {{ include "erpc.fullname" . }}-envs + volumeMounts: + - name: config + mountPath: /erpc.yaml + subPath: erpc.yaml + readOnly: true + {{- if .Values.extraVolumeMounts }} + {{ toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.httpPort }} + protocol: TCP + - name: metrics + containerPort: {{ .Values.metricsPort }} + protocol: TCP + {{- if .Values.extraPodPorts }} + {{ toYaml .Values.extraPodPorts | nindent 12 }} + {{- end }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + {{- if .Values.extraEnv }} + {{- toYaml .Values.extraEnv | nindent 12 }} + {{- end }} + {{- if .Values.extraContainers }} + {{ toYaml .Values.extraContainers | nindent 8}} + {{- end }} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 8 }} + affinity: + {{- toYaml .Values.affinity | nindent 8 }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + topologySpreadConstraints: + {{- toYaml .Values.topologySpreadConstraints | nindent 8 }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + volumes: + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | nindent 8}} + {{- end }} + - name: config + configMap: + name: {{ include "erpc.fullname" . }}-config diff --git a/charts/erpc/templates/ingress.yaml b/charts/erpc/templates/ingress.yaml new file mode 100644 index 00000000..1a65d0d7 --- /dev/null +++ b/charts/erpc/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "erpc.fullname" . -}} +{{- $svcPort := .Values.httpPort -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "erpc.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/erpc/templates/secret.yaml b/charts/erpc/templates/secret.yaml new file mode 100644 index 00000000..d2f179b9 --- /dev/null +++ b/charts/erpc/templates/secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "erpc.fullname" . }}-envs + labels: + {{- include "erpc.labels" . | nindent 4 }} +data: +{{- range $key, $value := .Values.secretEnv }} + {{ $key }}: {{ $value | b64enc }} +{{- end }} diff --git a/charts/erpc/templates/service.yaml b/charts/erpc/templates/service.yaml new file mode 100644 index 00000000..eaa182ae --- /dev/null +++ b/charts/erpc/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "erpc.fullname" . }} + labels: + {{- include "erpc.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.httpPort }} + targetPort: http + protocol: TCP + name: http + - port: {{ .Values.metricsPort }} + targetPort: metrics + protocol: TCP + name: metrics + {{- if .Values.extraPorts }} + {{ toYaml .Values.extraPorts | nindent 4}} + {{- end }} + selector: + {{- include "erpc.selectorLabels" . | nindent 4 }} diff --git a/charts/erpc/templates/serviceaccount.yaml b/charts/erpc/templates/serviceaccount.yaml new file mode 100644 index 00000000..655f501b --- /dev/null +++ b/charts/erpc/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "erpc.serviceAccountName" . }} + labels: + {{- include "erpc.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/erpc/templates/servicemonitor.yaml b/charts/erpc/templates/servicemonitor.yaml new file mode 100644 index 00000000..d88d588a --- /dev/null +++ b/charts/erpc/templates/servicemonitor.yaml @@ -0,0 +1,43 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "erpc.serviceAccountName" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} + labels: + {{- include "erpc.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.labels }} + {{- toYaml .Values.serviceMonitor.labels | nindent 4 }} + {{- end }} + {{- if .Values.serviceMonitor.annotations }} + annotations: + {{ toYaml .Values.serviceMonitor.annotations | nindent 4 }} + {{- end }} +spec: + endpoints: + - interval: {{ .Values.serviceMonitor.interval }} + {{- if .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} + {{- end }} + honorLabels: true + port: metrics + path: {{ .Values.serviceMonitor.path }} + scheme: {{.Values.serviceMonitor.scheme }} + {{- if .Values.serviceMonitor.tlsConfig }} + tlsConfig: + {{- toYaml .Values.serviceMonitor.tlsConfig | nindent 6 }} + {{- end }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: + {{- toYaml .Values.serviceMonitor.relabelings | nindent 4 }} + {{- end }} + jobLabel: "{{ .Release.Name }}" + selector: + matchLabels: + {{- include "erpc.selectorLabels" . | nindent 8 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/charts/erpc/templates/tests/test-connection.yaml b/charts/erpc/templates/tests/test-connection.yaml new file mode 100644 index 00000000..448fc682 --- /dev/null +++ b/charts/erpc/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "erpc.fullname" . }}-test-connection" + labels: + {{- include "erpc.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "erpc.fullname" . }}:{{ .Values.httpPort }}/healthcheck'] + restartPolicy: Never diff --git a/charts/erpc/values.yaml b/charts/erpc/values.yaml new file mode 100644 index 00000000..41056a0a --- /dev/null +++ b/charts/erpc/values.yaml @@ -0,0 +1,243 @@ +# -- Overrides the chart's name +nameOverride: "" + +# -- Overrides the chart's computed fullname +fullnameOverride: "" + +# -- Number of replicas +replicas: 1 + +image: + # -- erpc container image repository + repository: ghcr.io/erpc/erpc + # -- erpc container image tag + tag: 0.0.26 + # -- erpc container pull policy + pullPolicy: IfNotPresent + +# -- Config file +# @default -- See `values.yaml` +config: | + logLevel: debug + + database: + evmJsonRpcCache: + driver: memory + + server: + httpHostV4: "0.0.0.0" + listenV6: true + httpHostV6: "[::]" + httpPort: 4000 + + metrics: + enabled: true + hostV4: "0.0.0.0" + hostV6: "[::]" + port: 4001 + + projects: + - id: main + upstreams: + - endpoint: alchemy://${ALCHEMY_API_KEY} + +# -- Secret env variables injected via a created secret +# These env variables can be used to populate the erpc config file with sensitive data such as RPC API keys +secretEnv: + ALCHEMY_API_KEY: XXXXXXXXXX + +# - HTTP port for erpc +httpPort: 4000 + +# - Metrics port for erpc +metricsPort: 4001 + +# -- Extra args for the erpc container +extraArgs: [] + +# -- Command replacement for the erpc container +customCommand: [] + +ingress: + # -- Ingress resource for the HTTP API + enabled: false + # -- Annotations for Ingress + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # -- Ingress host + hosts: + - host: chart-example.local + paths: [] + # -- Ingress TLS + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +service: + # -- Service type + type: ClusterIP + +# -- Affinity configuration for pods +affinity: {} + +# -- Image pull secrets for Docker images +imagePullSecrets: [] + +# -- Annotations for the StatefulSet +annotations: {} + +# -- Liveness probe +# @default -- See `values.yaml` +livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: 60 + periodSeconds: 120 + +# -- Readiness probe +# @default -- See `values.yaml` +readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: 10 + periodSeconds: 10 + +# -- Node selector for pods +nodeSelector: {} + +# -- Pod labels +podLabels: {} + +# -- Pod annotations +podAnnotations: {} + +# -- Pod management policy +podManagementPolicy: OrderedReady + +# -- Pod priority class +priorityClassName: null + +# -- Resource requests and limits +resources: {} +# limits: +# cpu: 500m +# memory: 2Gi +# requests: +# cpu: 300m +# memory: 1Gi + +# -- The security context for pods +# @default -- See `values.yaml` +securityContext: + fsGroup: 10001 + runAsGroup: 10001 + runAsNonRoot: true + runAsUser: 10001 + +# -- The security context for containers +# @default -- See `values.yaml` +containerSecurityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Annotations to add to the service account + annotations: {} + # -- The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# -- How long to wait until the pod is forcefully terminated +terminationGracePeriodSeconds: 30 + +# -- Tolerations for pods +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +tolerations: [] + +# -- Topology Spread Constraints for pods +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ +topologySpreadConstraints: [] + +# -- Define the PodDisruptionBudget spec +# If not set then a PodDisruptionBudget will not be created +podDisruptionBudget: {} +# minAvailable: 1 +# maxUnavailable: 1 + +# -- Update stategy for the Statefulset +updateStrategy: + # -- Update stategy type + type: RollingUpdate + +# -- Additional init containers +initContainers: [] +# - name: my-init-container +# image: busybox:latest +# command: ['sh', '-c', 'echo hello'] + +# -- Additional containers +extraContainers: [] + +# -- Additional volumes +extraVolumes: [] + +# -- Additional volume mounts +extraVolumeMounts: [] + +# -- Additional ports. Useful when using extraContainers +extraPorts: [] + +# -- Additional env variables +extraEnv: [] + +persistence: + # -- Uses an EmptyDir when not enabled + enabled: false + # -- Use an existing PVC when persistence.enabled + existingClaim: null + # -- Access mode for the volume claim template + accessModes: + - ReadWriteOnce + # -- Requested size for volume claim template + size: 1Gi + # -- Use a specific storage class + # E.g 'local-path' for local storage to achieve best performance + # Read more (https://github.com/rancher/local-path-provisioner) + storageClassName: null + # -- Annotations for volume claim template + annotations: {} + # -- Selector for volume claim template + selector: {} + # matchLabels: + # app.kubernetes.io/name: something + +serviceMonitor: + # -- If true, a ServiceMonitor CRD is created for a prometheus operator + # https://github.com/coreos/prometheus-operator + enabled: false + # -- Path to scrape + path: /metrics + # -- Alternative namespace for ServiceMonitor + namespace: null + # -- Additional ServiceMonitor labels + labels: {} + # -- Additional ServiceMonitor annotations + annotations: {} + # -- ServiceMonitor scrape interval + interval: 1m + # -- ServiceMonitor scheme + scheme: http + # -- ServiceMonitor TLS configuration + tlsConfig: {} + # -- ServiceMonitor scrape timeout + scrapeTimeout: 30s + # -- ServiceMonitor relabelings + relabelings: []