From 5c5e91dd4468783ddc8bbf20596dbde0a685304f Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Fri, 3 Nov 2023 17:43:51 +0200 Subject: [PATCH 01/11] updates rpc-router helm chart (#97) * updates rpc-router helm chart * fix chart-testing cosign bug * change helm-extra-args to resolve errors --- .github/workflows/lint-test.yaml | 2 +- charts/rpc-router/Chart.yaml | 4 ++-- charts/rpc-router/README.md | 2 +- ct.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index f9809258..f71db28c 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -22,7 +22,7 @@ jobs: check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (list-changed) id: list-changed diff --git a/charts/rpc-router/Chart.yaml b/charts/rpc-router/Chart.yaml index c000d81d..e27fb6fc 100644 --- a/charts/rpc-router/Chart.yaml +++ b/charts/rpc-router/Chart.yaml @@ -21,13 +21,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.4 +version: 0.1.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 0.41.1 +appVersion: 0.42.4 dependencies: - name: redis diff --git a/charts/rpc-router/README.md b/charts/rpc-router/README.md index 4ed96277..2851abba 100644 --- a/charts/rpc-router/README.md +++ b/charts/rpc-router/README.md @@ -1,6 +1,6 @@ # rpc-router -![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.41.1](https://img.shields.io/badge/AppVersion-0.41.1-informational?style=flat-square) +![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.42.4](https://img.shields.io/badge/AppVersion-0.42.4-informational?style=flat-square) A Helm chart for deploying Emerald Dshackle - Fault Tolerant Load Balancer for Blockchain API, to Kubernetes, diff --git a/ct.yaml b/ct.yaml index 7c54b842..e5338445 100644 --- a/ct.yaml +++ b/ct.yaml @@ -5,4 +5,4 @@ chart-dirs: chart-repos: - chronicle=https://chronicleprotocol.github.io/charts - bitnami=https://charts.bitnami.com/bitnami -helm-extra-args: --timeout 600s +helm-extra-args: '--timeout 600s' From ed813a710ff72fdac6a70aec30429e8bcb394bd2 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Mon, 6 Nov 2023 17:15:56 +0200 Subject: [PATCH 02/11] [sc-3203] adds nethermind client so we can run gnosis chain (#99) --- charts/nethermind/.helmignore | 23 +++ charts/nethermind/Chart.yaml | 28 +++ charts/nethermind/README.md | 89 +++++++++ charts/nethermind/templates/NOTES.txt | 22 +++ charts/nethermind/templates/_helpers.tpl | 62 +++++++ charts/nethermind/templates/hpa.yaml | 28 +++ charts/nethermind/templates/ingress.yaml | 61 +++++++ charts/nethermind/templates/secret.yaml | 8 + charts/nethermind/templates/service.yaml | 17 ++ .../nethermind/templates/serviceaccount.yaml | 12 ++ .../nethermind/templates/servicemonitor.yaml | 43 +++++ charts/nethermind/templates/statefulset.yaml | 124 +++++++++++++ .../templates/tests/test-connection.yaml | 23 +++ charts/nethermind/values.yaml | 172 ++++++++++++++++++ 14 files changed, 712 insertions(+) create mode 100644 charts/nethermind/.helmignore create mode 100644 charts/nethermind/Chart.yaml create mode 100644 charts/nethermind/README.md create mode 100644 charts/nethermind/templates/NOTES.txt create mode 100644 charts/nethermind/templates/_helpers.tpl create mode 100644 charts/nethermind/templates/hpa.yaml create mode 100644 charts/nethermind/templates/ingress.yaml create mode 100644 charts/nethermind/templates/secret.yaml create mode 100644 charts/nethermind/templates/service.yaml create mode 100644 charts/nethermind/templates/serviceaccount.yaml create mode 100644 charts/nethermind/templates/servicemonitor.yaml create mode 100644 charts/nethermind/templates/statefulset.yaml create mode 100644 charts/nethermind/templates/tests/test-connection.yaml create mode 100644 charts/nethermind/values.yaml diff --git a/charts/nethermind/.helmignore b/charts/nethermind/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/nethermind/.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/nethermind/Chart.yaml b/charts/nethermind/Chart.yaml new file mode 100644 index 00000000..b3b28ddf --- /dev/null +++ b/charts/nethermind/Chart.yaml @@ -0,0 +1,28 @@ +apiVersion: v2 +name: nethermind +description: A Helm chart for deploying ETH Nethermind nodes on Kubernetes + +maintainers: + - name: WesleyCharlesBlake + url: https://github.com/WesleyCharlesBlake + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.21.1" diff --git a/charts/nethermind/README.md b/charts/nethermind/README.md new file mode 100644 index 00000000..3aad789c --- /dev/null +++ b/charts/nethermind/README.md @@ -0,0 +1,89 @@ +# nethermind + +![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) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) + +A Helm chart for deploying ETH Nethermind nodes on Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| WesleyCharlesBlake | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| data.path | string | `"/nethermind-data"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"nethermind/nethermind"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| jwt | string | `"ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a"` | JWT secret used by client as a secret. Change this value. | +| livenessProbe.initialDelaySeconds | int | `60` | | +| livenessProbe.periodSeconds | int | `120` | | +| livenessProbe.tcpSocket.port | string | `"httprpc"` | | +| metrics.address | string | `nil` | | +| metrics.enabled | bool | `false` | | +| metrics.expensive | bool | `false` | | +| nameOverride | string | `""` | | +| network | string | `"sepolia"` | | +| nodeSelector | object | `{}` | | +| 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 | `"20Gi"` | 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 | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `10` | | +| readinessProbe.tcpSocket.port | string | `"httprpc"` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.ports.auth.port | int | `8551` | | +| service.ports.auth.protocol | string | `"TCP"` | | +| service.ports.httprpc.port | int | `8545` | | +| service.ports.httprpc.protocol | string | `"TCP"` | | +| service.ports.metrics.port | int | `9545` | | +| service.ports.metrics.protocol | string | `"TCP"` | | +| service.ports.p2ptcp.port | int | `30303` | | +| service.ports.p2ptcp.protocol | string | `"TCP"` | | +| service.ports.p2pudp.port | int | `30303` | | +| service.ports.p2pudp.protocol | string | `"UDP"` | | +| service.ports.ws.port | int | `8546` | | +| service.ports.ws.protocol | string | `"TCP"` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| 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 | `"/debug/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 | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/nethermind/templates/NOTES.txt b/charts/nethermind/templates/NOTES.txt new file mode 100644 index 00000000..a8a75e92 --- /dev/null +++ b/charts/nethermind/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nethermind.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nethermind.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nethermind.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nethermind.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/nethermind/templates/_helpers.tpl b/charts/nethermind/templates/_helpers.tpl new file mode 100644 index 00000000..40c19d86 --- /dev/null +++ b/charts/nethermind/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nethermind.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 "nethermind.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 "nethermind.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nethermind.labels" -}} +helm.sh/chart: {{ include "nethermind.chart" . }} +{{ include "nethermind.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nethermind.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nethermind.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "nethermind.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "nethermind.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/nethermind/templates/hpa.yaml b/charts/nethermind/templates/hpa.yaml new file mode 100644 index 00000000..60f32d5d --- /dev/null +++ b/charts/nethermind/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "nethermind.fullname" . }} + labels: + {{- include "nethermind.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "nethermind.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/nethermind/templates/ingress.yaml b/charts/nethermind/templates/ingress.yaml new file mode 100644 index 00000000..9de7bc47 --- /dev/null +++ b/charts/nethermind/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "nethermind.fullname" . -}} +{{- $svcPort := .Values.service.ports.http.port -}} +{{- 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 "nethermind.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/nethermind/templates/secret.yaml b/charts/nethermind/templates/secret.yaml new file mode 100644 index 00000000..e74e99df --- /dev/null +++ b/charts/nethermind/templates/secret.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "nethermind.fullname" . }}-jwt +type: Opaque +data: + jwt.hex: {{ .Values.jwt | b64enc }} diff --git a/charts/nethermind/templates/service.yaml b/charts/nethermind/templates/service.yaml new file mode 100644 index 00000000..d3817c0c --- /dev/null +++ b/charts/nethermind/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "nethermind.fullname" . }} + labels: + {{- include "nethermind.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + {{- range $key, $val := .Values.service.ports }} + - port: {{ $val.port }} + targetPort: {{ $val.port }} + protocol: {{ $val.protocol }} + name: {{ $key }} + {{- end }} + selector: + {{- include "nethermind.selectorLabels" . | nindent 4 }} diff --git a/charts/nethermind/templates/serviceaccount.yaml b/charts/nethermind/templates/serviceaccount.yaml new file mode 100644 index 00000000..8aedf523 --- /dev/null +++ b/charts/nethermind/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "nethermind.serviceAccountName" . }} + labels: + {{- include "nethermind.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/nethermind/templates/servicemonitor.yaml b/charts/nethermind/templates/servicemonitor.yaml new file mode 100644 index 00000000..770a53d0 --- /dev/null +++ b/charts/nethermind/templates/servicemonitor.yaml @@ -0,0 +1,43 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "nethermind.serviceAccountName" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} + labels: + {{- include "nethermind.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 "nethermind.selectorLabels" . | nindent 8 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/charts/nethermind/templates/statefulset.yaml b/charts/nethermind/templates/statefulset.yaml new file mode 100644 index 00000000..534b5c59 --- /dev/null +++ b/charts/nethermind/templates/statefulset.yaml @@ -0,0 +1,124 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "nethermind.fullname" . }} + labels: + {{- include "nethermind.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "nethermind.selectorLabels" . | nindent 6 }} + serviceName: {{ include "nethermind.fullname" . }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "nethermind.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "nethermind.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + resources: + {{- toYaml .Values.resources | nindent 12 }} + # command: + # - nethermind + args: + - --config={{ .Values.network }} + - --datadir={{ .Values.data.path }}/data + - --log=INFO + - --Sync.SnapSync=false + - --JsonRpc.Enabled=true + - --JsonRpc.Host=0.0.0.0 + - --JsonRpc.Port={{ .Values.service.ports.httprpc.port | default 8545 }} + - --JsonRpc.EnabledModules=[Web3,Eth,Subscribe,Net,] + - --JsonRpc.JwtSecretFile=/jwt.hex + - --JsonRpc.EngineHost=0.0.0.0 + - --JsonRpc.EnginePort={{ .Values.service.ports.auth.port | default 8551 }} + - --Network.DiscoveryPort={{ .Values.service.ports.p2ptcp.port | default 30303 }} + - --HealthChecks.Enabled=false + - --Pruning.CacheMb=2048 + {{- if .Values.metrics.enabled }} + - --Metrics.Enabled=true + - --Metrics.Enabled=true + - --Metrics.NodeName=$(POD_NAME) + - --Metrics.ExposePort={{ .Values.metricsPort }} + - --EthStats.Enabled true + {{- if .Values.metrics.expensive }} + - --metrics.expensive + {{- end }} + {{- end }} + ports: + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val.port }} + protocol: {{ $val.protocol }} + {{- end }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + volumeMounts: + - name: storage + mountPath: {{ .Values.data.path }} + - name: jwt + mountPath: "/data/jwt.hex" + subPath: jwt.hex + readOnly: true + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 8 }} + affinity: + {{- toYaml .Values.affinity | nindent 8 }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + volumes: + - name: jwt + secret: + secretName: {{ include "nethermind.fullname" . }}-jwt + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | nindent 8}} + {{- end }} + {{- if not .Values.persistence.enabled }} + - name: storage + emptyDir: {} + {{- else if .Values.persistence.existingClaim }} + - name: storage + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + {{- else }} + volumeClaimTemplates: + - metadata: + name: storage + annotations: + {{- toYaml .Values.persistence.annotations | nindent 8 }} + spec: + accessModes: + {{- toYaml .Values.persistence.accessModes | nindent 8 }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- if .Values.persistence.selector }} + selector: + {{- toYaml .Values.persistence.selector | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/nethermind/templates/tests/test-connection.yaml b/charts/nethermind/templates/tests/test-connection.yaml new file mode 100644 index 00000000..327ce6e5 --- /dev/null +++ b/charts/nethermind/templates/tests/test-connection.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "nethermind.fullname" . }}-test-connection" + labels: + {{- include "nethermind.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: curlimages/curl + command: ['curl'] + args: + - --location + - --request + - POST + - '{{ include "nethermind.fullname" . }}:{{ .Values.service.ports.httprpc.port }}/' + - --header + - 'Content-Type: application/json' + - --data-raw + - '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' + restartPolicy: Never diff --git a/charts/nethermind/values.yaml b/charts/nethermind/values.yaml new file mode 100644 index 00000000..7eac1ea4 --- /dev/null +++ b/charts/nethermind/values.yaml @@ -0,0 +1,172 @@ +# Default values for nethermind. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +network: sepolia +## can be Chiado (testnet),Energy Web,Exosama,Goerli (testnet),Gnosis,Holesky (testnet),Mainnet,Sepolia (testnet),Volta (testnet) + + +data: + path: /nethermind-data + +# -- JWT secret used by client as a secret. Change this value. +jwt: ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a + +image: + repository: nethermind/nethermind + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +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: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + ports: + httprpc: + port: 8545 + protocol: TCP + ws: + port: 8546 + protocol: TCP + auth: + port: 8551 + protocol: TCP + p2ptcp: + port: 30303 + protocol: TCP + p2pudp: + port: 30303 + protocol: UDP + metrics: + port: 9545 + protocol: TCP + +# @default -- See `values.yaml` +livenessProbe: + tcpSocket: + port: httprpc + initialDelaySeconds: 60 + periodSeconds: 120 + +# @default -- See `values.yaml` +readinessProbe: + tcpSocket: + port: httprpc + initialDelaySeconds: 10 + periodSeconds: 10 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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: 20Gi + # -- 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 + +metrics: + enabled: false + address: null + expensive: false + +serviceMonitor: + # -- If true, a ServiceMonitor CRD is created for a prometheus operator + # https://github.com/coreos/prometheus-operator + enabled: false + # -- Path to scrape + path: /debug/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: [] + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] +affinity: {} From a9cc82522cb028e3d216919a105369e8c30d0ca7 Mon Sep 17 00:00:00 2001 From: WesleyCharlesBlake Date: Mon, 6 Nov 2023 18:00:55 +0200 Subject: [PATCH 03/11] tweaks nethermind args and fix ingress --- charts/nethermind/Chart.yaml | 2 +- charts/nethermind/README.md | 16 ++++++++------- charts/nethermind/templates/ingress.yaml | 2 +- charts/nethermind/templates/statefulset.yaml | 14 ++++++------- charts/nethermind/values.yaml | 21 ++++++++++++++------ 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/charts/nethermind/Chart.yaml b/charts/nethermind/Chart.yaml index b3b28ddf..7051f9fc 100644 --- a/charts/nethermind/Chart.yaml +++ b/charts/nethermind/Chart.yaml @@ -19,7 +19,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.1 +version: 0.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/nethermind/README.md b/charts/nethermind/README.md index 3aad789c..8415327e 100644 --- a/charts/nethermind/README.md +++ b/charts/nethermind/README.md @@ -1,6 +1,6 @@ # nethermind -![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) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) +![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) A Helm chart for deploying ETH Nethermind nodes on Kubernetes @@ -19,7 +19,8 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | autoscaling.maxReplicas | int | `100` | | | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | -| data.path | string | `"/nethermind-data"` | | +| data | object | `{"path":"/nethermind-data"}` | Path to store data | +| fastSync | bool | `false` | If true, the node will sync from a fast sync, supported for gnosis | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"nethermind/nethermind"` | | @@ -27,7 +28,7 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | -| ingress.enabled | bool | `false` | | +| ingress.enabled | bool | `true` | | | ingress.hosts[0].host | string | `"chart-example.local"` | | | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | @@ -36,11 +37,11 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | livenessProbe.initialDelaySeconds | int | `60` | | | livenessProbe.periodSeconds | int | `120` | | | livenessProbe.tcpSocket.port | string | `"httprpc"` | | -| metrics.address | string | `nil` | | -| metrics.enabled | bool | `false` | | -| metrics.expensive | bool | `false` | | +| logLevel | string | `"INFO"` | Log level for the node | +| metrics.enabled | bool | `true` | | +| metrics.ethStats | bool | `true` | add node to ethstat | | nameOverride | string | `""` | | -| network | string | `"sepolia"` | | +| network | string | `"sepolia"` | can be Energy Web,Exosama,Goerli (testnet),Gnosis, Chiado ,Holesky (testnet),Mainnet,Sepolia (testnet),Volta (testnet) | | nodeSelector | object | `{}` | | | persistence.accessModes | list | `["ReadWriteOnce"]` | Access mode for the volume claim template | | persistence.annotations | object | `{}` | Annotations for volume claim template | @@ -83,6 +84,7 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme | | serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout | | serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration | +| syncMode | string | `"SnapSync"` | syncMode can be FastSync, SnapSync | | tolerations | list | `[]` | | ---------------------------------------------- diff --git a/charts/nethermind/templates/ingress.yaml b/charts/nethermind/templates/ingress.yaml index 9de7bc47..088ca206 100644 --- a/charts/nethermind/templates/ingress.yaml +++ b/charts/nethermind/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "nethermind.fullname" . -}} -{{- $svcPort := .Values.service.ports.http.port -}} +{{- $svcPort := .Values.service.ports.httprpc.port -}} {{- 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}} diff --git a/charts/nethermind/templates/statefulset.yaml b/charts/nethermind/templates/statefulset.yaml index 534b5c59..77d0bbdd 100644 --- a/charts/nethermind/templates/statefulset.yaml +++ b/charts/nethermind/templates/statefulset.yaml @@ -40,8 +40,10 @@ spec: args: - --config={{ .Values.network }} - --datadir={{ .Values.data.path }}/data - - --log=INFO - - --Sync.SnapSync=false + - --log={{ .Values.logLevel }} + {{ if .Values.syncMode }} + - --Sync.{{ .Values.syncMode }}=true + {{- end }} - --JsonRpc.Enabled=true - --JsonRpc.Host=0.0.0.0 - --JsonRpc.Port={{ .Values.service.ports.httprpc.port | default 8545 }} @@ -53,13 +55,11 @@ spec: - --HealthChecks.Enabled=false - --Pruning.CacheMb=2048 {{- if .Values.metrics.enabled }} - - --Metrics.Enabled=true - --Metrics.Enabled=true - --Metrics.NodeName=$(POD_NAME) - - --Metrics.ExposePort={{ .Values.metricsPort }} - - --EthStats.Enabled true - {{- if .Values.metrics.expensive }} - - --metrics.expensive + - --Metrics.ExposePort={{ .Values.service.ports.metrics.port }} + {{- if .Values.metrics.ethStats }} + - --EthStats.Enabled=true {{- end }} {{- end }} ports: diff --git a/charts/nethermind/values.yaml b/charts/nethermind/values.yaml index 7eac1ea4..041dad34 100644 --- a/charts/nethermind/values.yaml +++ b/charts/nethermind/values.yaml @@ -4,16 +4,25 @@ replicaCount: 1 +# -- can be Energy Web,Exosama,Goerli (testnet),Gnosis, Chiado ,Holesky (testnet),Mainnet,Sepolia (testnet),Volta (testnet) network: sepolia -## can be Chiado (testnet),Energy Web,Exosama,Goerli (testnet),Gnosis,Holesky (testnet),Mainnet,Sepolia (testnet),Volta (testnet) - +# -- Path to store data data: path: /nethermind-data # -- JWT secret used by client as a secret. Change this value. jwt: ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a +# -- Log level for the node +logLevel: 'INFO' + +# -- syncMode can be FastSync, SnapSync +syncMode: 'SnapSync' + +# -- If true, the node will sync from a fast sync, supported for gnosis +fastSync: false + image: repository: nethermind/nethermind pullPolicy: IfNotPresent @@ -83,7 +92,7 @@ readinessProbe: periodSeconds: 10 ingress: - enabled: false + enabled: true className: "" annotations: {} # kubernetes.io/ingress.class: nginx @@ -120,9 +129,9 @@ persistence: # app.kubernetes.io/name: something metrics: - enabled: false - address: null - expensive: false + enabled: true + # -- add node to ethstat + ethStats: true serviceMonitor: # -- If true, a ServiceMonitor CRD is created for a prometheus operator From 5fdd9520f72c917683421e6cbc0bc62a4b713129 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Tue, 7 Nov 2023 14:21:56 +0200 Subject: [PATCH 04/11] initial lighthouse chart (#100) --- charts/lighthouse/.helmignore | 23 +++ charts/lighthouse/Chart.yaml | 29 +++ charts/lighthouse/README.md | 78 +++++++++ charts/lighthouse/templates/NOTES.txt | 12 ++ charts/lighthouse/templates/_helpers.tpl | 62 +++++++ charts/lighthouse/templates/hpa.yaml | 28 +++ charts/lighthouse/templates/ingress.yaml | 61 +++++++ charts/lighthouse/templates/secret.yaml | 8 + charts/lighthouse/templates/service.yaml | 34 ++++ .../lighthouse/templates/serviceaccount.yaml | 12 ++ .../lighthouse/templates/servicemonitor.yaml | 43 +++++ charts/lighthouse/templates/statefulset.yaml | 123 +++++++++++++ .../templates/tests/test-connection.yaml | 15 ++ charts/lighthouse/values.yaml | 165 ++++++++++++++++++ charts/nethermind/Chart.yaml | 2 +- charts/nethermind/README.md | 3 +- charts/nethermind/templates/statefulset.yaml | 2 +- charts/nethermind/values.yaml | 3 - 18 files changed, 696 insertions(+), 7 deletions(-) create mode 100644 charts/lighthouse/.helmignore create mode 100644 charts/lighthouse/Chart.yaml create mode 100644 charts/lighthouse/README.md create mode 100644 charts/lighthouse/templates/NOTES.txt create mode 100644 charts/lighthouse/templates/_helpers.tpl create mode 100644 charts/lighthouse/templates/hpa.yaml create mode 100644 charts/lighthouse/templates/ingress.yaml create mode 100644 charts/lighthouse/templates/secret.yaml create mode 100644 charts/lighthouse/templates/service.yaml create mode 100644 charts/lighthouse/templates/serviceaccount.yaml create mode 100644 charts/lighthouse/templates/servicemonitor.yaml create mode 100644 charts/lighthouse/templates/statefulset.yaml create mode 100644 charts/lighthouse/templates/tests/test-connection.yaml create mode 100644 charts/lighthouse/values.yaml diff --git a/charts/lighthouse/.helmignore b/charts/lighthouse/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/lighthouse/.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/lighthouse/Chart.yaml b/charts/lighthouse/Chart.yaml new file mode 100644 index 00000000..e2d2e1e1 --- /dev/null +++ b/charts/lighthouse/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: lighthouse +description: A Helm chart for deploying the Lodestar Consensus Layer / beacon on Kubernetes + +maintainers: + - name: WesleyCharlesBlake + url: https://github.com/WesleyCharlesBlake + - name: chronicleprotocol + url: https://github.com/chronicleprotocol +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v4.0.8" diff --git a/charts/lighthouse/README.md b/charts/lighthouse/README.md new file mode 100644 index 00000000..df7a7569 --- /dev/null +++ b/charts/lighthouse/README.md @@ -0,0 +1,78 @@ +# lighthouse + +![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) ![AppVersion: v4.0.8](https://img.shields.io/badge/AppVersion-v4.0.8-informational?style=flat-square) + +A Helm chart for deploying the Lodestar Consensus Layer / beacon on Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| WesleyCharlesBlake | | | +| chronicleprotocol | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| checkpointSyncUrl | string | `"https://sepolia.beaconstate.info"` | | +| executionEndpoint | string | `"https://neth.sepolia.tooling.chroniclelabs.io"` | | +| fullnameOverride | string | `""` | | +| genesisStateUrl | string | `"https://sepolia.beaconstate.info"` | | +| httpPort | int | `3500` | HTTP Port | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"sigp/lighthouse"` | | +| image.tag | string | `"latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| jwt | string | `"7992bcce239c6dcfeba3305ce928d061d2ba9a515319ca3ad66752d74fa67a60"` | JWT secret used by client as a secret. Change this value. | +| livenessProbe | object | `{"initialDelaySeconds":60,"periodSeconds":120,"tcpSocket":{"port":"http-api"}}` | Liveness probe | +| metricsAddress | string | `"0.0.0.0"` | Metrics Address | +| metricsAllowOrigin | string | `"*"` | Metrics Allow Origin | +| metricsPort | int | `8080` | Metrics Port | +| nameOverride | string | `""` | | +| network | string | `"sepolia"` | | +| nodeSelector | object | `{}` | | +| p2pPort | int | `13000` | P2P Port | +| 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 | `"20Gi"` | 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 | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe | object | `{"initialDelaySeconds":10,"periodSeconds":10,"tcpSocket":{"port":"http-api"}}` | Readiness probe | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| rpcPort | int | `4000` | RPC Port | +| securityContext | object | `{}` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| 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 | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/lighthouse/templates/NOTES.txt b/charts/lighthouse/templates/NOTES.txt new file mode 100644 index 00000000..47b38ce9 --- /dev/null +++ b/charts/lighthouse/templates/NOTES.txt @@ -0,0 +1,12 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "lighthouse.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/lighthouse/templates/_helpers.tpl b/charts/lighthouse/templates/_helpers.tpl new file mode 100644 index 00000000..bdda3503 --- /dev/null +++ b/charts/lighthouse/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "lighthouse.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 "lighthouse.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 "lighthouse.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "lighthouse.labels" -}} +helm.sh/chart: {{ include "lighthouse.chart" . }} +{{ include "lighthouse.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lighthouse.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lighthouse.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "lighthouse.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "lighthouse.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/lighthouse/templates/hpa.yaml b/charts/lighthouse/templates/hpa.yaml new file mode 100644 index 00000000..01e712c1 --- /dev/null +++ b/charts/lighthouse/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "lighthouse.fullname" . }} + labels: + {{- include "lighthouse.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "lighthouse.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/lighthouse/templates/ingress.yaml b/charts/lighthouse/templates/ingress.yaml new file mode 100644 index 00000000..12a90590 --- /dev/null +++ b/charts/lighthouse/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "lighthouse.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 "lighthouse.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/lighthouse/templates/secret.yaml b/charts/lighthouse/templates/secret.yaml new file mode 100644 index 00000000..ac30e1b7 --- /dev/null +++ b/charts/lighthouse/templates/secret.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "lighthouse.fullname" . }}-jwt +type: Opaque +data: + jwt.hex: {{ .Values.jwt | b64enc }} diff --git a/charts/lighthouse/templates/service.yaml b/charts/lighthouse/templates/service.yaml new file mode 100644 index 00000000..fba620a7 --- /dev/null +++ b/charts/lighthouse/templates/service.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lighthouse.fullname" . }} + labels: + {{- include "lighthouse.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.p2pPort }} + targetPort: p2p-tcp + protocol: TCP + name: p2p-tcp + - port: {{ .Values.p2pPort }} + targetPort: p2p-udp + protocol: UDP + name: p2p-udp + - port: {{ .Values.httpPort }} + targetPort: http-api + protocol: TCP + name: http-api + - port: {{ .Values.rpcPort }} + targetPort: rpc + protocol: TCP + name: rpc + - port: {{ .Values.metricsPort }} + targetPort: metrics + protocol: TCP + name: metrics + {{- if .Values.extraPorts }} + {{ toYaml .Values.extraPorts | nindent 4}} + {{- end }} + selector: + {{- include "lighthouse.selectorLabels" . | nindent 4 }} diff --git a/charts/lighthouse/templates/serviceaccount.yaml b/charts/lighthouse/templates/serviceaccount.yaml new file mode 100644 index 00000000..e96c8335 --- /dev/null +++ b/charts/lighthouse/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "lighthouse.serviceAccountName" . }} + labels: + {{- include "lighthouse.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/lighthouse/templates/servicemonitor.yaml b/charts/lighthouse/templates/servicemonitor.yaml new file mode 100644 index 00000000..edff80d7 --- /dev/null +++ b/charts/lighthouse/templates/servicemonitor.yaml @@ -0,0 +1,43 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "lighthouse.serviceAccountName" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} + labels: + {{- include "lighthouse.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 "lighthouse.selectorLabels" . | nindent 8 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/charts/lighthouse/templates/statefulset.yaml b/charts/lighthouse/templates/statefulset.yaml new file mode 100644 index 00000000..4acc5785 --- /dev/null +++ b/charts/lighthouse/templates/statefulset.yaml @@ -0,0 +1,123 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "lighthouse.fullname" . }} + labels: + {{- include "lighthouse.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "lighthouse.selectorLabels" . | nindent 6 }} + serviceName: {{ include "lighthouse.fullname" . }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "lighthouse.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "lighthouse.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + resources: + {{- toYaml .Values.resources | nindent 12 }} + args: + - lighthouse + - bn + - --network={{ .Values.network }} + - --datadir=/data + - --disable-upnp + - --disable-enr-auto-update + - --execution-endpoint={{ .Values.executionEndpoint }} + - --execution-jwt=/data/jwt.hex + - --genesis-state-url={{ .Values.genesisStateUrl }} + - --checkpoint-sync-url={{ .Values.checkpointSyncUrl }} + - --http + - --http-address=0.0.0.0 + - --http-port={{ .Values.httpPort }} + - --disable-deposit-contract-sync + - --metrics + - --metrics-address={{ .Values.metricsAddress }} + - --metrics-port={{ .Values.metricsPort }} + - --metrics-allow-origin={{ .Values.metricsAllowOrigin }} + ports: + - name: p2p-tcp + containerPort: {{ .Values.p2pPort }} + protocol: TCP + - name: p2p-udp + containerPort: {{ .Values.p2pPort }} + protocol: UDP + - name: http-api + containerPort: {{ .Values.httpPort }} + protocol: TCP + - name: rpc + containerPort: {{ .Values.rpcPort }} + protocol: TCP + - name: metrics + containerPort: {{ .Values.metricsPort }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + volumeMounts: + - name: storage + mountPath: "/data/" + - name: jwt + mountPath: "/data/jwt.hex" + subPath: jwt.hex + readOnly: true + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 8 }} + affinity: + {{- toYaml .Values.affinity | nindent 8 }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + volumes: + - name: jwt + secret: + secretName: {{ include "lighthouse.fullname" . }}-jwt + {{- if not .Values.persistence.enabled }} + - name: storage + emptyDir: {} + {{- else if .Values.persistence.existingClaim }} + - name: storage + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + {{- else }} + volumeClaimTemplates: + - metadata: + name: storage + annotations: + {{- toYaml .Values.persistence.annotations | nindent 8 }} + spec: + accessModes: + {{- toYaml .Values.persistence.accessModes | nindent 8 }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- if .Values.persistence.selector }} + selector: + {{- toYaml .Values.persistence.selector | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/lighthouse/templates/tests/test-connection.yaml b/charts/lighthouse/templates/tests/test-connection.yaml new file mode 100644 index 00000000..af703360 --- /dev/null +++ b/charts/lighthouse/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lighthouse.fullname" . }}-test-connection" + labels: + {{- include "lighthouse.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "lighthouse.fullname" . }}:{{ .Values.httpPort }}/eth/v1/node/version'] + restartPolicy: Never diff --git a/charts/lighthouse/values.yaml b/charts/lighthouse/values.yaml new file mode 100644 index 00000000..df36f59b --- /dev/null +++ b/charts/lighthouse/values.yaml @@ -0,0 +1,165 @@ +# Default values for lighthouse. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: sigp/lighthouse + pullPolicy: IfNotPresent + tag: "latest" + +network: sepolia +# can be mainnet or sepolia, gnosis etc + +checkpointSyncUrl: https://sepolia.beaconstate.info +# can be https://goerli.checkpoint-sync.ethpandaops.io https://mainnet-checkpoint-sync.stakely.io + +genesisStateUrl: https://sepolia.beaconstate.info +# can be https://goerli.checkpoint-sync.ethpandaops.io https://mainnet-checkpoint-sync.stakely.io + +executionEndpoint: https://neth.sepolia.tooling.chroniclelabs.io + +# can your own eth instance. eg https://goerli.mydomain.com/v..... + +# -- JWT secret used by client as a secret. Change this value. +jwt: 7992bcce239c6dcfeba3305ce928d061d2ba9a515319ca3ad66752d74fa67a60 + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +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: "" + +# -- Liveness probe +livenessProbe: + tcpSocket: + port: http-api + initialDelaySeconds: 60 + periodSeconds: 120 + +# -- Readiness probe +readinessProbe: + tcpSocket: + port: http-api + initialDelaySeconds: 10 + periodSeconds: 10 + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# -- P2P Port +p2pPort: 13000 +# -- HTTP Port +httpPort: 3500 +# -- Metrics Port +metricsPort: 8080 +# -- Metrics Address +metricsAddress: 0.0.0.0 + +# -- Metrics Allow Origin +metricsAllowOrigin: "*" +# -- RPC Port +rpcPort: 4000 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +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: 20Gi + # -- 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: [] diff --git a/charts/nethermind/Chart.yaml b/charts/nethermind/Chart.yaml index 7051f9fc..b5ff0017 100644 --- a/charts/nethermind/Chart.yaml +++ b/charts/nethermind/Chart.yaml @@ -19,7 +19,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.2 +version: 0.0.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/nethermind/README.md b/charts/nethermind/README.md index 8415327e..c1bae526 100644 --- a/charts/nethermind/README.md +++ b/charts/nethermind/README.md @@ -1,6 +1,6 @@ # nethermind -![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) +![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) A Helm chart for deploying ETH Nethermind nodes on Kubernetes @@ -20,7 +20,6 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | data | object | `{"path":"/nethermind-data"}` | Path to store data | -| fastSync | bool | `false` | If true, the node will sync from a fast sync, supported for gnosis | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"nethermind/nethermind"` | | diff --git a/charts/nethermind/templates/statefulset.yaml b/charts/nethermind/templates/statefulset.yaml index 77d0bbdd..23b0ee20 100644 --- a/charts/nethermind/templates/statefulset.yaml +++ b/charts/nethermind/templates/statefulset.yaml @@ -40,6 +40,7 @@ spec: args: - --config={{ .Values.network }} - --datadir={{ .Values.data.path }}/data + - --KeyStore.KeyStoreDirectory={{ .Values.data.path }}/keystore - --log={{ .Values.logLevel }} {{ if .Values.syncMode }} - --Sync.{{ .Values.syncMode }}=true @@ -47,7 +48,6 @@ spec: - --JsonRpc.Enabled=true - --JsonRpc.Host=0.0.0.0 - --JsonRpc.Port={{ .Values.service.ports.httprpc.port | default 8545 }} - - --JsonRpc.EnabledModules=[Web3,Eth,Subscribe,Net,] - --JsonRpc.JwtSecretFile=/jwt.hex - --JsonRpc.EngineHost=0.0.0.0 - --JsonRpc.EnginePort={{ .Values.service.ports.auth.port | default 8551 }} diff --git a/charts/nethermind/values.yaml b/charts/nethermind/values.yaml index 041dad34..018dd88c 100644 --- a/charts/nethermind/values.yaml +++ b/charts/nethermind/values.yaml @@ -20,9 +20,6 @@ logLevel: 'INFO' # -- syncMode can be FastSync, SnapSync syncMode: 'SnapSync' -# -- If true, the node will sync from a fast sync, supported for gnosis -fastSync: false - image: repository: nethermind/nethermind pullPolicy: IfNotPresent From 81729898084ffa4b8815ec5dfa0d2a21357e6082 Mon Sep 17 00:00:00 2001 From: WesleyCharlesBlake Date: Tue, 7 Nov 2023 15:06:29 +0200 Subject: [PATCH 05/11] nethermind and lighthouse updates --- charts/lighthouse/Chart.yaml | 4 ++-- charts/lighthouse/README.md | 8 +++---- charts/lighthouse/values.yaml | 6 +++--- charts/nethermind/Chart.yaml | 2 +- charts/nethermind/README.md | 19 ++++++++++++++++- charts/nethermind/templates/statefulset.yaml | 6 ++++-- charts/nethermind/values.yaml | 22 ++++++++++++++++++++ 7 files changed, 54 insertions(+), 13 deletions(-) diff --git a/charts/lighthouse/Chart.yaml b/charts/lighthouse/Chart.yaml index e2d2e1e1..671c2a31 100644 --- a/charts/lighthouse/Chart.yaml +++ b/charts/lighthouse/Chart.yaml @@ -20,10 +20,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.1 +version: 0.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v4.0.8" +appVersion: "v4.5.0" diff --git a/charts/lighthouse/README.md b/charts/lighthouse/README.md index df7a7569..9f5da885 100644 --- a/charts/lighthouse/README.md +++ b/charts/lighthouse/README.md @@ -1,6 +1,6 @@ # lighthouse -![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) ![AppVersion: v4.0.8](https://img.shields.io/badge/AppVersion-v4.0.8-informational?style=flat-square) +![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.5.0](https://img.shields.io/badge/AppVersion-v4.5.0-informational?style=flat-square) A Helm chart for deploying the Lodestar Consensus Layer / beacon on Kubernetes @@ -21,13 +21,13 @@ A Helm chart for deploying the Lodestar Consensus Layer / beacon on Kubernetes | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | checkpointSyncUrl | string | `"https://sepolia.beaconstate.info"` | | -| executionEndpoint | string | `"https://neth.sepolia.tooling.chroniclelabs.io"` | | +| executionEndpoint | string | `"http://nethermind:8551"` | | | fullnameOverride | string | `""` | | | genesisStateUrl | string | `"https://sepolia.beaconstate.info"` | | | httpPort | int | `3500` | HTTP Port | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"sigp/lighthouse"` | | -| image.tag | string | `"latest"` | | +| image.tag | string | `"v4.5.0-modern"` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -36,7 +36,7 @@ A Helm chart for deploying the Lodestar Consensus Layer / beacon on Kubernetes | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ingress.tls | list | `[]` | | -| jwt | string | `"7992bcce239c6dcfeba3305ce928d061d2ba9a515319ca3ad66752d74fa67a60"` | JWT secret used by client as a secret. Change this value. | +| jwt | string | `"ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a"` | JWT secret used by client as a secret. Change this value. | | livenessProbe | object | `{"initialDelaySeconds":60,"periodSeconds":120,"tcpSocket":{"port":"http-api"}}` | Liveness probe | | metricsAddress | string | `"0.0.0.0"` | Metrics Address | | metricsAllowOrigin | string | `"*"` | Metrics Allow Origin | diff --git a/charts/lighthouse/values.yaml b/charts/lighthouse/values.yaml index df36f59b..91b60003 100644 --- a/charts/lighthouse/values.yaml +++ b/charts/lighthouse/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: sigp/lighthouse pullPolicy: IfNotPresent - tag: "latest" + tag: "v4.5.0-modern" network: sepolia # can be mainnet or sepolia, gnosis etc @@ -18,12 +18,12 @@ checkpointSyncUrl: https://sepolia.beaconstate.info genesisStateUrl: https://sepolia.beaconstate.info # can be https://goerli.checkpoint-sync.ethpandaops.io https://mainnet-checkpoint-sync.stakely.io -executionEndpoint: https://neth.sepolia.tooling.chroniclelabs.io +executionEndpoint: http://nethermind:8551 # can your own eth instance. eg https://goerli.mydomain.com/v..... # -- JWT secret used by client as a secret. Change this value. -jwt: 7992bcce239c6dcfeba3305ce928d061d2ba9a515319ca3ad66752d74fa67a60 +jwt: ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a imagePullSecrets: [] nameOverride: "" diff --git a/charts/nethermind/Chart.yaml b/charts/nethermind/Chart.yaml index b5ff0017..4dfa7cb3 100644 --- a/charts/nethermind/Chart.yaml +++ b/charts/nethermind/Chart.yaml @@ -19,7 +19,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.3 +version: 0.0.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/nethermind/README.md b/charts/nethermind/README.md index c1bae526..cfd3f11d 100644 --- a/charts/nethermind/README.md +++ b/charts/nethermind/README.md @@ -1,6 +1,6 @@ # nethermind -![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) +![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) A Helm chart for deploying ETH Nethermind nodes on Kubernetes @@ -32,6 +32,23 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ingress.tls | list | `[]` | | +| jsonrpc.enabled | bool | `true` | | +| jsonrpc.engine.modules[0] | string | `"Net"` | | +| jsonrpc.engine.modules[1] | string | `"Eth"` | | +| jsonrpc.engine.modules[2] | string | `"Subscribe"` | | +| jsonrpc.engine.modules[3] | string | `"Engine"` | | +| jsonrpc.engine.modules[4] | string | `"Web3"` | | +| jsonrpc.engine.modules[5] | string | `"Client"` | | +| jsonrpc.modules[0] | string | `"Eth"` | | +| jsonrpc.modules[1] | string | `"Subscribe"` | | +| jsonrpc.modules[2] | string | `"Trace"` | | +| jsonrpc.modules[3] | string | `"TxPool"` | | +| jsonrpc.modules[4] | string | `"Web3"` | | +| jsonrpc.modules[5] | string | `"Personal"` | | +| jsonrpc.modules[6] | string | `"Proof"` | | +| jsonrpc.modules[7] | string | `"Net"` | | +| jsonrpc.modules[8] | string | `"Parity"` | | +| jsonrpc.modules[9] | string | `"Health"` | | | jwt | string | `"ecb22bc24e7d4061f7ed690ccd5846d7d73f5d2b9733267e12f56790398d908a"` | JWT secret used by client as a secret. Change this value. | | livenessProbe.initialDelaySeconds | int | `60` | | | livenessProbe.periodSeconds | int | `120` | | diff --git a/charts/nethermind/templates/statefulset.yaml b/charts/nethermind/templates/statefulset.yaml index 23b0ee20..01551c5d 100644 --- a/charts/nethermind/templates/statefulset.yaml +++ b/charts/nethermind/templates/statefulset.yaml @@ -48,9 +48,11 @@ spec: - --JsonRpc.Enabled=true - --JsonRpc.Host=0.0.0.0 - --JsonRpc.Port={{ .Values.service.ports.httprpc.port | default 8545 }} - - --JsonRpc.JwtSecretFile=/jwt.hex + - --JsonRpc.EnabledModules={{ .Values.jsonrpc.modules | join "," }} + - --JsonRpc.JwtSecretFile={{ .Values.data.path }}/jwt.hex - --JsonRpc.EngineHost=0.0.0.0 - --JsonRpc.EnginePort={{ .Values.service.ports.auth.port | default 8551 }} + - --JsonRpc.EngineEnabledModules={{ .Values.jsonrpc.engine.modules | join "," }} - --Network.DiscoveryPort={{ .Values.service.ports.p2ptcp.port | default 30303 }} - --HealthChecks.Enabled=false - --Pruning.CacheMb=2048 @@ -76,7 +78,7 @@ spec: - name: storage mountPath: {{ .Values.data.path }} - name: jwt - mountPath: "/data/jwt.hex" + mountPath: "{{ .Values.data.path }}/jwt.hex" subPath: jwt.hex readOnly: true env: diff --git a/charts/nethermind/values.yaml b/charts/nethermind/values.yaml index 018dd88c..0ba88c11 100644 --- a/charts/nethermind/values.yaml +++ b/charts/nethermind/values.yaml @@ -20,6 +20,28 @@ logLevel: 'INFO' # -- syncMode can be FastSync, SnapSync syncMode: 'SnapSync' +jsonrpc: + enabled: true + modules: + - Eth + - Subscribe + - Trace + - TxPool + - Web3 + - Personal + - Proof + - Net + - Parity + - Health + + engine: + modules: + - Net + - Eth + - Subscribe + - Engine + - Web3 + - Client image: repository: nethermind/nethermind pullPolicy: IfNotPresent From 66a77bf8da2fb09ff42d73a62294b9269412899e Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Thu, 9 Nov 2023 12:37:40 +0200 Subject: [PATCH 06/11] update image to fix deadlock (#101) --- charts/rpc-router/Chart.yaml | 4 ++-- charts/rpc-router/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/rpc-router/Chart.yaml b/charts/rpc-router/Chart.yaml index e27fb6fc..e23ba5c7 100644 --- a/charts/rpc-router/Chart.yaml +++ b/charts/rpc-router/Chart.yaml @@ -21,13 +21,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.5 +version: 0.1.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 0.42.4 +appVersion: 0.43.0 dependencies: - name: redis diff --git a/charts/rpc-router/README.md b/charts/rpc-router/README.md index 2851abba..6974337c 100644 --- a/charts/rpc-router/README.md +++ b/charts/rpc-router/README.md @@ -1,6 +1,6 @@ # rpc-router -![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.42.4](https://img.shields.io/badge/AppVersion-0.42.4-informational?style=flat-square) +![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.43.0](https://img.shields.io/badge/AppVersion-0.43.0-informational?style=flat-square) A Helm chart for deploying Emerald Dshackle - Fault Tolerant Load Balancer for Blockchain API, to Kubernetes, From 19556a96d7ee113ba58593fb1b2f63036fb1d917 Mon Sep 17 00:00:00 2001 From: WesleyCharlesBlake Date: Fri, 10 Nov 2023 11:58:32 +0200 Subject: [PATCH 07/11] allow healthchecks and ui --- charts/nethermind/Chart.yaml | 2 +- charts/nethermind/README.md | 4 +++- charts/nethermind/templates/statefulset.yaml | 5 ++++- charts/nethermind/values.yaml | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/charts/nethermind/Chart.yaml b/charts/nethermind/Chart.yaml index 4dfa7cb3..6abb6adc 100644 --- a/charts/nethermind/Chart.yaml +++ b/charts/nethermind/Chart.yaml @@ -19,7 +19,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.4 +version: 0.0.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/nethermind/README.md b/charts/nethermind/README.md index cfd3f11d..b4eb48c8 100644 --- a/charts/nethermind/README.md +++ b/charts/nethermind/README.md @@ -1,6 +1,6 @@ # nethermind -![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) +![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.21.1](https://img.shields.io/badge/AppVersion-1.21.1-informational?style=flat-square) A Helm chart for deploying ETH Nethermind nodes on Kubernetes @@ -21,6 +21,8 @@ A Helm chart for deploying ETH Nethermind nodes on Kubernetes | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | data | object | `{"path":"/nethermind-data"}` | Path to store data | | fullnameOverride | string | `""` | | +| healthChecks.enabled | bool | `true` | | +| healthChecks.ui.enabled | bool | `true` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"nethermind/nethermind"` | | | image.tag | string | `""` | | diff --git a/charts/nethermind/templates/statefulset.yaml b/charts/nethermind/templates/statefulset.yaml index 01551c5d..2325db67 100644 --- a/charts/nethermind/templates/statefulset.yaml +++ b/charts/nethermind/templates/statefulset.yaml @@ -54,7 +54,10 @@ spec: - --JsonRpc.EnginePort={{ .Values.service.ports.auth.port | default 8551 }} - --JsonRpc.EngineEnabledModules={{ .Values.jsonrpc.engine.modules | join "," }} - --Network.DiscoveryPort={{ .Values.service.ports.p2ptcp.port | default 30303 }} - - --HealthChecks.Enabled=false + - --HealthChecks.Enabled={{ .Values.healthChecks.enabled }} + {{- if .Values.healthChecks.enabled }} + - --HealthChecks.UIEnabled={{ .Values.healthChecks.ui.enabled }} + {{- end }} - --Pruning.CacheMb=2048 {{- if .Values.metrics.enabled }} - --Metrics.Enabled=true diff --git a/charts/nethermind/values.yaml b/charts/nethermind/values.yaml index 0ba88c11..ca3ce7cb 100644 --- a/charts/nethermind/values.yaml +++ b/charts/nethermind/values.yaml @@ -152,6 +152,11 @@ metrics: # -- add node to ethstat ethStats: true +healthChecks: + enabled: true + ui: + enabled: true + serviceMonitor: # -- If true, a ServiceMonitor CRD is created for a prometheus operator # https://github.com/coreos/prometheus-operator From 893058a9486d5df37274b1163605b9d360667e43 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Mon, 13 Nov 2023 08:14:35 +0200 Subject: [PATCH 08/11] [sc-3239] fix Prysm beacon chain persistence (#102) * update image to fix deadlock * [sc-3239]: fix persistence issue --- charts/beacons/Chart.yaml | 4 ++-- charts/beacons/README.md | 2 +- charts/beacons/templates/statefulset.yaml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/beacons/Chart.yaml b/charts/beacons/Chart.yaml index 36afbada..9b939f91 100644 --- a/charts/beacons/Chart.yaml +++ b/charts/beacons/Chart.yaml @@ -20,10 +20,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.8 +version: 0.0.9 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v4.0.8" +appVersion: "v4.1.1" diff --git a/charts/beacons/README.md b/charts/beacons/README.md index 0ea05593..95a0dc71 100644 --- a/charts/beacons/README.md +++ b/charts/beacons/README.md @@ -1,6 +1,6 @@ # beacons -![Version: 0.0.8](https://img.shields.io/badge/Version-0.0.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.0.8](https://img.shields.io/badge/AppVersion-v4.0.8-informational?style=flat-square) +![Version: 0.0.9](https://img.shields.io/badge/Version-0.0.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.1.1](https://img.shields.io/badge/AppVersion-v4.1.1-informational?style=flat-square) A Helm chart for deploying a beacon node to Kubernetes diff --git a/charts/beacons/templates/statefulset.yaml b/charts/beacons/templates/statefulset.yaml index bc4b45a4..333051e5 100644 --- a/charts/beacons/templates/statefulset.yaml +++ b/charts/beacons/templates/statefulset.yaml @@ -42,6 +42,7 @@ spec: {{ end }} - --jwt-secret=/data/jwt.hex - --accept-terms-of-use + - --datadir=/data - --execution-endpoint={{ .Values.executionEndpoint }} - --checkpoint-sync-url={{ .Values.checkpointSyncUrl }} - --genesis-beacon-api-url={{ .Values.genesisBeaconApiUrl }} From 85f60cf96ed4371313c7b330674506421de553c1 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Wed, 13 Dec 2023 12:27:11 +0200 Subject: [PATCH 09/11] bump arbitrum nitro version (#104) --- charts/arbitrum/Chart.yaml | 4 ++-- charts/arbitrum/README.md | 4 ++-- charts/arbitrum/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/arbitrum/Chart.yaml b/charts/arbitrum/Chart.yaml index cc8b1c16..7abf8a5a 100644 --- a/charts/arbitrum/Chart.yaml +++ b/charts/arbitrum/Chart.yaml @@ -21,10 +21,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.4 +version: 0.0.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v2.1.1" +appVersion: "v2.1.3-e815395" diff --git a/charts/arbitrum/README.md b/charts/arbitrum/README.md index bbc19ee9..edfb2bac 100644 --- a/charts/arbitrum/README.md +++ b/charts/arbitrum/README.md @@ -1,6 +1,6 @@ # arbitrum -![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.1.1](https://img.shields.io/badge/AppVersion-v2.1.1-informational?style=flat-square) +![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.1.3-e815395](https://img.shields.io/badge/AppVersion-v2.1.3--e815395-informational?style=flat-square) A Helm chart for deploying Arbitrum Nitro on Kubernetes @@ -24,7 +24,7 @@ A Helm chart for deploying Arbitrum Nitro on Kubernetes | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"offchainlabs/nitro-node"` | | -| image.tag | string | `"v2.1.1-e9d8842"` | | +| image.tag | string | `"v2.1.3-e815395"` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | diff --git a/charts/arbitrum/values.yaml b/charts/arbitrum/values.yaml index 1fdfdb01..905c8064 100644 --- a/charts/arbitrum/values.yaml +++ b/charts/arbitrum/values.yaml @@ -29,7 +29,7 @@ image: repository: offchainlabs/nitro-node pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "v2.1.1-e9d8842" + tag: "v2.1.3-e815395" imagePullSecrets: [] nameOverride: "" From 2553ac2709bc582eb27eb0bef0fa0f9679c9d931 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Fri, 15 Dec 2023 17:23:56 +0200 Subject: [PATCH 10/11] bump dshackle version (#105) --- charts/rpc-router/Chart.yaml | 4 ++-- charts/rpc-router/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/rpc-router/Chart.yaml b/charts/rpc-router/Chart.yaml index e23ba5c7..85a5cbc8 100644 --- a/charts/rpc-router/Chart.yaml +++ b/charts/rpc-router/Chart.yaml @@ -21,13 +21,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.6 +version: 0.1.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 0.43.0 +appVersion: 0.45.1 dependencies: - name: redis diff --git a/charts/rpc-router/README.md b/charts/rpc-router/README.md index 6974337c..61d3b1dc 100644 --- a/charts/rpc-router/README.md +++ b/charts/rpc-router/README.md @@ -1,6 +1,6 @@ # rpc-router -![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.43.0](https://img.shields.io/badge/AppVersion-0.43.0-informational?style=flat-square) +![Version: 0.1.7](https://img.shields.io/badge/Version-0.1.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.45.1](https://img.shields.io/badge/AppVersion-0.45.1-informational?style=flat-square) A Helm chart for deploying Emerald Dshackle - Fault Tolerant Load Balancer for Blockchain API, to Kubernetes, From 3681da2f0c44fa15921e26eb78da5ce3c72a4427 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Wed, 3 Jan 2024 17:42:38 +0200 Subject: [PATCH 11/11] mantle chart (#107) * initial mantle helm chart * fixes snapshot download for mantle --- charts/mantle/.helmignore | 23 ++ charts/mantle/Chart.yaml | 28 +++ charts/mantle/README.md | 154 ++++++++++++ charts/mantle/templates/NOTES.txt | 22 ++ charts/mantle/templates/_helpers.tpl | 62 +++++ charts/mantle/templates/hpa.yaml | 28 +++ charts/mantle/templates/ingress.yaml | 61 +++++ charts/mantle/templates/service.yaml | 21 ++ charts/mantle/templates/serviceaccount.yaml | 12 + charts/mantle/templates/servicemonitor.yaml | 43 ++++ charts/mantle/templates/statefulset.yaml | 112 +++++++++ .../templates/tests/test-connection.yaml | 23 ++ charts/mantle/values-testnet.yaml | 90 +++++++ charts/mantle/values.yaml | 236 ++++++++++++++++++ 14 files changed, 915 insertions(+) create mode 100644 charts/mantle/.helmignore create mode 100644 charts/mantle/Chart.yaml create mode 100644 charts/mantle/README.md create mode 100644 charts/mantle/templates/NOTES.txt create mode 100644 charts/mantle/templates/_helpers.tpl create mode 100644 charts/mantle/templates/hpa.yaml create mode 100644 charts/mantle/templates/ingress.yaml create mode 100644 charts/mantle/templates/service.yaml create mode 100644 charts/mantle/templates/serviceaccount.yaml create mode 100644 charts/mantle/templates/servicemonitor.yaml create mode 100644 charts/mantle/templates/statefulset.yaml create mode 100644 charts/mantle/templates/tests/test-connection.yaml create mode 100644 charts/mantle/values-testnet.yaml create mode 100644 charts/mantle/values.yaml diff --git a/charts/mantle/.helmignore b/charts/mantle/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/mantle/.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/mantle/Chart.yaml b/charts/mantle/Chart.yaml new file mode 100644 index 00000000..190684b9 --- /dev/null +++ b/charts/mantle/Chart.yaml @@ -0,0 +1,28 @@ +apiVersion: v2 +name: mantle +description: A Helm chart for deploying Mantle RPC nodes on Kubernetes + +maintainers: + - name: WesleyCharlesBlake + url: https://github.com/WesleyCharlesBlake + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v0.4.3" diff --git a/charts/mantle/README.md b/charts/mantle/README.md new file mode 100644 index 00000000..80898c6b --- /dev/null +++ b/charts/mantle/README.md @@ -0,0 +1,154 @@ +# mantle + +![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) ![AppVersion: v0.4.3](https://img.shields.io/badge/AppVersion-v0.4.3-informational?style=flat-square) + +A Helm chart for deploying Mantle RPC nodes on Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| WesleyCharlesBlake | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| data | object | `{"path":"/mantle-data"}` | Path to store data | +| env[0].name | string | `"BLOCK_SIGNER_KEY"` | | +| env[0].value | string | `"22c7fa2d2cf5c0ccc21ff32a210d7dfea7bbc7d16c3ba0a75302a7b51c16c4f7"` | | +| env[10].name | string | `"NO_USB"` | | +| env[10].value | bool | `true` | | +| env[11].name | string | `"NO_DISCOVER"` | | +| env[11].value | bool | `true` | | +| env[12].name | string | `"ROLLUP_TIMESTAMP_REFRESH"` | | +| env[12].value | string | `"5s"` | | +| env[13].name | string | `"ROLLUP_STATE_DUMP_PATH"` | | +| env[13].value | string | `"https://mantlenetworkio.github.io/networks/mainnet/genesis.json"` | | +| env[14].name | string | `"ROLLUP_CLIENT_HTTP"` | | +| env[14].value | string | `"https://dtl.mantle.xyz"` | | +| env[15].name | string | `"ROLLUP_ENFORCE_FEES"` | | +| env[15].value | bool | `true` | | +| env[16].name | string | `"ROLLUP_FEE_THRESHOLD_DOWN"` | | +| env[16].value | int | `1` | | +| env[17].name | string | `"ROLLUP_FEE_THRESHOLD_UP"` | | +| env[17].value | int | `4000` | | +| env[18].name | string | `"RETRIES"` | | +| env[18].value | int | `60` | | +| env[19].name | string | `"ROLLUP_POLL_INTERVAL_FLAG"` | | +| env[19].value | string | `"500ms"` | | +| env[1].name | string | `"BLOCK_SIGNER_ADDRESS"` | | +| env[1].value | string | `"0xa9eC80835800a59Fd022f53e3E75AA4552F22ccB"` | | +| env[20].name | string | `"ROLLUP_ENABLE_L2_GAS_POLLING"` | | +| env[20].value | bool | `true` | | +| env[21].name | string | `"ROLLUP_BACKEND"` | | +| env[21].value | string | `"l2"` | | +| env[22].name | string | `"ROLLUP_VERIFIER_ENABLE"` | | +| env[22].value | bool | `true` | | +| env[23].name | string | `"RPC_ENABLE"` | | +| env[23].value | bool | `true` | | +| env[24].name | string | `"RPC_ADDR"` | | +| env[24].value | string | `"0.0.0.0"` | | +| env[25].name | string | `"RPC_PORT"` | | +| env[25].value | int | `8545` | | +| env[26].name | string | `"RPC_API"` | | +| env[26].value | string | `"eth,net,rollup,web3"` | | +| env[27].name | string | `"RPC_CORS_DOMAIN"` | | +| env[27].value | string | `"*"` | | +| env[28].name | string | `"RPC_VHOSTS"` | | +| env[28].value | string | `"*"` | | +| env[29].name | string | `"SEQUENCER_CLIENT_HTTP"` | | +| env[29].value | string | `"https://rpc.mantle.xyz"` | | +| env[2].name | string | `"CHAIN_ID"` | | +| env[2].value | int | `5000` | | +| env[30].name | string | `"TARGET_GAS_LIMIT"` | | +| env[30].value | int | `30000000` | | +| env[31].name | string | `"WS"` | | +| env[31].value | bool | `true` | | +| env[32].name | string | `"WS_ADDR"` | | +| env[32].value | string | `"0.0.0.0"` | | +| env[33].name | string | `"WS_PORT"` | | +| env[33].value | int | `8546` | | +| env[34].name | string | `"WS_API"` | | +| env[34].value | string | `"eth,net,rollup,web3"` | | +| env[35].name | string | `"WS_ORIGINS"` | | +| env[35].value | string | `"*"` | | +| env[36].name | string | `"USING_BVM"` | | +| env[36].value | bool | `true` | | +| env[37].name | string | `"VERBOSITY"` | | +| env[37].value | int | `3` | | +| env[3].name | string | `"ETH1_SYNC_SERVICE_ENABLE"` | | +| env[3].value | bool | `true` | | +| env[4].name | string | `"ETH1_CONFIRMATION_DEPTH"` | | +| env[4].value | string | `"0"` | | +| env[5].name | string | `"ETH1_CTC_DEPLOYMENT_HEIGHT"` | | +| env[5].value | string | `"17577586"` | | +| env[6].name | string | `"GASPRICE"` | | +| env[6].value | string | `"0"` | | +| env[7].name | string | `"GCMODE"` | | +| env[7].value | string | `"archive"` | | +| env[8].name | string | `"IPC_DISABLE"` | | +| env[8].value | bool | `true` | | +| env[9].name | string | `"NETWORK_ID"` | | +| env[9].value | int | `5000` | | +| ethL1 | string | `"https://rpc.ankr.com/eth"` | ETH l1 node | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"mantlenetworkio/l2geth"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| livenessProbe.initialDelaySeconds | int | `60` | | +| livenessProbe.periodSeconds | int | `120` | | +| livenessProbe.tcpSocket.port | string | `"httprpc"` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| 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 | `"20Gi"` | 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 | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `10` | | +| readinessProbe.tcpSocket.port | string | `"httprpc"` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.ports.httprpc.port | int | `8545` | | +| service.ports.httprpc.protocol | string | `"TCP"` | | +| service.ports.wsrpc.port | int | `8546` | | +| service.ports.wsrpc.protocol | string | `"TCP"` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| 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 | `"/debug/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 | +| snapShotSync | object | `{"enabled":false,"snapShotUrl":"https://s3.ap-southeast-1.amazonaws.com/snapshot.mantle.xyz","tarballName":"20231119-mainnet-chaindata.tar"}` | Download from snapshot. will run snapshot sync before starting node in an initContainer. | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/mantle/templates/NOTES.txt b/charts/mantle/templates/NOTES.txt new file mode 100644 index 00000000..acf87c31 --- /dev/null +++ b/charts/mantle/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "mantle.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "mantle.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mantle.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mantle.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/mantle/templates/_helpers.tpl b/charts/mantle/templates/_helpers.tpl new file mode 100644 index 00000000..cb4e2f13 --- /dev/null +++ b/charts/mantle/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "mantle.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 "mantle.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 "mantle.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "mantle.labels" -}} +helm.sh/chart: {{ include "mantle.chart" . }} +{{ include "mantle.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mantle.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mantle.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "mantle.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "mantle.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/mantle/templates/hpa.yaml b/charts/mantle/templates/hpa.yaml new file mode 100644 index 00000000..b5c7a448 --- /dev/null +++ b/charts/mantle/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "mantle.fullname" . }} + labels: + {{- include "mantle.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "mantle.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/mantle/templates/ingress.yaml b/charts/mantle/templates/ingress.yaml new file mode 100644 index 00000000..b216581d --- /dev/null +++ b/charts/mantle/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "mantle.fullname" . -}} +{{- $svcPort := .Values.service.ports.httprpc.port -}} +{{- 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 "mantle.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/mantle/templates/service.yaml b/charts/mantle/templates/service.yaml new file mode 100644 index 00000000..f429426b --- /dev/null +++ b/charts/mantle/templates/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mantle.fullname" . }} + annotations: + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "mantle.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + {{- range $key, $val := .Values.service.ports }} + - port: {{ $val.port }} + targetPort: {{ $val.port }} + protocol: {{ $val.protocol }} + name: {{ $key }} + {{- end }} + selector: + {{- include "mantle.selectorLabels" . | nindent 4 }} diff --git a/charts/mantle/templates/serviceaccount.yaml b/charts/mantle/templates/serviceaccount.yaml new file mode 100644 index 00000000..3a37a7eb --- /dev/null +++ b/charts/mantle/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "mantle.serviceAccountName" . }} + labels: + {{- include "mantle.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/mantle/templates/servicemonitor.yaml b/charts/mantle/templates/servicemonitor.yaml new file mode 100644 index 00000000..85ab95a7 --- /dev/null +++ b/charts/mantle/templates/servicemonitor.yaml @@ -0,0 +1,43 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "mantle.serviceAccountName" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} + labels: + {{- include "mantle.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 "mantle.selectorLabels" . | nindent 8 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/charts/mantle/templates/statefulset.yaml b/charts/mantle/templates/statefulset.yaml new file mode 100644 index 00000000..c6daf86b --- /dev/null +++ b/charts/mantle/templates/statefulset.yaml @@ -0,0 +1,112 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "mantle.fullname" . }} + labels: + {{- include "mantle.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "mantle.selectorLabels" . | nindent 6 }} + serviceName: {{ include "mantle.fullname" . }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "mantle.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "mantle.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.snapShotSync.enabled }} + initContainers: + - name: init-download-snapshot + image: alpine:latest + command: ["/bin/sh", "-c"] + args: + - > + wget {{ .Values.snapShotSync.snapShotUrl}}/{{ .Values.snapShotSync.tarballName}} && + tar xf {{ .Values.snapShotSync.tarballName}} -C {{ .Values.data.path}} + volumeMounts: + - name: storage + mountPath: {{ .Values.data.path}} + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + resources: + {{- toYaml .Values.resources | nindent 12 }} + # command: + # - sh ./geth.sh + args: + {{- if .Values.args }} + {{- toYaml .Values.args | nindent 12 }} + {{- end }} + ports: + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val.port }} + protocol: {{ $val.protocol }} + {{- end }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + volumeMounts: + - name: storage + mountPath: {{ .Values.data.path }} + env: + - name: DATADIR + value: "{{ .Values.data.path }}" + - name: ETH1_HTTP + value: "{{ .Values.ethL1 }}" + {{- if .Values.env }} + {{- toYaml .Values.env | nindent 12 }} + {{- end }} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 8 }} + affinity: + {{- toYaml .Values.affinity | nindent 8 }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + volumes: + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | nindent 8}} + {{- end }} + {{- if not .Values.persistence.enabled }} + - name: storage + emptyDir: {} + {{- else if .Values.persistence.existingClaim }} + - name: storage + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + {{- else }} + volumeClaimTemplates: + - metadata: + name: storage + annotations: + {{- toYaml .Values.persistence.annotations | nindent 8 }} + spec: + accessModes: + {{- toYaml .Values.persistence.accessModes | nindent 8 }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- if .Values.persistence.selector }} + selector: + {{- toYaml .Values.persistence.selector | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/mantle/templates/tests/test-connection.yaml b/charts/mantle/templates/tests/test-connection.yaml new file mode 100644 index 00000000..9715f7ce --- /dev/null +++ b/charts/mantle/templates/tests/test-connection.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "mantle.fullname" . }}-test-connection" + labels: + {{- include "mantle.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: curlimages/curl + command: ['curl'] + args: + - --location + - --request + - POST + - '{{ include "mantle.fullname" . }}:{{ .Values.service.ports.httprpc.port }}/' + - --header + - 'Content-Type: application/json' + - --data-raw + - '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' + restartPolicy: Never diff --git a/charts/mantle/values-testnet.yaml b/charts/mantle/values-testnet.yaml new file mode 100644 index 00000000..e1d09667 --- /dev/null +++ b/charts/mantle/values-testnet.yaml @@ -0,0 +1,90 @@ +# Default values for mantle. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +# -- Download from snapshot. will run snapshot sync before starting node in an initContainer. +snapShotSync: + enabled: true + snapShotUrl: 'https://s3.ap-southeast-1.amazonaws.com/static.testnet.mantle.xyz' + tarballName: '20231119-testnet-chaindata.tar' + +# -- Path to store data +data: + path: "/mantle-data" + +ethL1: "https://rpc.ankr.com/eth_goerli" +env: + - name: ETH1_CTC_DEPLOYMENT_HEIGHT + value: "8" + - name: ETH1_SYNC_SERVICE_ENABLE + value: "true" + - name: ETH1_CONFIRMATION_DEPTH + value: "0" + - name: ROLLUP_CLIENT_HTTP + value: "https://dtl-tob.testnet.mantle.xyz" + - name: ROLLUP_POLL_INTERVAL_FLAG + value: 500ms + - name: ROLLUP_ENABLE_L2_GAS_POLLING + value: "true" + - name: ROLLUP_FEE_THRESHOLD_DOWN + value: "1" + - name: ROLLUP_FEE_THRESHOLD_UP + value: "4000" + - name: RPC_ENABLE + value: "true" + - name: RPC_ADDR + value: "0.0.0.0" + - name: RPC_PORT + value: "8545" + - name: RPC_API + value: "eth,net,rollup,web3,debug" + - name: RPC_CORS_DOMAIN + value: "*" + - name: RPC_VHOSTS + value: "*" + - name: WS + value: "true" + - name: WS_ADDR + value: "0.0.0.0" + - name: WS_PORT + value: "8546" + - name: WS_API + value: "eth,net,rollup,web3" + - name: WS_ORIGINS + value: "*" + - name: CHAIN_ID + value: "5001" + - name: GASPRICE + value: "0" + - name: GCMODE + value: "archive" + - name: IPC_DISABLE + value: "true" + - name: NETWORK_ID + value: "5001" + - name: NO_USB + value: "true" + - name: NO_DISCOVER + value: "true" + - name: TARGET_GAS_LIMIT + value: "30000000" + - name: USING_BVM + value: "true" + - name: BLOCK_SIGNER_KEY + value: "22c7fa2d2cf5c0ccc21ff32a210d7dfea7bbc7d16c3ba0a75302a7b51c16c4f7" + - name: BLOCK_SIGNER_ADDRESS + value: "0xa9eC80835800a59Fd022f53e3E75AA4552F22ccB" + - name: L2_BLOCK_GAS_LIMIT + value: "15000000" + - name: SEQUENCER_CLIENT_HTTP + value: "https://rpc.testnet.mantle.xyz" + - name: ROLLUP_STATE_DUMP_PATH + value: "https://mantlenetworkio.github.io/networks/goerli/genesis.json" + - name: ROLLUP_BACKEND + value: 'l2' + - name: RETRIES + value: '60' + - name: ROLLUP_VERIFIER_ENABLE + value: 'true' diff --git a/charts/mantle/values.yaml b/charts/mantle/values.yaml new file mode 100644 index 00000000..32606f43 --- /dev/null +++ b/charts/mantle/values.yaml @@ -0,0 +1,236 @@ +# Default values for mantle. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +# -- Download from snapshot. will run snapshot sync before starting node in an initContainer. +snapShotSync: + enabled: false + snapShotUrl: 'https://s3.ap-southeast-1.amazonaws.com/snapshot.mantle.xyz' + tarballName: '20231119-mainnet-chaindata.tar' + +# -- Path to store data +data: + path: /mantle-data + +# -- ETH l1 node +ethL1: "https://rpc.ankr.com/eth" +env: + - name: BLOCK_SIGNER_KEY + value: "22c7fa2d2cf5c0ccc21ff32a210d7dfea7bbc7d16c3ba0a75302a7b51c16c4f7" + - name: BLOCK_SIGNER_ADDRESS + value: "0xa9eC80835800a59Fd022f53e3E75AA4552F22ccB" + - name: CHAIN_ID + value: 5000 + - name: ETH1_SYNC_SERVICE_ENABLE + value: true + - name: ETH1_CONFIRMATION_DEPTH + value: "0" + - name: ETH1_CTC_DEPLOYMENT_HEIGHT + value: "17577586" + - name: GASPRICE + value: "0" + - name: GCMODE + value: "archive" + - name: IPC_DISABLE + value: true + - name: NETWORK_ID + value: 5000 + - name: NO_USB + value: true + - name: NO_DISCOVER + value: true + - name: ROLLUP_TIMESTAMP_REFRESH + value: "5s" + - name: ROLLUP_STATE_DUMP_PATH + value: "https://mantlenetworkio.github.io/networks/mainnet/genesis.json" + - name: ROLLUP_CLIENT_HTTP + value: "https://dtl.mantle.xyz" + - name: ROLLUP_ENFORCE_FEES + value: true + - name: ROLLUP_FEE_THRESHOLD_DOWN + value: 1 + - name: ROLLUP_FEE_THRESHOLD_UP + value: 4000 + - name: RETRIES + value: 60 + - name: ROLLUP_POLL_INTERVAL_FLAG + value: "500ms" + - name: ROLLUP_ENABLE_L2_GAS_POLLING + value: true + - name: ROLLUP_BACKEND + value: "l2" + - name: ROLLUP_VERIFIER_ENABLE + value: true + - name: RPC_ENABLE + value: true + - name: RPC_ADDR + value: "0.0.0.0" + - name: RPC_PORT + value: 8545 + - name: RPC_API + value: "eth,net,rollup,web3" + - name: RPC_CORS_DOMAIN + value: "*" + - name: RPC_VHOSTS + value: "*" + - name: SEQUENCER_CLIENT_HTTP + value: "https://rpc.mantle.xyz" + - name: TARGET_GAS_LIMIT + value: 30000000 + - name: WS + value: true + - name: WS_ADDR + value: "0.0.0.0" + - name: WS_PORT + value: 8546 + - name: WS_API + value: "eth,net,rollup,web3" + - name: WS_ORIGINS + value: "*" + - name: USING_BVM + value: true + - name: VERBOSITY + value: 3 + +image: + repository: mantlenetworkio/l2geth + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +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: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + ports: + httprpc: + port: 8545 + protocol: TCP + wsrpc: + port: 8546 + protocol: TCP + + +# @default -- See `values.yaml` +livenessProbe: + tcpSocket: + port: httprpc + initialDelaySeconds: 60 + periodSeconds: 120 + +# @default -- See `values.yaml` +readinessProbe: + tcpSocket: + port: httprpc + initialDelaySeconds: 10 + periodSeconds: 10 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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: 20Gi + # -- 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: /debug/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: [] + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] +affinity: {}