Skip to content

Commit

Permalink
Merge pull request #2 from chainflip-io/chore/add-custom-claim
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjohnburton committed Aug 10, 2023
2 parents bc24c4c + 69365a2 commit ac1df15
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
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

0 comments on commit ac1df15

Please sign in to comment.