Skip to content

Commit

Permalink
Merge pull request #16 from paritytech/node-role
Browse files Browse the repository at this point in the history
Allow setting the node role in the chart options
  • Loading branch information
PierreBesson authored Sep 14, 2021
2 parents 0b6c026 + c171606 commit 6ae66c3
Show file tree
Hide file tree
Showing 5 changed files with 18 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 @@ -2,5 +2,5 @@ apiVersion: v2
name: node
description: A Helm chart to deploy Substrate/Polkadot nodes
type: application
version: 0.11.0
version: 0.12.0
appVersion: "0.0.1"
1 change: 1 addition & 0 deletions charts/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ helm install kusama-node parity/node --set node.chainDataSnapshotUrl=https://ksm
| `node.enableReadinessProbe` | If true, enable the readiness probe check | `true` |
| `node.dataVolumeSize` | The size of the chain data PersistentVolume | `100Gi` |
| `node.replica` | Number of replica in the node StatefulSet | `1` |
| `node.role` | Set the role of the node: `full`, `authority` (for validators) or `light` | `full` |
| `node.chainDataSnapshotUrl` | Download and load chain data from a snapshot archive http URL | `` |
| `node.chainDataSnapshotExtractionPath` | The path at which the snapshot archive downloaded from a http URL will be extracted | `/data/chains/${CHAIN_PATH}` |
| `node.chainDataSnapshotFormat` | The snapshot archive format (`tar` or `7z`) | `tar` |
Expand Down
1 change: 1 addition & 0 deletions charts/node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Service labels
{{- define "chart.serviceLabels" -}}
chain: {{ .Values.node.chain }}
release: {{ .Release.Name }}
role: {{ .Values.node.role }}
{{- end }}

{{/*
Expand Down
16 changes: 14 additions & 2 deletions charts/node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,28 @@ spec:
--name=${POD_NAME} \
--base-path=/data/ \
--chain=${CHAIN} \
{{- if eq .Values.node.role "authority" }}
--validator \
{{- end }}
{{- if eq .Values.node.role "light" }}
--light \
{{- end }}
--listen-addr={{ .Values.node.perNodeServices.listenAddressBase }}${P2P_PORT} \
{{- if .Values.node.persistGeneratedNodeKey }}
--node-key-file /data/node-key" \
--node-key-file /data/node-key \
{{- end }}
{{- join " " .Values.node.flags | nindent 18 }}
{{- join " " .Values.node.flags | nindent 16 }}
{{- else }}
args:
- --name=$(POD_NAME)
- --base-path=/data/
- --chain=$(CHAIN)
{{- if eq .Values.node.role "authority" }}
- --validator
{{- end }}
{{- if eq .Values.node.role "light" }}
- --light \
{{- end }}
{{- if .Values.node.persistGeneratedNodeKey }}
- --node-key-file=/data/node-key
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ node:
command: "polkadot"
dataVolumeSize: 100Gi
replicas: 1
role: full
#chainDataSnapshotUrl: ""
chainDataSnapshotExtractionPath: "/data/chains/${CHAIN_PATH}"
chainDataSnapshotFormat: tar
Expand Down

0 comments on commit 6ae66c3

Please sign in to comment.