Skip to content

Commit 860c5d3

Browse files
feat: extend erigon and nimbus with more customizations (#416)
Signed-off-by: Carlos Jorge <carlos@graphops.xyz> --------- Signed-off-by: Carlos Jorge <carlos@graphops.xyz>
1 parent 33d7887 commit 860c5d3

File tree

10 files changed

+144
-6
lines changed

10 files changed

+144
-6
lines changed

charts/erigon/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.10.9
18+
version: 0.10.10
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/erigon/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Deploy and scale [Erigon](https://github.com/ledgerwatch/erigon) inside Kubernetes with ease
44

5-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.10.9](https://img.shields.io/badge/Version-0.10.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.60.10](https://img.shields.io/badge/AppVersion-v2.60.10-informational?style=flat-square)
5+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.10.10](https://img.shields.io/badge/Version-0.10.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.60.10](https://img.shields.io/badge/AppVersion-v2.60.10-informational?style=flat-square)
66

77
## Features
88

@@ -161,12 +161,15 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
161161
| statefulNode.affinity | | object | `{}` |
162162
| statefulNode.affinityPresets.antiAffinityByHostname | Configure anti-affinity rules to prevent multiple Erigon instances on the same host | bool | `true` |
163163
| statefulNode.extraArgs | Additional CLI arguments to pass to `erigon` | list | `[]` |
164+
| statefulNode.extraContainers | Additional containers to inject to this graph node group - an array of Container objects | list | `[]` |
165+
| statefulNode.extraInitContainers | Additional init containers to inject to this graph node group - an array of Container objects | list | `[]` |
164166
| statefulNode.extraLabels | Extra labels to attach to the Pod for matching against | object | `{}` |
165167
| statefulNode.jwt | JWT for clients to authenticate with the Engine API. Specify either `existingSecret` OR `fromLiteral`. | object | `{"existingSecret":{"key":null,"name":null},"fromLiteral":null}` |
166168
| statefulNode.jwt.existingSecret | Load the JWT from an existing Kubernetes Secret. Takes precedence over `fromLiteral` if set. | object | `{"key":null,"name":null}` |
167169
| statefulNode.jwt.existingSecret.key | Data key for the JWT in the Secret | string | `nil` |
168170
| statefulNode.jwt.existingSecret.name | Name of the Secret resource in the same namespace | string | `nil` |
169171
| statefulNode.jwt.fromLiteral | Use this literal value for the JWT | string | `nil` |
172+
| statefulNode.livenessProbe | Sets a livenessProbe configuration for the container | object | `{}` |
170173
| statefulNode.nodeSelector | | object | `{}` |
171174
| statefulNode.p2pNodePort.enabled | Expose P2P port via NodePort | bool | `false` |
172175
| statefulNode.p2pNodePort.initContainer.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
@@ -175,18 +178,24 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
175178
| statefulNode.p2pNodePort.port | NodePort to be used. Must be unique. | int | `31000` |
176179
| statefulNode.podAnnotations | Annotations for the `Pod` | object | `{}` |
177180
| statefulNode.podSecurityContext | Pod-wide security context | object | `{"fsGroup":101337,"runAsGroup":101337,"runAsNonRoot":true,"runAsUser":101337}` |
181+
| statefulNode.readinessProbe | Sets a readinessProbe configuration for the container | object | `{}` |
178182
| statefulNode.resources | | object | `{}` |
179183
| statefulNode.restoreSnapshot.enabled | Enable initialising Erigon state from a remote snapshot | bool | `false` |
180184
| statefulNode.restoreSnapshot.snapshotUrl | URL for snapshot to download and extract to restore state | string | `""` |
185+
| statefulNode.rollingUpdatePartition | When using a RollingUpdate update strategy in the StatefulSet, sets a partition index to only update PODs with that index or higher | int | `0` |
181186
| statefulNode.service.ports.grpc-erigon | Service Port to expose Erigon GRPC interface on | int | `9090` |
182187
| statefulNode.service.ports.http-engineapi | Service Port to expose engineAPI interface on | int | `8551` |
183188
| statefulNode.service.ports.http-jsonrpc | Service Port to expose JSON-RPC interface on | int | `8545` |
184189
| statefulNode.service.ports.http-metrics | Service Port to expose Prometheus metrics on | int | `6060` |
185190
| statefulNode.service.ports.ws-rpc | Service Port to expose WS-RPC interface on | int | `8546` |
186-
| statefulNode.service.topologyAwareRouting.enabled | | bool | `false` |
191+
| statefulNode.service.publishNotReadyAddresses.headless | Toggle publishing not ready addresses for headless service | bool | `false` |
192+
| statefulNode.service.publishNotReadyAddresses.p2p | Toggle publishing not ready addresses for p2p service | bool | `false` |
193+
| statefulNode.service.topologyAwareRouting.enabled | Toggle for topology aware routing | bool | `false` |
187194
| statefulNode.service.type | | string | `"ClusterIP"` |
195+
| statefulNode.startupProbe | Sets a startupProbe configuration for the container | object | `{}` |
188196
| statefulNode.terminationGracePeriodSeconds | Amount of time to wait before force-killing the Erigon process | int | `60` |
189197
| statefulNode.tolerations | | list | `[]` |
198+
| statefulNode.updateStrategyType | Choice of StatefulSet updateStrategy (OnDelete|RollingUpdate) | string | `"RollingUpdate"` |
190199
| statefulNode.volumeClaimSpec | [PersistentVolumeClaimSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#persistentvolumeclaimspec-v1-core) for Erigon storage | object | `{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"3Ti"}},"storageClassName":null}` |
191200
| statefulNode.volumeClaimSpec.resources.requests.storage | The amount of disk space to provision for Erigon | string | `"3Ti"` |
192201
| statefulNode.volumeClaimSpec.storageClassName | The storage class to use when provisioning a persistent volume for Erigon | string | `nil` |

charts/erigon/templates/stateful-node/service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ metadata:
1010
{{- $componentLabel | nindent 4 }}
1111
spec:
1212
clusterIP: None # Headless service
13+
publishNotReadyAddresses: {{ default false $values.service.publishNotReadyAddresses.headless }}
1314
ports:
1415
{{- range $portName, $portNumber := $values.service.ports }}
1516
- port: {{ $portNumber }} # the port we expose on the Service, user configurable
@@ -64,6 +65,7 @@ metadata:
6465
spec:
6566
type: NodePort
6667
externalTrafficPolicy: Local
68+
publishNotReadyAddresses: {{ default false $values.service.publishNotReadyAddresses.p2p }}
6769
ports:
6870
- name: tcp-p2p
6971
port: {{ include "erigon.p2pPort" $values }}

charts/erigon/templates/stateful-node/statefulset.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ spec:
2525
name: storage
2626
spec:
2727
{{- toYaml $values.volumeClaimSpec | nindent 8 }}
28+
{{- if eq $values.updateStrategyType "OnDelete" }}
29+
updateStrategy:
30+
type: OnDelete
31+
{{- else if eq $values.updateStrategyType "RollingUpdate" }}
32+
updateStrategy:
33+
type: RollingUpdate
34+
rollingUpdate:
35+
partition: {{ default 0 ($values.rollingUpdatePartition | quote | atoi) }}
36+
{{- end }}
2837
template:
2938
metadata:
3039
{{- with $values.podAnnotations }}
@@ -162,6 +171,9 @@ spec:
162171
- name: env-nodeport
163172
mountPath: /env
164173
{{- end }}
174+
{{- with $values.extraInitContainers }}
175+
{{- toYaml . | nindent 8 }}
176+
{{- end }}
165177
containers:
166178
- name: {{ $componentName }}
167179
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -243,16 +255,32 @@ spec:
243255
mountPath: /storage
244256
- name: tmp
245257
mountPath: /tmp
258+
{{- if $values.readinessProbe }}
259+
readinessProbe:
260+
{{ toYaml $values.readinessProbe | nindent 12 }}
261+
{{- else }}
246262
readinessProbe:
247263
# This currently requires GRPCContainerProbe feature gate to be enabled on the kubelet
248264
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-grpc-liveness-probe
249265
# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
250266
grpc:
251267
port: 9090 # named ports not supported yet by grpc probes
268+
{{- end }}
269+
{{- if $values.livenessProbe }}
270+
livenessProbe:
271+
{{ toYaml $values.livenessProbe | nindent 12 }}
272+
{{- end }}
273+
{{- if $values.startupProbe }}
274+
startupProbe:
275+
{{ toYaml $values.startupProbe | nindent 12 }}
276+
{{- end }}
252277
{{- with $values.resources }}
253278
resources:
254279
{{- toYaml . | nindent 12 }}
255280
{{- end }}
281+
{{- with $values.extraContainers }}
282+
{{- toYaml . | nindent 8 }}
283+
{{- end }}
256284
{{- with $values.nodeSelector }}
257285
nodeSelector:
258286
{{- toYaml . | nindent 8 }}

charts/erigon/values.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ statefulNode:
107107
# -- Amount of time to wait before force-killing the Erigon process
108108
terminationGracePeriodSeconds: 60
109109

110+
# -- Choice of StatefulSet updateStrategy (OnDelete|RollingUpdate)
111+
updateStrategyType: RollingUpdate
112+
113+
# -- When using a RollingUpdate update strategy in the StatefulSet, sets a partition index to only update PODs with that index or higher
114+
rollingUpdatePartition: 0
115+
116+
# Probes configuration for the containers in the StatefulSet
117+
# Users can directly define readiness, liveness, and startup probes below.
118+
# These will be directly copied into the StatefulSet manifest.
119+
120+
# -- Sets a readinessProbe configuration for the container
121+
readinessProbe: {}
122+
123+
# -- Sets a livenessProbe configuration for the container
124+
livenessProbe: {}
125+
126+
# -- Sets a startupProbe configuration for the container
127+
startupProbe: {}
128+
110129
# -- Annotations for the `Pod`
111130
podAnnotations: {}
112131

@@ -119,7 +138,13 @@ statefulNode:
119138

120139
service:
121140
topologyAwareRouting:
141+
# -- Toggle for topology aware routing
122142
enabled: false
143+
publishNotReadyAddresses:
144+
# -- Toggle publishing not ready addresses for headless service
145+
headless: false
146+
# -- Toggle publishing not ready addresses for p2p service
147+
p2p: false
123148
type: ClusterIP
124149
ports:
125150
# Valid keys are names of ports that are exposed by the Pod that (see templates/stateful-node/statefulset.yaml)
@@ -172,6 +197,11 @@ statefulNode:
172197
# -- Container pull policy
173198
pullPolicy: IfNotPresent
174199

200+
# -- Additional init containers to inject to this graph node group - an array of Container objects
201+
extraInitContainers: []
202+
# -- Additional containers to inject to this graph node group - an array of Container objects
203+
extraContainers: []
204+
175205
rpcdaemon:
176206
# -- Enable a Deployment of rpcdaemon that can be scaled independently
177207
enabled: true

charts/nimbus/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.5.19
18+
version: 0.5.20
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/nimbus/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Deploy and scale [Nimbus](https://github.com/status-im/nimbus-eth2) inside Kubernetes with ease
44

5-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.5.19](https://img.shields.io/badge/Version-0.5.19-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: multiarch-v24.10.0](https://img.shields.io/badge/AppVersion-multiarch--v24.10.0-informational?style=flat-square)
5+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.5.20](https://img.shields.io/badge/Version-0.5.20-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: multiarch-v24.10.0](https://img.shields.io/badge/AppVersion-multiarch--v24.10.0-informational?style=flat-square)
66

77
## Chart Features
88

@@ -109,6 +109,8 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
109109
| nimbus.affinityPresets.antiAffinityByHostname | Configure anti-affinity rules to prevent multiple instances on the same host | bool | `true` |
110110
| nimbus.executionClientUrl | URL to the Execution Client Engine API. Will use configured JWT to authenticate. | string | `""` |
111111
| nimbus.extraArgs | Additional CLI arguments | list | `[]` |
112+
| nimbus.extraContainers | Additional containers to inject to this graph node group - an array of Container objects | list | `[]` |
113+
| nimbus.extraInitContainers | Additional init containers to inject to this graph node group - an array of Container objects | list | `[]` |
112114
| nimbus.extraLabels | Extra labels to attach to the Pod for matching against | object | `{}` |
113115
| nimbus.initChownData.enabled | Init container to set the correct permissions to access data directories | bool | `true` |
114116
| nimbus.initChownData.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
@@ -119,6 +121,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
119121
| nimbus.jwt.existingSecret.key | Data key for the JWT in the Secret | string | `""` |
120122
| nimbus.jwt.existingSecret.name | Name of the Secret resource in the same namespace | string | `""` |
121123
| nimbus.jwt.fromLiteral | Use this literal value for the JWT | string | `""` |
124+
| nimbus.livenessProbe | Sets a livenessProbe configuration for the container | object | `{}` |
122125
| nimbus.nodeSelector | | object | `{}` |
123126
| nimbus.p2pNodePort.enabled | Expose P2P port via NodePort | bool | `false` |
124127
| nimbus.p2pNodePort.initContainer.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
@@ -127,16 +130,22 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
127130
| nimbus.p2pNodePort.port | NodePort to be used. Must be unique. | int | `31000` |
128131
| nimbus.podAnnotations | Annotations for the `Pod` | object | `{}` |
129132
| nimbus.podSecurityContext | Pod-wide security context | object | `{"fsGroup":101337,"runAsGroup":101337,"runAsNonRoot":true,"runAsUser":101337}` |
133+
| nimbus.readinessProbe | Sets a readinessProbe configuration for the container | object | `{}` |
130134
| nimbus.resources | | object | `{}` |
135+
| nimbus.rollingUpdatePartition | When using a RollingUpdate update strategy in the StatefulSet, sets a partition index to only update PODs with that index or higher | int | `0` |
131136
| nimbus.service.ports.http-metrics | Service Port to expose Prometheus metrics on | int | `8008` |
132137
| nimbus.service.ports.http-nimbus | Service Port to expose JSON-RPC interface on | int | `5052` |
133-
| nimbus.service.topologyAwareRouting.enabled | | bool | `false` |
138+
| nimbus.service.publishNotReadyAddresses.headless | Toggle publishing not ready addresses for headless service | bool | `false` |
139+
| nimbus.service.publishNotReadyAddresses.p2p | Toggle publishing not ready addresses for p2p service | bool | `false` |
140+
| nimbus.service.topologyAwareRouting.enabled | Toggle for topology aware routing | bool | `false` |
134141
| nimbus.service.type | | string | `"ClusterIP"` |
142+
| nimbus.startupProbe | Sets a startupProbe configuration for the container | object | `{}` |
135143
| nimbus.terminationGracePeriodSeconds | Amount of time to wait before force-killing the container | int | `60` |
136144
| nimbus.tolerations | | list | `[]` |
137145
| nimbus.trustedNodeSync.enabled | Enable init container to do a trusted checkpoint sync from another Consensus Client (be careful) | bool | `false` |
138146
| nimbus.trustedNodeSync.extraArgs | Additional CLI arguments | list | `[]` |
139147
| nimbus.trustedNodeSync.trustedNodeUrl | URL to the Trusted Consensus Client Node URL. See https://eth-clients.github.io/checkpoint-sync-endpoints/ | string | `""` |
148+
| nimbus.updateStrategyType | Choice of StatefulSet updateStrategy (OnDelete|RollingUpdate) | string | `"RollingUpdate"` |
140149
| nimbus.volumeClaimSpec | [PersistentVolumeClaimSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#persistentvolumeclaimspec-v1-core) for storage | object | `{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"300Gi"}},"storageClassName":null}` |
141150
| nimbus.volumeClaimSpec.resources.requests.storage | The amount of disk space to provision | string | `"300Gi"` |
142151
| nimbus.volumeClaimSpec.storageClassName | The storage class to use when provisioning a persistent volume | string | `nil` |

charts/nimbus/templates/nimbus/service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ metadata:
1010
{{- $componentLabel | nindent 4 }}
1111
spec:
1212
clusterIP: None # Headless service
13+
publishNotReadyAddresses: {{ default false $values.service.publishNotReadyAddresses.headless }}
1314
ports:
1415
{{- range $portName, $portNumber := $values.service.ports }}
1516
- port: {{ $portNumber }} # the port we expose on the Service, user configurable
@@ -64,6 +65,7 @@ metadata:
6465
spec:
6566
type: NodePort
6667
externalTrafficPolicy: Local
68+
publishNotReadyAddresses: {{ default false $values.service.publishNotReadyAddresses.p2p }}
6769
ports:
6870
- name: tcp-p2p
6971
port: {{ include "nimbus.p2pPort" $values }}

charts/nimbus/templates/nimbus/statefulset.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ spec:
2525
name: storage
2626
spec:
2727
{{- toYaml $values.volumeClaimSpec | nindent 8 }}
28+
{{- if eq $values.updateStrategyType "OnDelete" }}
29+
updateStrategy:
30+
type: OnDelete
31+
{{- else if eq $values.updateStrategyType "RollingUpdate" }}
32+
updateStrategy:
33+
type: RollingUpdate
34+
rollingUpdate:
35+
partition: {{ default 0 ($values.rollingUpdatePartition | quote | atoi) }}
36+
{{- end }}
2837
template:
2938
metadata:
3039
{{- with $values.podAnnotations }}
@@ -176,6 +185,9 @@ spec:
176185
- name: tmp
177186
mountPath: /tmp
178187
{{- end }}
188+
{{- with $values.extraInitContainers }}
189+
{{- toYaml . | nindent 8 }}
190+
{{- end }}
179191
containers:
180192
- name: {{ $componentName }}
181193
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -244,15 +256,31 @@ spec:
244256
mountPath: /storage
245257
- name: tmp
246258
mountPath: /tmp
259+
{{- if $values.readinessProbe }}
260+
readinessProbe:
261+
{{ toYaml $values.readinessProbe | nindent 12 }}
262+
{{- else }}
247263
readinessProbe:
248264
tcpSocket:
249265
port: http-nimbus
250266
initialDelaySeconds: 10
251267
periodSeconds: 10
268+
{{- end }}
269+
{{- if $values.livenessProbe }}
270+
livenessProbe:
271+
{{ toYaml $values.livenessProbe | nindent 12 }}
272+
{{- end }}
273+
{{- if $values.startupProbe }}
274+
startupProbe:
275+
{{ toYaml $values.startupProbe | nindent 12 }}
276+
{{- end }}
252277
{{- with $values.resources }}
253278
resources:
254279
{{- toYaml . | nindent 12 }}
255280
{{- end }}
281+
{{- with $values.extraContainers }}
282+
{{- toYaml . | nindent 8 }}
283+
{{- end }}
256284
{{- with $values.nodeSelector }}
257285
nodeSelector:
258286
{{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)