|
| 1 | +# Configuration value propagation |
| 2 | + |
| 3 | +This flowchart illustrates the process of how values for the Bitcoin Core module are handled and deployed using Helm in a Kubernetes environment. |
| 4 | + |
| 5 | +The process is similar for other modules (e.g. fork-observer), but may differ slightly in filenames. |
| 6 | + |
| 7 | +- The process starts with the `values.yaml` file, which contains default values for the Helm chart. |
| 8 | +- There's a decision point to check if user-provided values are available. |
| 9 | + These are found in the following files: |
| 10 | + - For config applied to all nodes: `<network_name>/node-defaults.yaml` |
| 11 | + - For network and per-node config: `<network_name>/network.yaml` |
| 12 | + |
| 13 | +> [!TIP] |
| 14 | +> `values.yaml` can be overridden by `node-defaults.yaml` which can be overridden in turn by `network.yaml`. |
| 15 | +
|
| 16 | +- If user-provided values exist, they override the defaults from `values.yaml`. If not, the default values are used. |
| 17 | +- The resulting set of values (either default or overridden) becomes the final set of values used for deployment. |
| 18 | +- These final values are then passed to the Helm templates. |
| 19 | +- The templates (`configmap.yaml`, `service.yaml`, `servicemonitor.yaml`, and `pod.yaml`) use these values to generate the Kubernetes resource definitions. |
| 20 | +- Helm renders these templates, substituting the values into the appropriate places. |
| 21 | +- The rendering process produces the final Kubernetes manifest files. |
| 22 | +- Helm then applies these rendered manifests to the Kubernetes cluster. |
| 23 | +- Kubernetes processes these manifests and creates or updates the corresponding resources in the cluster. |
| 24 | +- The process ends with the resources being deployed or updated in the Kubernetes cluster. |
| 25 | + |
| 26 | +```mermaid |
| 27 | + graph TD |
| 28 | + A[Start] --> B[values.yaml] |
| 29 | + subgraph User Configuration [user config: bottom overrides top] |
| 30 | + C[node-defaults.yaml] |
| 31 | + D[network.yaml] |
| 32 | + end |
| 33 | + B --> C |
| 34 | + C --> D |
| 35 | + D --> F[Final values] |
| 36 | + F --> I[Templates] |
| 37 | + I --> J[configmap.yaml] |
| 38 | + I --> K[service.yaml] |
| 39 | + I --> L[servicemonitor.yaml] |
| 40 | + I --> M[pod.yaml] |
| 41 | + J --> N[Helm renders templates] |
| 42 | + K --> N |
| 43 | + L --> N |
| 44 | + M --> N |
| 45 | + N --> O[Rendered Kubernetes manifests] |
| 46 | + O --> P[Helm applies manifests to Kubernetes] |
| 47 | + P --> Q[Kubernetes creates/updates resources] |
| 48 | + Q --> R[Resources deployed/updated in cluster] |
| 49 | +``` |
| 50 | + |
| 51 | +Users should only concern themselves therefore with setting configuration in the `<network_name>/[network|node-defaults].yaml` files. |
0 commit comments