Skip to content

Commit 382404e

Browse files
committed
set the default chainPath for common chains (kusama, westend, rococo)
1 parent 0c73612 commit 382404e

File tree

5 files changed

+43
-42
lines changed

5 files changed

+43
-42
lines changed

charts/node/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: node
33
description: A Helm chart to deploy Substrate/Polkadot nodes
44
type: application
5-
version: 5.5.2
5+
version: 5.6.0
66
maintainers:
77
- name: Parity
88
url: https://github.com/paritytech/helm-charts

charts/node/README.md.gotmpl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,6 @@ helm install polkadot-node parity/node
3131

3232
This will deploy a single Polkadot node with the default configuration.
3333

34-
### Public snapshots
35-
You can use the following public URLs to download chain snapshots:
36-
- https://snapshots.polkadot.io/polkadot-paritydb-prune
37-
- https://snapshots.polkadot.io/polkadot-rocksdb-prune
38-
- https://snapshots.polkadot.io/polkadot-rocksdb-archive
39-
- https://snapshots.polkadot.io/kusama-paritydb-prune
40-
- https://snapshots.polkadot.io/kusama-rocksdb-prune
41-
- https://snapshots.polkadot.io/kusama-rocksdb-archive
42-
- https://snapshots.polkadot.io/westend-paritydb-archive
43-
- https://snapshots.polkadot.io/westend-paritydb-prune
44-
- https://snapshots.polkadot.io/westend-rocksdb-prune
45-
- https://snapshots.polkadot.io/westend-rocksdb-archive
46-
- https://snapshots.polkadot.io/westend-collectives-rocksdb-archive
47-
48-
For example, to restore Polkadot pruned snapshot running ParityDB, configure chart values like the following:
49-
```yaml
50-
node:
51-
chain: polkadot
52-
role: full
53-
chainData:
54-
chainSnapshot:
55-
enabled: true
56-
method: http-filelist
57-
url: https://snapshots.polkadot.io/polkadot-paritydb-prune
58-
pruning: 256
59-
```
60-
61-
Polkadot and Kusama backups are pruned at 256 blocks. Westend backups are pruned at 1000 blocks.
62-
6334
### Resizing the node disk
6435

6536
To resize the node persistent volume, perform the following steps:

charts/node/templates/_helpers.tpl

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Common labels
3737
helm.sh/chart: {{ include "node.chart" . }}
3838
{{ include "node.selectorLabels" . }}
3939
{{ include "node.serviceLabels" . }}
40-
app.kubernetes.io/version: {{ .Values.image.tag | quote }}
40+
app.kubernetes.io/version: {{ .Chart.Version | quote }}
4141
app.kubernetes.io/managed-by: {{ .Release.Service }}
4242
{{- if or .Values.node.chainData.pruning ( not ( kindIs "invalid" .Values.node.chainData.pruning ) ) }}
4343
{{- if ge ( int .Values.node.chainData.pruning ) 1 }}
@@ -94,6 +94,36 @@ Create the database path depending on the database backend in use (rocksdb or pa
9494
{{- end }}
9595
{{- end }}
9696

97+
{{/*
98+
Set directory path for known chains
99+
*/}}
100+
{{- define "node.chainPath" -}}
101+
{{- if eq .Values.node.chain "kusama" -}}
102+
ksmcc3
103+
{{- else if eq .Values.node.chain "rococo" -}}
104+
rococo_v2_2
105+
{{- else if eq .Values.node.chain "westend" -}}
106+
westend2
107+
{{- else -}}
108+
{{- .Values.node.chain -}}
109+
{{- end -}}
110+
{{- end -}}
111+
112+
{{/*
113+
Set directory path for known relaychains
114+
*/}}
115+
{{- define "node.collatorRelayChainPath" -}}
116+
{{- if eq .Values.node.collatorRelayChain.chain "kusama" -}}
117+
ksmcc3
118+
{{- else if eq .Values.node.collatorRelayChain.chain "rococo" -}}
119+
rococo_v2_2
120+
{{- else if eq .Values.node.collatorRelayChain.chain "westend" -}}
121+
westend2
122+
{{- else -}}
123+
{{- .Values.node.collatorRelayChain.chain -}}
124+
{{- end -}}
125+
{{- end -}}
126+
97127
{{/*
98128
Define a regex matcher to check if the passed node flags are managed by the chart already
99129
*/}}

charts/node/templates/statefulset.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{{ $selectorLabels := include "node.selectorLabels" . }}
33
{{ $serviceLabels := include "node.serviceLabels" . }}
44
{{ $serviceAccountName := include "node.serviceAccountName" . }}
5+
{{ $chainPath := include "node.chainPath" . }}
6+
{{ $collatorRelayChainPath := include "node.collatorRelayChainPath" . }}
57
{{ $databasePath := include "node.databasePath" . }}
68
{{ $chartManagedFlagsRegex := include "node.chartManagedFlagsRegex" . }}
79
apiVersion: apps/v1
@@ -138,7 +140,7 @@ spec:
138140
fi
139141
env:
140142
- name: CHAIN_PATH
141-
value: {{ default .Values.node.chain .Values.node.chainData.chainPath }}
143+
value: {{ default $chainPath .Values.node.chainData.chainPath }}
142144
- name: METHOD
143145
value: {{ .Values.node.chainData.chainSnapshot.method }}
144146
{{- with .Values.initContainers.downloadChainSnapshot.extraEnvVars }}
@@ -207,7 +209,7 @@ spec:
207209
fi
208210
env:
209211
- name: RELAY_CHAIN_PATH
210-
value: {{ default .Values.node.collatorRelayChain.chain .Values.node.collatorRelayChain.chainData.chainPath }}
212+
value: {{ default $collatorRelayChainPath .Values.node.collatorRelayChain.chainData.chainPath }}
211213
- name: METHOD
212214
value: {{ .Values.node.collatorRelayChain.chainData.chainSnapshot.method }}
213215
{{- with .Values.initContainers.downloadChainSnapshot.extraEnvVars }}

charts/node/values.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ extraLabels: {}
1010
# -- Image of Polkadot Node.
1111
image:
1212
# -- Image repository
13-
repository: parity/polkadot
13+
repository:
1414
# -- Image tag
15-
tag: latest
15+
tag:
1616
# -- Image pull policy
1717
pullPolicy: Always
1818
# -- Adds `-x` shell option to container.
@@ -147,7 +147,6 @@ ingress:
147147
# hosts:
148148
# - chart-example.local
149149

150-
151150
# -- Deploy a substrate node.
152151
# ref: https://docs.substrate.io/tutorials/v3/private-network/
153152
node:
@@ -168,7 +167,6 @@ node:
168167
# -- Can be an int or a %
169168
maxUnavailable: 1
170169

171-
172170
# -- Node may require custom name for chainspec file.
173171
# ref: moonbeam https://github.com/PureStake/moonbeam/issues/1104#issuecomment-996787548
174172
# Note: path should start with /chain-data/ since this folder mount in init container download-chainspec.
@@ -192,7 +190,7 @@ node:
192190
chainPath:
193191
# -- Storage class to use for persistent volume
194192
storageClass: ""
195-
# -- Size of the volume for chain data
193+
# -- Size of the chain data volume
196194
volumeSize: 100Gi
197195
# -- Annotations to add to the volumeClaimTemplates
198196
annotations: {}
@@ -202,7 +200,7 @@ node:
202200
# -- Enable chain snapshot restoration
203201
enabled: false
204202
# -- Restoration method. One of: gcs, s3, http-single-tar, http-single-tar-lz4, http-filelist
205-
method: gcs
203+
method: http-filelist
206204
# -- A URL to download chain backup
207205
url: ""
208206
# -- A remote file name containing names of DB file chunks. Appended to `url`
@@ -367,7 +365,7 @@ node:
367365
# secretName: existing-node-secret
368366
# secretKey: my-node-key
369367

370-
# -- Component to inject secrets via annotation of Hashicorp Vault
368+
# -- Inject secrets via Hashicorp Vault annotations
371369
# ref: https://www.vaultproject.io/docs/platform/k8s/injector/annotations
372370
vault:
373371
# -- Configures the authentication path for the Kubernetes auth method
@@ -404,9 +402,9 @@ node:
404402
# vaultKey: key
405403
# vaultKeyAppendPodIndex: false
406404

407-
# -- If enabled, generate a persistent volume to use for the keys
405+
# -- If enabled, generate and persist a node-key in the keystore volume
408406
persistGeneratedNodeKey: false
409-
# -- Name of the secret containig the key
407+
# -- Node key secret string (this option should be limited to development and testing as it will leak the node key secret in the helm config)
410408
customNodeKey:
411409

412410
# -- Expose metrics via Prometheus format in /metrics endpoint.

0 commit comments

Comments
 (0)