Skip to content

Commit

Permalink
Merge pull request #262 from MinaFoundation/PM-1971-support-openmina-…
Browse files Browse the repository at this point in the history
…helm-charts-for-checksum-and-pvc

PM-1971 - Openmina - Support for checksum and PVC
  • Loading branch information
kaozenn authored Sep 10, 2024
2 parents e2e8cd2 + 5961f7d commit 8a14372
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 13 deletions.
5 changes: 5 additions & 0 deletions openmina-block-producer-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ helmfile status
| node.wallet.privateKey | string | `""` | The wallet private key |
| node.wallet.publicKey | string | `""` | The wallet public key |
| nodeSelector | object | `{}` | The node selector |
| persistence.accessMode | string | `"ReadWriteOnce"` | The access mode of the PVC |
| persistence.annotations | object | `{}` | Annotations to add to the PVC |
| persistence.enabled | bool | `true` | Enable persistence using PVC |
| persistence.size | string | `"1Gi"` | The size of the PVC |
| persistence.storageClass | string | `"ebs-gp3-encrypted"` | The StorageClass of the PVC |
| podAnnotations | object | `{}` | Annotations to add to the pods |
| podLabels | object | `{}` | Label to add to the pods |
| podSecurityContext | object | `{}` | The Pod Security Context |
Expand Down
24 changes: 20 additions & 4 deletions openmina-block-producer-dashboard/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ metadata:
{{- include "openmina-block-producer-dashboard.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
{{- if .Values.persistence.enabled }}
type: Recreate
{{- else }}
type: RollingUpdate
{{- end }}
selector:
matchLabels:
{{- include "openmina-block-producer-dashboard.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/environment: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "openmina-block-producer-dashboard.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
Expand Down Expand Up @@ -53,17 +60,26 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: openmina-node-data
- name: openmina-keys
mountPath: "/root/.openmina/keys"
readOnly: true
{{- if .Values.persistence.enabled }}
- name: dashboard-database
mountPath: /tmp
{{ end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: openmina-node-data
- name: openmina-keys
secret:
secretName: {{ include "openmina-block-producer-dashboard.fullname" . }}
defaultMode: 0600
{{- if .Values.persistence.enabled }}
- name: dashboard-database
persistentVolumeClaim:
claimName: {{ include "openmina-block-producer-dashboard.fullname" . }}
{{ end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions openmina-block-producer-dashboard/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "openmina-block-producer-dashboard.fullname" . }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
13 changes: 13 additions & 0 deletions openmina-block-producer-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ envVars: {}
# name: mySecret
# key: bar


persistence:
# -- Enable persistence using PVC
enabled: true
# -- The StorageClass of the PVC
storageClass: ebs-gp3-encrypted
# -- The access mode of the PVC
accessMode: ReadWriteOnce
# -- The size of the PVC
size: 1Gi
# -- Annotations to add to the PVC
annotations: {}

# -- The Resources
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down
2 changes: 1 addition & 1 deletion openmina-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ helmfile status
| fullnameOverride | string | `""` | Full name override |
| image.pullPolicy | string | `"IfNotPresent"` | The image pull policy |
| image.repository | string | `"openmina/frontend"` | The image repository |
| image.tag | string | `"0.8.2"` | Overrides the image tag whose default is the chart appVersion. |
| image.tag | string | `"0.8.5"` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | The secrets used to pull the image |
| ingress.annotations | object | `{}` | The Ingress Annotations |
| ingress.className | string | `""` | The Ingress Class Name to use |
Expand Down
2 changes: 1 addition & 1 deletion openmina-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
# -- The image pull policy
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion.
tag: "0.8.2"
tag: "0.8.5"

# -- The secrets used to pull the image
imagePullSecrets: []
Expand Down
8 changes: 7 additions & 1 deletion openmina-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ helmfile status
| fullnameOverride | string | `""` | The full release name override |
| image.pullPolicy | string | `"IfNotPresent"` | The pullPolicy used when pulling the image |
| image.repository | string | `"openmina/openmina"` | The image repository |
| image.tag | string | `"0.8.2"` | Overrides the image tag whose default is the chart appVersion. |
| image.tag | string | `"0.8.5"` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | The secrets used to pull the image |
| ingress.annotations | object | `{}` | The Ingress Annotations |
| ingress.className | string | `""` | The Ingress Class Name to use |
Expand All @@ -57,11 +57,17 @@ helmfile status
| nameOverride | string | `""` | The release name override |
| node.args | list | `[]` | The arguments to pass at runtime |
| node.envVars | object | `{}` | The environment variables to set |
| node.homeDirectory | string | `"/root/.openmina"` | The home directory of the node |
| node.libp2p.privateKey | string | `""` | The libp2p private key |
| node.libp2p.publicKey | string | `""` | The libp2p public key |
| node.wallet.privateKey | string | `""` | The wallet private key |
| node.wallet.publicKey | string | `""` | The wallet public key |
| nodeSelector | object | `{}` | Node selector labels |
| persistence.accessMode | string | `"ReadWriteOnce"` | The access mode of the PVC |
| persistence.annotations | object | `{}` | Annotations to add to the PVC |
| persistence.enabled | bool | `true` | Enable persistence using PVC |
| persistence.size | string | `"1Gi"` | The size of the PVC |
| persistence.storageClass | string | `"ebs-gp3-encrypted"` | The StorageClass of the PVC |
| podAnnotations | object | `{}` | Annotations to add to the pods |
| podLabels | object | `{}` | Label to add to the pods |
| podSecurityContext | object | `{}` | The Pod Security Context |
Expand Down
28 changes: 23 additions & 5 deletions openmina-node/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ metadata:
{{- include "openmina-node.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
{{- if .Values.persistence.enabled }}
type: Recreate
{{- else }}
type: RollingUpdate
{{- end }}
selector:
matchLabels:
{{- include "openmina-node.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/environment: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "openmina-node.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
Expand Down Expand Up @@ -48,6 +55,8 @@ spec:
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
- name: OPENMINA_HOME
value: {{ .Values.node.homeDirectory }}
{{- if .Values.node.envVars }}
{{- toYaml .Values.node.envVars | nindent 12 }}
{{- end }}
Expand All @@ -58,17 +67,26 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: openmina-node-data
mountPath: "/root/.openmina/keys"
- name: openmina-keys
mountPath: {{ .Values.node.homeDirectory }}/keys
readOnly: true
{{- if .Values.persistence.enabled }}
- name: openmina-home
mountPath: {{ .Values.node.homeDirectory }}
{{ end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: openmina-node-data
- name: openmina-keys
secret:
secretName: {{ include "openmina-node.fullname" . }}
defaultMode: 0600
{{- if .Values.persistence.enabled }}
- name: openmina-home
persistentVolumeClaim:
claimName: {{ include "openmina-node.fullname" . }}
{{ end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions openmina-node/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "openmina-node.fullname" . }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
16 changes: 15 additions & 1 deletion openmina-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
# -- The pullPolicy used when pulling the image
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion.
tag: "0.8.2"
tag: "0.8.5"

# -- The secrets used to pull the image
imagePullSecrets: []
Expand Down Expand Up @@ -79,6 +79,8 @@ ingress:
# - chart-example.local

node:
# -- The home directory of the node
homeDirectory: "/root/.openmina"
wallet:
# -- The wallet private key
privateKey: ""
Expand All @@ -101,6 +103,18 @@ node:
# name: mySecret
# key: bar

persistence:
# -- Enable persistence using PVC
enabled: true
# -- The StorageClass of the PVC
storageClass: ebs-gp3-encrypted
# -- The access mode of the PVC
accessMode: ReadWriteOnce
# -- The size of the PVC
size: 1Gi
# -- Annotations to add to the PVC
annotations: {}

# -- Resource limitations for the pods
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down

0 comments on commit 8a14372

Please sign in to comment.