Skip to content

Commit f9bb2e8

Browse files
committed
Introduce readinessProbe
1 parent 11d6998 commit f9bb2e8

File tree

11 files changed

+43
-13
lines changed

11 files changed

+43
-13
lines changed

Diff for: mina-common/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: mina-test-common
33
description: Common templates for Mina test nodes
44
type: library
5-
version: 0.0.2
5+
version: 0.0.3
66
appVersion: "0.0.0"

Diff for: mina-common/templates/_values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{/*
2+
Get readiness probe value
3+
*/}}
4+
{{- define "mina-common.readinessProbe" }}
5+
{{- default (dig "global" "readinessProbe" "" .Values.AsMap) (dig "readinessProbe" "" .Values.AsMap) }}
6+
{{- end }}

Diff for: ocaml-test-node/Chart.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: mina-test-common
33
repository: file://../mina-common
4-
version: 0.0.2
5-
digest: sha256:06b9035c0407b0125c921251a176d591944cd8abcabab5ff525c4e411303eda2
6-
generated: "2023-11-16T12:51:57.76816585+03:00"
4+
version: 0.0.3
5+
digest: sha256:097f88c43d1b8c3cbd192a064a8c6f44bcc87a694db6c6e601dc67e4d632c1b7
6+
generated: "2023-11-16T16:34:19.693845386+03:00"

Diff for: ocaml-test-node/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: ocaml-test-node
33
description: A Helm chart for OCaml Mina test node.
44
type: application
5-
version: 0.0.2
5+
version: 0.0.3
66

77
# This is the version number of the application being deployed. This version number should be
88
# incremented each time you make changes to the application. Versions are not expected to
@@ -13,4 +13,4 @@ appVersion: "2.0.0rampup4"
1313
dependencies:
1414
- name: mina-test-common
1515
repository: file://../mina-common
16-
version: ">=0.0.2"
16+
version: ">=0.0.3"

Diff for: ocaml-test-node/templates/_probes.tpl

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{/*
2+
OCaml node readiness probe
3+
*/}}
4+
{{- define "ocaml-test-node.readinessProbe" }}
5+
{{- with include "mina-common.readinessProbe" . }}
6+
readinessProbe:
7+
{{- if (eq . "P2PSocket") }}
8+
tcpSocket:
9+
port: "external"
10+
{{- else }}
11+
{{- fail (printf "unknown readiness probe kind: '%s'" .) }}
12+
{{- end }}
13+
{{- end }}
14+
{{- end }}

Diff for: ocaml-test-node/templates/deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ spec:
4343
{{- toYaml .Values.resources | nindent 12 }}
4444
volumeMounts:
4545
{{- include "ocaml-test-node.volumeMounts" . | indent 12 }}
46+
{{ include "ocaml-test-node.readinessProbe" . | indent 10 }}
4647
volumes:
4748
{{- include "ocaml-test-node.volumes" . | indent 8 }}
4849
{{- with .Values.nodeSelector }}

Diff for: rust-test-node/Chart.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: mina-test-common
33
repository: file://../mina-common
4-
version: 0.0.1
5-
digest: sha256:14df3f6d0527897f35d4f1a99829ef21063b02ef8e095bd356b46af4bdb51a3f
6-
generated: "2023-11-13T12:55:04.060122744+03:00"
4+
version: 0.0.2
5+
digest: sha256:56aba8d4369cc09440c0050dc60f6fca777f9f36bd15768f48ee3e31ed06ed71
6+
generated: "2023-11-16T14:59:29.620406417+03:00"

Diff for: rust-test-node/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ apiVersion: v2
22
name: rust-test-node
33
description: A Rust Mina test node
44
type: application
5-
version: 0.0.1
5+
version: 0.0.2
66
appVersion: "0.0.1"
77
dependencies:
88
- name: mina-test-common
99
repository: file://../mina-common
10-
version: ">0.0.0"
10+
version: ">0.0.3"

Diff for: rust-test-node/templates/_probes.tpl

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ livenessProbe:
1717
Readiness probe: openmina node considered ready when it is in sync with the network.
1818
*/}}
1919
{{- define "rust-test-node.readinessProbe" }}
20-
{{- if .Values.probes.readiness }}
20+
{{- with include "mina-common.readinessProbe" . }}
2121
readinessProbe:
22+
{{- if eq . "Default" }}
2223
initialDelaySeconds: 60
2324
periodSeconds: 20
2425
failureThreshold: 60
2526
httpGet:
2627
path: /readyz
2728
port: 3000
29+
{{- else if eq . "P2PSocket"}}
30+
tcpSocket:
31+
port: "external"
32+
{{- else }}
33+
{{- fail (printf "unknown readiness probe kind: '%s'" .) }}
34+
{{- end }}
2835
{{- end }}
2936
{{- end }}

Diff for: rust-test-node/templates/deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ spec:
4949
{{ include "rust-test-node.volumeMounts" . | indent 12 }}
5050
resources:
5151
{{- toYaml .Values.resources | nindent 12 }}
52+
ports:
53+
- name: external
54+
containerPort: 8302
5255
volumes:
5356
{{ include "rust-test-node.volumes" . | indent 10 }}
5457
{{- with .Values.nodeSelector }}

Diff for: rust-test-node/values.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
probes:
66
liveness: true
7-
readiness: true
87
replicaCount: 1
98

109
image:

0 commit comments

Comments
 (0)