Skip to content

Commit

Permalink
[rpc-node] Custom files mount to execution and consensus services
Browse files Browse the repository at this point in the history
  • Loading branch information
nzenchik committed Jul 26, 2024
1 parent 5bc9427 commit f5c9be3
Show file tree
Hide file tree
Showing 6 changed files with 57 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.3
version: 0.4.0

# 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/consensus-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.consensus.configFiles.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "rpc-node.fullname" . }}-consensus-files
data:
{{- range $key, $value := .Values.consensus.configFiles.content }}
{{ $key }}: {{ toYaml $value | indent 2 }}
{{- end }}
{{- end }}
13 changes: 11 additions & 2 deletions charts/rpc-node/templates/consensus-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
{{- toYaml .Values.consensus.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.consensus.resources | nindent 12 }}
{{- if or .Values.consensus.persistence.enabled .Values.consensus.volumeMounts .Values.config.jwtsecret.enabled }}
{{- if or .Values.consensus.persistence.enabled .Values.consensus.volumeMounts .Values.config.jwtsecret.enabled .Values.consensus.configFiles.enabled }}
volumeMounts:
{{- if .Values.consensus.persistence.enabled }}
- name: consensus-data
Expand All @@ -110,17 +110,26 @@ spec:
mountPath: /app/config/jwtsecret
subPath: jwtsecret
{{- end }}
{{- if .Values.consensus.configFiles.enabled }}
- name: configfiles
mountPath: {{ .Values.consensus.configFiles.mountPath }}
{{- end }}
{{- with .Values.consensus.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if or .Values.consensus.volumes .Values.config.jwtsecret.enabled }}
{{- if or .Values.consensus.volumes .Values.config.jwtsecret.enabled .Values.consensus.configFiles.enabled }}
volumes:
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
secret:
secretName: {{ include "rpc-node.fullname" . }}-jwtsecret
{{- end }}
{{- if .Values.consensus.configFiles.enabled }}
- name: configfiles
configMap:
name: {{ include "rpc-node.fullname" . }}-consensus-files
{{- end }}
{{- with .Values.consensus.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions charts/rpc-node/templates/execution-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.execution.configFiles.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "rpc-node.fullname" . }}-execution-files
data:
{{- range $key, $value := .Values.execution.configFiles.content }}
{{ $key }}: {{ toYaml $value | indent 2 }}
{{- end }}
{{- end }}
13 changes: 11 additions & 2 deletions charts/rpc-node/templates/execution-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
{{- toYaml .Values.execution.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.execution.resources | nindent 12 }}
{{- if or .Values.execution.persistence.enabled .Values.execution.volumeMounts .Values.config.jwtsecret.enabled }}
{{- if or .Values.execution.persistence.enabled .Values.execution.volumeMounts .Values.config.jwtsecret.enabled .Values.execution.configFiles.enabled }}
volumeMounts:
{{- if .Values.execution.persistence.enabled }}
- name: execution-data
Expand All @@ -109,17 +109,26 @@ spec:
mountPath: /app/config/jwtsecret
subPath: jwtsecret
{{- end }}
{{- if .Values.execution.configFiles.enabled }}
- name: configfiles
mountPath: {{ .Values.execution.configFiles.mountPath }}
{{- end }}
{{- with .Values.execution.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if or .Values.execution.volumes .Values.config.jwtsecret.enabled }}
{{- if or .Values.execution.volumes .Values.config.jwtsecret.enabled .Values.execution.configFiles.enabled }}
volumes:
{{- if .Values.config.jwtsecret.enabled }}
- name: jwtsecret
secret:
secretName: {{ include "rpc-node.fullname" . }}-jwtsecret
{{- end }}
{{- if .Values.execution.configFiles.enabled }}
- name: configfiles
configMap:
name: {{ include "rpc-node.fullname" . }}-execution-files
{{- end }}
{{- with .Values.execution.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
12 changes: 12 additions & 0 deletions charts/rpc-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ execution:
port: metrics
path: /debug/metrics/prometheus

configFiles:
enabled: false
#content:
# genesis.json: |-
# ...
#mountPath: /app/config
# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
Expand Down Expand Up @@ -273,6 +279,12 @@ consensus:
periodSeconds: 30
timeoutSeconds: 15

configFiles:
enabled: false
#content:
# genesis.json: |-
# ...
#mountPath: /app/config
# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
Expand Down

0 comments on commit f5c9be3

Please sign in to comment.