Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: custom claim #2

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ maintainers:

type: application

version: 0.1.0
version: 0.1.1

appVersion: "0.8.7"
7 changes: 7 additions & 0 deletions charts/node/templates/engine-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ spec:
path: signing_key_file
- key: ethereum-key
path: ethereum_key_file
{{- if .Values.engine.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.engine.persistence.existingClaim }}
{{- end }}
{{- if eq .Values.engine.persistence.existingClaim "" }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -116,4 +122,5 @@ spec:
resources:
requests:
storage: "{{ .Values.engine.persistence.size }}"
{{- end }}
{{- end }}
9 changes: 8 additions & 1 deletion charts/node/templates/node-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ spec:
- key: ethereum-key
path: {{ .Values.common.keys.ethereumKeyFileName }}
{{- end }}
{{- if .Values.node.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.node.persistence.existingClaim }}
{{- end }}
{{- if eq .Values.node.persistence.existingClaim "" }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -155,4 +161,5 @@ spec:
{{- end }}
resources:
requests:
storage: "{{ .Values.node.persistence.size }}"
storage: "{{ .Values.node.persistence.size }}"
{{- end }}
17 changes: 17 additions & 0 deletions charts/node/tests/engine_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: chainflip-node tests
templates:
- engine-statefulset.yaml
tests:
- it: should template the node statefulset
asserts:
- isKind:
of: StatefulSet
- equal:
path: spec.template.spec.containers[0].image
value: chainfliplabs/chainflip-engine:perseverance
- it: should not create a pvc if supplying an existing claim
set:
engine.persistence.existingClaim: "test"
asserts:
- notExists:
path: spec.volumeClaimTemplates
8 changes: 7 additions & 1 deletion charts/node/tests/node_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ tests:
of: StatefulSet
- equal:
path: spec.template.spec.containers[0].image
value: chainfliplabs/chainflip-node:perseverance
value: chainfliplabs/chainflip-node:perseverance
- it: should not create a pvc if supplying an existing claim
set:
node.persistence.existingClaim: "test"
asserts:
- notExists:
path: spec.volumeClaimTemplates
6 changes: 6 additions & 0 deletions charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ node:
# -- enable chaindata persistence
enabled: true

# -- reference an existing PVC
existingClaim: ""

# -- chaindata volume size
size: 100Gi

Expand Down Expand Up @@ -169,6 +172,9 @@ engine:
# -- enable chainflip-engine persistence
enabled: true

# -- reference an existing PVC
existingClaim: ""

# -- chainflip-engine volume size
size: 5Gi

Expand Down