Skip to content

Commit 1c8ec51

Browse files
committed
fix(charts): update chainId and security context documentation in values.yaml
- Added chainId field to network-bootstrapper values for explicit configuration. - Updated comments in values.yaml to ensure clarity and compatibility with helm-docs. - Adjusted security context documentation to reflect changes in the configuration structure.
1 parent 204d647 commit 1c8ec51

5 files changed

Lines changed: 22 additions & 6 deletions

File tree

charts/network/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ A Helm chart for a blockchain network on Kubernetes
2121

2222
| Key | Type | Default | Description |
2323
|-----|------|---------|-------------|
24-
| global | object | `{"networkNodes":{"faucetArtifactPrefix":"besu-faucet","genesisConfigMapName":"besu-genesis","podPrefix":"","serviceName":"","staticNodesConfigMapName":"besu-static-nodes"},"securityContexts":{"container":{},"pod":{}}}` | Global configuration shared across subcharts. |
24+
| global | object | `{"chainId":null,"networkNodes":{"faucetArtifactPrefix":"besu-faucet","genesisConfigMapName":"besu-genesis","podPrefix":"","serviceName":"","staticNodesConfigMapName":"besu-static-nodes"},"securityContexts":{"container":{},"pod":{}}}` | Global configuration shared across subcharts. |
25+
| global.chainId | int | `nil` | Chain ID applied when charts omit explicit overrides. |
2526
| global.networkNodes | object | `{"faucetArtifactPrefix":"besu-faucet","genesisConfigMapName":"besu-genesis","podPrefix":"","serviceName":"","staticNodesConfigMapName":"besu-static-nodes"}` | Defaults consumed by Besu network node workloads. |
2627
| global.networkNodes.faucetArtifactPrefix | string | `"besu-faucet"` | Prefix used for faucet ConfigMaps and Secrets. |
2728
| global.networkNodes.genesisConfigMapName | string | `"besu-genesis"` | ConfigMap name storing the generated genesis.json artifact. |

charts/network/charts/network-bootstrapper/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ A Helm chart for Kubernetes
2323
| artifacts.external.validators | list | `[]` | Validator node definitions providing the data expected by the nodes chart. Each entry must include `address`, `publicKey`, `privateKey`, and `enode`. |
2424
| artifacts.source | string | `"generated"` | Determines how Besu network artifacts are populated. Use `generated` to run the job or `external` to supply values manually. |
2525
| fullnameOverride | string | `"bootstrapper"` | Override for the fully qualified resource name generated by helpers. |
26+
| global.chainId | int | `nil` | Chain ID applied when `settings.chainId` is unset. |
2627
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy controlling when Kubernetes fetches updated image layers. |
2728
| image.repository | string | `"ghcr.io/settlemint/network-bootstrapper"` | OCI registry path hosting the network bootstrapper image. |
2829
| image.tag | string | `""` | Image tag override; leave empty to inherit the chart appVersion. |
@@ -41,7 +42,7 @@ A Helm chart for Kubernetes
4142
| serviceAccount.create | bool | `true` | Create a ServiceAccount resource for the release automatically. |
4243
| serviceAccount.name | string | `""` | Existing ServiceAccount name to reuse instead of creating one. |
4344
| settings.allocations | string | `nil` | Path to a JSON allocations file providing pre-funded accounts. |
44-
| settings.chainId | int | `nil` | Explicit chain ID to encode into the genesis file. |
45+
| settings.chainId | int | `nil` | Explicit chain ID to encode into the genesis file. Leave unset to inherit from global.chainId. |
4546
| settings.clusterDomain | string | `"svc.cluster.local"` | Kubernetes DNS suffix appended to generated static node hostnames when unset by the CLI. |
4647
| settings.consensus | string | `nil` | Consensus engine to configure (QBFT or IBFTv2). |
4748
| settings.contractSizeLimit | int | `nil` | Maximum smart-contract bytecode size accepted by the EVM. |

charts/network/charts/network-bootstrapper/templates/job.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ spec:
5555
{{- $resolvedStaticDomain := default $clusterDomain .Values.settings.staticNodeDomain }}
5656
{{- $resolvedStaticPort := default $defaultStaticPort .Values.settings.staticNodePort }}
5757
{{- $resolvedStaticDiscovery := default $defaultStaticDiscovery .Values.settings.staticNodeDiscoveryPort }}
58-
{{- $globalNodes := default (dict) .Values.global.networkNodes }}
58+
{{- $globalValues := default (dict) .Values.global }}
59+
{{- $settingsValues := default (dict) .Values.settings }}
60+
{{- $globalNodes := default (dict) (get $globalValues "networkNodes") }}
61+
{{- $localChainId := get $settingsValues "chainId" }}
62+
{{- $globalChainId := get $globalValues "chainId" }}
63+
{{- $localChainIdSet := not (kindIs "invalid" $localChainId) }}
64+
{{- $globalChainIdSet := not (kindIs "invalid" $globalChainId) }}
65+
{{- $resolvedChainId := ternary $localChainId $globalChainId $localChainIdSet }}
5966
{{- $autoNames := dict "service" "besu-node" "podPrefix" "besu-node-validator" }}
6067
{{- with (index $.Subcharts "network-nodes") }}
6168
{{- $service := include "nodes.fullname" . }}
@@ -92,8 +99,8 @@ spec:
9299
{{- with .Values.settings.consensus }}
93100
- --consensus={{ . }}
94101
{{- end }}
95-
{{- with .Values.settings.chainId }}
96-
- --chain-id={{ . }}
102+
{{- if or $localChainIdSet $globalChainIdSet }}
103+
- --chain-id={{ $resolvedChainId }}
97104
{{- end }}
98105
{{- with .Values.settings.secondsPerBlock }}
99106
- --seconds-per-block={{ . }}

charts/network/charts/network-bootstrapper/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Default configuration values for the network-bootstrapper subchart. Each key is annotated for helm-docs output.
2+
3+
global:
4+
# -- (int) Chain ID applied when `settings.chainId` is unset.
5+
chainId:
6+
27
image:
38
# -- (string) OCI registry path hosting the network bootstrapper image.
49
repository: ghcr.io/settlemint/network-bootstrapper
@@ -152,7 +157,7 @@ settings:
152157
outputType: kubernetes
153158
# -- (string) Consensus engine to configure (QBFT or IBFTv2).
154159
consensus:
155-
# -- (int) Explicit chain ID to encode into the genesis file.
160+
# -- (int) Explicit chain ID to encode into the genesis file. Leave unset to inherit from global.chainId.
156161
chainId:
157162
# -- (int) Block interval in seconds for the genesis configuration.
158163
secondsPerBlock:

charts/network/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ global:
1414
staticNodesConfigMapName: besu-static-nodes
1515
# -- (string) Prefix used for faucet ConfigMaps and Secrets.
1616
faucetArtifactPrefix: besu-faucet
17+
# -- (int) Chain ID applied when charts omit explicit overrides.
18+
chainId:
1719
# -- (object) Shared pod- and container-level security contexts applied when subcharts omit explicit overrides.
1820
securityContexts:
1921
# -- (object) Pod security context inherited by subcharts when set.

0 commit comments

Comments
 (0)