Skip to content

Commit

Permalink
[rpc-node] Adding jwtsecret config option
Browse files Browse the repository at this point in the history
  • Loading branch information
nzenchik committed Jun 12, 2024
1 parent 181025a commit 92d4431
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/rpc-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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: 0.3.1
version: 0.3.2

# 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
11 changes: 11 additions & 0 deletions charts/rpc-node/templates/common-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.config.jwtsecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "rpc-node.fullname" . }}-jwtsecret
labels:
{{- include "rpc-node.labels" . | nindent 4 }}
type: Opaque
data:
jwtsecret: {{ .Values.config.jwtsecret.value | b64enc }}
{{- end }}
16 changes: 14 additions & 2 deletions charts/rpc-node/templates/consensus-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,32 @@ spec:
{{- toYaml .Values.consensus.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.consensus.resources | nindent 12 }}
{{- if or .Values.consensus.persistence.enabled .Values.volumeMounts }}
{{- if or .Values.consensus.persistence.enabled .Values.consensus.volumeMounts .Values.config.jwtsecret.enabled }}
volumeMounts:
{{- if .Values.consensus.persistence.enabled }}
- name: consensus-data
mountPath: {{ .Values.consensus.persistence.mountPath }}
{{- end }}
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
mountPath: /app/config/jwtsecret
subPath: jwtsecret
{{- end }}
{{- with .Values.consensus.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.consensus.volumes }}
{{- if or .Values.consensus.volumes .Values.config.jwtsecret.enabled }}
volumes:
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
secret:
secretName: {{ include "rpc-node.fullname" . }}-jwtsecret
{{- end }}
{{- with .Values.consensus.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: 300
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
16 changes: 14 additions & 2 deletions charts/rpc-node/templates/execution-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,32 @@ spec:
{{- toYaml .Values.execution.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.execution.resources | nindent 12 }}
{{- if or .Values.execution.persistence.enabled .Values.volumeMounts }}
{{- if or .Values.execution.persistence.enabled .Values.execution.volumeMounts .Values.config.jwtsecret.enabled }}
volumeMounts:
{{- if .Values.execution.persistence.enabled }}
- name: execution-data
mountPath: {{ .Values.execution.persistence.mountPath }}
{{- end }}
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
mountPath: /app/config/jwtsecret
subPath: jwtsecret
{{- end }}
{{- with .Values.execution.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.execution.volumes }}
{{- if or .Values.execution.volumes .Values.config.jwtsecret.enabled }}
volumes:
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
secret:
secretName: {{ include "rpc-node.fullname" . }}-jwtsecret
{{- end }}
{{- with .Values.execution.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: 300
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
5 changes: 5 additions & 0 deletions charts/rpc-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ nodeSelector: {}
tolerations: []
affinity: {}

config:
jwtsecret:
enabled: false
value: ""

execution:
image:
repository: ethereum/client-go
Expand Down

0 comments on commit 92d4431

Please sign in to comment.