Skip to content

Commit

Permalink
feat: add secretNameOverride for external JWT secret management (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
apham0001 authored Jan 27, 2025
1 parent 4c79aa8 commit c563e89
Show file tree
Hide file tree
Showing 40 changed files with 101 additions and 41 deletions.
2 changes: 1 addition & 1 deletion charts/besu/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 2.4.10
version: 2.4.11

# 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
Expand Down
2 changes: 2 additions & 0 deletions charts/besu/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.global.JWTSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
type: Opaque
data:
jwtsecret: {{ .Values.global.JWTSecret | b64enc | quote }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/besu/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ spec:
volumes:
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
- name: env
emptyDir: {}
{{- if (not .Values.persistence.enabled) }}
Expand Down
4 changes: 2 additions & 2 deletions charts/besu/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- if not .Values.global.JWTSecret }}
{{- fail ".Values.global.JWTSecret is required" }}
{{- if or (and .Values.global.JWTSecret .Values.global.secretNameOverride) (and (not .Values.global.JWTSecret) (not .Values.global.secretNameOverride)) }}
{{- fail ".Values.global.JWTSecret or .Values.global.secretNameOverride is required" }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/besu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Server endpoints for an execution layer jwt authenticated HTTP JSON-RPC connection.
## Uses the same endpoint to populate the deposit cache.
## A separate Statefulset will be created for each specified address
Expand Down
2 changes: 1 addition & 1 deletion charts/erigon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sources:
# 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: 2.60.10
version: 2.60.11

# 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
Expand Down
10 changes: 5 additions & 5 deletions charts/erigon/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ spec:
--http.api={{ .Values.http.api }}
--http.port={{ .Values.http.port }}
{{- end }}
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
--authrpc.jwtsecret=/secret/jwtsecret
--authrpc.addr={{ .Values.authRpc.addr }}
--authrpc.port={{ .Values.authRpc.port }}
Expand Down Expand Up @@ -144,7 +144,7 @@ spec:
protocol: TCP
containerPort: {{ .Values.http.port }}
{{- end }}
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: authrpc
protocol: TCP
containerPort: {{ .Values.authRpc.port }}
Expand All @@ -167,7 +167,7 @@ spec:
volumeMounts:
- name: data
mountPath: /data
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: jwtsecret
mountPath: /secret
readOnly: true
Expand Down Expand Up @@ -225,10 +225,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
{{- end }}
- name: env-nodeport
emptyDir: {}
Expand Down
6 changes: 6 additions & 0 deletions charts/erigon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Credentials to fetch images from private registry
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
Expand Down
2 changes: 1 addition & 1 deletion charts/geth/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: geth
version: 2.4.15
version: 2.4.16
kubeVersion: "^1.20.0-0"
description: Official Golang implementation of the Ethereum v1 protocol.
type: application
Expand Down
2 changes: 1 addition & 1 deletion charts/geth/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
{{- end }}
type: ClusterIP
ports:
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: authrpc
port: {{ .Values.authRpc.port }}
targetPort: authrpc
Expand Down
10 changes: 5 additions & 5 deletions charts/geth/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
. /env/init-nodeport;
{{- end }}
exec geth
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
--authrpc.jwtsecret=/secret/jwtsecret
--authrpc.addr={{ .Values.authRpc.addr }}
--authrpc.port={{ .Values.authRpc.port }}
Expand Down Expand Up @@ -157,7 +157,7 @@ spec:
fieldRef:
fieldPath: status.podIP
ports:
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: authrpc
containerPort: {{ .Values.authRpc.port }}
{{- end }}
Expand All @@ -184,7 +184,7 @@ spec:
volumeMounts:
- name: data
mountPath: /data/ethereum
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: jwtsecret
mountPath: /secret
readOnly: true
Expand Down Expand Up @@ -234,10 +234,10 @@ spec:
{{- end }}
{{- end }}
volumes:
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
{{- end }}
- name: env-nodeport
emptyDir: {}
Expand Down
6 changes: 6 additions & 0 deletions charts/geth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Credentials to fetch images from private registry
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
Expand Down
2 changes: 1 addition & 1 deletion charts/lighthouse/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: lighthouse
version: 6.0.1
version: 6.0.2
kubeVersion: "^1.20.0-0"
description: Rust Ethereum 2.0 Client.
type: application
Expand Down
2 changes: 2 additions & 0 deletions charts/lighthouse/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.global.JWTSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
type: Opaque
data:
jwtsecret: {{ .Values.global.JWTSecret | b64enc | quote }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/lighthouse/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ spec:
volumes:
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
- name: env-nodeport
emptyDir: {}
- name: configs
Expand Down
4 changes: 2 additions & 2 deletions charts/lighthouse/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if not .Values.global.JWTSecret }}
{{- fail ".Values.global.JWTSecret is required" }}
{{- if or (and .Values.global.JWTSecret .Values.global.secretNameOverride) (and (not .Values.global.JWTSecret) (not .Values.global.secretNameOverride)) }}
{{- fail ".Values.global.JWTSecret or .Values.global.secretNameOverride is required" }}
{{- end }}

{{- $endpoints := uniq .Values.global.executionEndpoints -}}
Expand Down
6 changes: 6 additions & 0 deletions charts/lighthouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Server endpoints for an execution layer jwt authenticated HTTP JSON-RPC connection.
## Uses the same endpoint to populate the deposit cache.
## A separate Statefulset will be created for each specified address
Expand Down
2 changes: 1 addition & 1 deletion charts/lodestar/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: lodestar
version: 1.1.6
version: 1.1.7
kubeVersion: "^1.20.0-0"
description: Rust Ethereum 2.0 Client.
icon: https://storage.googleapis.com/stakewise-charts/stakewise.png
Expand Down
2 changes: 2 additions & 0 deletions charts/lodestar/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.global.JWTSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
type: Opaque
data:
jwtsecret: {{ .Values.global.JWTSecret | b64enc | quote }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/lodestar/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ spec:
volumes:
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
- name: env-nodeport
emptyDir: {}
- name: configs
Expand Down
4 changes: 2 additions & 2 deletions charts/lodestar/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if not .Values.global.JWTSecret }}
{{- fail ".Values.global.JWTSecret is required" }}
{{- if or (and .Values.global.JWTSecret .Values.global.secretNameOverride) (and (not .Values.global.JWTSecret) (not .Values.global.secretNameOverride)) }}
{{- fail ".Values.global.JWTSecret or .Values.global.secretNameOverride is required" }}
{{- end }}

{{- $endpoints := uniq .Values.global.executionEndpoints -}}
Expand Down
6 changes: 6 additions & 0 deletions charts/lodestar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Server endpoints for an execution layer jwt authenticated HTTP JSON-RPC connection.
## Uses the same endpoint to populate the deposit cache.
## A separate Statefulset will be created for each specified address
Expand Down
2 changes: 1 addition & 1 deletion charts/nethermind/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nethermind
description: .NET Core Ethereum client
type: application
version: 2.7.3
version: 2.7.4
appVersion: "v1.30.3"
icon: https://storage.googleapis.com/stakewise-charts/stakewise.png
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/nethermind/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
protocol: TCP
name: json-ws
{{- end }}
{{- if .Values.global.JWTSecret }}
{{- if or .Values.global.JWTSecret .Values.global.secretNameOverride }}
- port: {{ .Values.jsonrpc.engine.port }}
targetPort: engine
protocol: TCP
Expand Down
4 changes: 2 additions & 2 deletions charts/nethermind/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secert outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/nimbus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nimbus
version: 2.2.11
version: 2.2.12
kubeVersion: "^1.18.0-0"
description: Nim implementation of the Ethereum Beacon Chain
type: application
Expand Down
2 changes: 2 additions & 0 deletions charts/nimbus/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.global.JWTSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
type: Opaque
data:
jwtsecret: {{ .Values.global.JWTSecret | b64enc | quote }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/nimbus/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ spec:
volumes:
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
- name: env-nodeport
emptyDir: {}
- name: configs
Expand Down
4 changes: 2 additions & 2 deletions charts/nimbus/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if not .Values.global.JWTSecret }}
{{- fail ".Values.global.JWTSecret is required" }}
{{- if or (not .Values.global.JWTSecret) (not .Values.global.secretNameOverride) }}
{{- fail ".Values.global.JWTSecret or .Values.global.secretNameOverride is required" }}
{{- end }}

{{- $endpoints := uniq .Values.global.executionEndpoints -}}
Expand Down
6 changes: 6 additions & 0 deletions charts/nimbus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ global:
##
JWTSecret: ""

## If you would like the JSON Web Token (JWT) to be managed by a secret outside
## of this chart, an existing secret name can be passed here. If specified, JWTSecret should not be set.
## jwtsecret should be the key of the token in the secret.
##
secretNameOverride: ""

## Server endpoints for an execution layer jwt authenticated HTTP JSON-RPC connection.
## Uses the same endpoint to populate the deposit cache.
## A separate Statefulset will be created for each specified address
Expand Down
2 changes: 1 addition & 1 deletion charts/prysm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: prysm
version: 5.2.0
version: 5.2.1
appVersion: v5.2.0
kubeVersion: "^1.18.0-0"
description: Go implementation of Ethereum proof of stake.
Expand Down
2 changes: 2 additions & 0 deletions charts/prysm/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.global.JWTSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
type: Opaque
data:
jwtsecret: {{ .Values.global.JWTSecret | b64enc | quote }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/prysm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ spec:
volumes:
- name: jwtsecret
secret:
secretName: {{ include "common.names.fullname" . }}
secretName: {{ coalesce .Values.global.secretNameOverride (include "common.names.fullname" .) }}
- name: config
emptyDir: {}
{{- if eq .Values.global.network "gnosis" }}
Expand Down
4 changes: 2 additions & 2 deletions charts/prysm/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if not .Values.global.JWTSecret }}
{{- fail ".Values.global.JWTSecret is required" }}
{{- if or (and .Values.global.JWTSecret .Values.global.secretNameOverride) (and (not .Values.global.JWTSecret) (not .Values.global.secretNameOverride)) }}
{{- fail ".Values.global.JWTSecret or .Values.global.secretNameOverride is required" }}
{{- end }}

{{- $endpoints := uniq .Values.global.executionEndpoints -}}
Expand Down
Loading

0 comments on commit c563e89

Please sign in to comment.