Skip to content

Commit

Permalink
feat: add probes overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
cjorge-graphops committed Nov 20, 2024
1 parent 5b30581 commit 17aee53
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 11 deletions.
3 changes: 3 additions & 0 deletions charts/erigon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| statefulNode.jwt.existingSecret.key | Data key for the JWT in the Secret | string | `nil` |
| statefulNode.jwt.existingSecret.name | Name of the Secret resource in the same namespace | string | `nil` |
| statefulNode.jwt.fromLiteral | Use this literal value for the JWT | string | `nil` |
| statefulNode.livenessProbe | Sets a livenessProbe configuration for the container | object | `{}` |
| statefulNode.nodeSelector | | object | `{}` |
| statefulNode.p2pNodePort.enabled | Expose P2P port via NodePort | bool | `false` |
| statefulNode.p2pNodePort.initContainer.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
Expand All @@ -175,6 +176,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| statefulNode.p2pNodePort.port | NodePort to be used. Must be unique. | int | `31000` |
| statefulNode.podAnnotations | Annotations for the `Pod` | object | `{}` |
| statefulNode.podSecurityContext | Pod-wide security context | object | `{"fsGroup":101337,"runAsGroup":101337,"runAsNonRoot":true,"runAsUser":101337}` |
| statefulNode.readinessProbe | Sets a readinessProbe configuration for the container | object | `{"grpc":{"port":9090}}` |
| statefulNode.resources | | object | `{}` |
| statefulNode.restoreSnapshot.enabled | Enable initialising Erigon state from a remote snapshot | bool | `false` |
| statefulNode.restoreSnapshot.snapshotUrl | URL for snapshot to download and extract to restore state | string | `""` |
Expand All @@ -186,6 +188,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| statefulNode.service.ports.ws-rpc | Service Port to expose WS-RPC interface on | int | `8546` |
| statefulNode.service.topologyAwareRouting.enabled | | bool | `false` |
| statefulNode.service.type | | string | `"ClusterIP"` |
| statefulNode.startupProbe | Sets a startupProbe configuration for the container | object | `{}` |
| statefulNode.terminationGracePeriodSeconds | Amount of time to wait before force-killing the Erigon process | int | `60` |
| statefulNode.tolerations | | list | `[]` |
| statefulNode.updateStrategyType | Choice of StatefulSet updateStrategy (OnDelete|RollingUpdate) | string | `"RollingUpdate"` |
Expand Down
18 changes: 12 additions & 6 deletions charts/erigon/templates/stateful-node/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: {{ default 0 ($values.rollingUpdatePartition | atoi) }}
partition: {{ default 0 ($values.rollingUpdatePartition | quote | atoi) }}
{{- end }}
template:
metadata:
Expand Down Expand Up @@ -252,12 +252,18 @@ spec:
mountPath: /storage
- name: tmp
mountPath: /tmp
{{- if $values.readinessProbe }}
readinessProbe:
# This currently requires GRPCContainerProbe feature gate to be enabled on the kubelet
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-grpc-liveness-probe
# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
grpc:
port: 9090 # named ports not supported yet by grpc probes
{{ toYaml $values.readinessProbe | nindent 12 }}
{{- end }}
{{- if $values.livenessProbe }}
livenessProbe:
{{ toYaml $values.livenessProbe | nindent 12 }}
{{- end }}
{{- if $values.startupProbe }}
startupProbe:
{{ toYaml $values.startupProbe | nindent 12 }}
{{- end }}
{{- with $values.resources }}
resources:
{{- toYaml . | nindent 12 }}
Expand Down
18 changes: 18 additions & 0 deletions charts/erigon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ statefulNode:
# -- When using a RollingUpdate update strategy in the StatefulSet, sets a partition index to only update PODs with that index or higher
rollingUpdatePartition: 0

# Probes configuration for the containers in the StatefulSet
# Users can directly define readiness, liveness, and startup probes below.
# These will be directly copied into the StatefulSet manifest.

# -- Sets a readinessProbe configuration for the container
readinessProbe:
# This currently requires GRPCContainerProbe feature gate to be enabled on the kubelet
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-grpc-liveness-probe
# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
grpc:
port: 9090 # named ports not supported yet by grpc probes

# -- Sets a livenessProbe configuration for the container
livenessProbe: {}

# -- Sets a startupProbe configuration for the container
startupProbe: {}

# -- Annotations for the `Pod`
podAnnotations: {}

Expand Down
3 changes: 3 additions & 0 deletions charts/nimbus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| nimbus.jwt.existingSecret.key | Data key for the JWT in the Secret | string | `""` |
| nimbus.jwt.existingSecret.name | Name of the Secret resource in the same namespace | string | `""` |
| nimbus.jwt.fromLiteral | Use this literal value for the JWT | string | `""` |
| nimbus.livenessProbe | Sets a livenessProbe configuration for the container | object | `{}` |
| nimbus.nodeSelector | | object | `{}` |
| nimbus.p2pNodePort.enabled | Expose P2P port via NodePort | bool | `false` |
| nimbus.p2pNodePort.initContainer.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
Expand All @@ -127,12 +128,14 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| nimbus.p2pNodePort.port | NodePort to be used. Must be unique. | int | `31000` |
| nimbus.podAnnotations | Annotations for the `Pod` | object | `{}` |
| nimbus.podSecurityContext | Pod-wide security context | object | `{"fsGroup":101337,"runAsGroup":101337,"runAsNonRoot":true,"runAsUser":101337}` |
| nimbus.readinessProbe | Sets a readinessProbe configuration for the container | object | `{"initialDelaySeconds":10,"periodSeconds":10,"tcpSocket":{"port":"http-nimbus"}}` |
| nimbus.resources | | object | `{}` |
| 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` |
| nimbus.service.ports.http-metrics | Service Port to expose Prometheus metrics on | int | `8008` |
| nimbus.service.ports.http-nimbus | Service Port to expose JSON-RPC interface on | int | `5052` |
| nimbus.service.topologyAwareRouting.enabled | | bool | `false` |
| nimbus.service.type | | string | `"ClusterIP"` |
| nimbus.startupProbe | Sets a startupProbe configuration for the container | object | `{}` |
| nimbus.terminationGracePeriodSeconds | Amount of time to wait before force-killing the container | int | `60` |
| nimbus.tolerations | | list | `[]` |
| nimbus.trustedNodeSync.enabled | Enable init container to do a trusted checkpoint sync from another Consensus Client (be careful) | bool | `false` |
Expand Down
17 changes: 12 additions & 5 deletions charts/nimbus/templates/nimbus/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: {{ default 0 ($values.rollingUpdatePartition | atoi) }}
partition: {{ default 0 ($values.rollingUpdatePartition | quote | atoi) }}
{{- end }}
template:
metadata:
Expand Down Expand Up @@ -253,11 +253,18 @@ spec:
mountPath: /storage
- name: tmp
mountPath: /tmp
{{- if $values.readinessProbe }}
readinessProbe:
tcpSocket:
port: http-nimbus
initialDelaySeconds: 10
periodSeconds: 10
{{ toYaml $values.readinessProbe | nindent 12 }}
{{- end }}
{{- if $values.livenessProbe }}
livenessProbe:
{{ toYaml $values.livenessProbe | nindent 12 }}
{{- end }}
{{- if $values.startupProbe }}
startupProbe:
{{ toYaml $values.startupProbe | nindent 12 }}
{{- end }}
{{- with $values.resources }}
resources:
{{- toYaml . | nindent 12 }}
Expand Down
17 changes: 17 additions & 0 deletions charts/nimbus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ nimbus:
# -- When using a RollingUpdate update strategy in the StatefulSet, sets a partition index to only update PODs with that index or higher
rollingUpdatePartition: 0

# Probes configuration for the containers in the StatefulSet
# Users can directly define readiness, liveness, and startup probes below.
# These will be directly copied into the StatefulSet manifest.

# -- Sets a readinessProbe configuration for the container
readinessProbe:
tcpSocket:
port: http-nimbus
initialDelaySeconds: 10
periodSeconds: 10

# -- Sets a livenessProbe configuration for the container
livenessProbe: {}

# -- Sets a startupProbe configuration for the container
startupProbe: {}

# -- Annotations for the `Pod`
podAnnotations: {}

Expand Down

0 comments on commit 17aee53

Please sign in to comment.