Skip to content

Commit 7dabdcc

Browse files
committed
jwt persistance and checksum
1 parent 37923c6 commit 7dabdcc

5 files changed

Lines changed: 18 additions & 8 deletions

File tree

charts/firehose-ethereum/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: firehose-ethereum
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 1.3.0
5+
version: 1.4.0
66
appVersion: geth-v1.16.5-fh3.0
77
keywords:
88
- firehose

charts/firehose-ethereum/templates/full-firehose/beacon/statefulSet.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ spec:
2626
storage: {{ $.Values.fullMode.storage.lighthouse.size | quote }}
2727
template:
2828
metadata:
29-
{{- with $values.components.lighthouse.podAnnotations }}
3029
annotations:
30+
checksum/jwt-secret: {{ include (print $.Template.BasePath "/full-firehose/reader/jwt-secret.yaml") . | sha256sum }}
31+
{{- with $values.components.lighthouse.podAnnotations }}
3132
{{- toYaml . | nindent 8 }}
32-
{{- end }}
33+
{{- end }}
3334
labels:
3435
{{- include "firehose-ethereum.selectorLabels" . | nindent 8 }}
3536
{{- $componentLabel | nindent 8 }}

charts/firehose-ethereum/templates/full-firehose/op-node/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ spec:
1717
replicas: {{ $values.components.opNode.replicas }}
1818
template:
1919
metadata:
20-
{{- with $values.components.opNode.podAnnotations }}
2120
annotations:
21+
checksum/jwt-secret: {{ include (print $.Template.BasePath "/full-firehose/reader/jwt-secret.yaml") . | sha256sum }}
22+
{{- with $values.components.opNode.podAnnotations }}
2223
{{- toYaml . | nindent 8 }}
23-
{{- end }}
24+
{{- end }}
2425
labels:
2526
{{- include "firehose-ethereum.selectorLabels" . | nindent 8 }}
2627
{{- $componentLabel | nindent 8 }}

charts/firehose-ethereum/templates/full-firehose/reader/jwt-secret.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
{{- if and (eq .Values.mode "full") $values.components.reader.enabled }}
33
{{- $componentName := "reader" }}
44
{{- $componentLabel := include "firehose-ethereum.componentLabelFor" $componentName }}
5-
{{- $jwt := printf "%s%s" (uuidv4 | replace "-" "") (uuidv4 | replace "-" "") }}
5+
{{- $secretName := printf "%s-firehose-jwt" .Release.Name }}
6+
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }}
7+
{{- $jwt := "" }}
8+
{{- if $existingSecret }}
9+
{{- $jwt = index $existingSecret.data "jwt.hex" | b64dec }}
10+
{{- else }}
11+
{{- $jwt = printf "%s%s" (uuidv4 | replace "-" "") (uuidv4 | replace "-" "") }}
12+
{{- end }}
613
apiVersion: v1
714
kind: Secret
815
metadata:

charts/firehose-ethereum/templates/full-firehose/reader/statefulSet.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ spec:
2626
replicas: {{ $values.components.reader.replicas }}
2727
template:
2828
metadata:
29-
{{- with $values.components.reader.podAnnotations }}
3029
annotations:
30+
checksum/jwt-secret: {{ include (print $.Template.BasePath "/full-firehose/reader/jwt-secret.yaml") . | sha256sum }}
31+
{{- with $values.components.reader.podAnnotations }}
3132
{{- toYaml . | nindent 8 }}
32-
{{- end }}
33+
{{- end }}
3334
labels:
3435
{{- include "firehose-ethereum.selectorLabels" . | nindent 8 }}
3536
{{- $componentLabel | nindent 8 }}

0 commit comments

Comments
 (0)