diff --git a/charts/tezos/templates/configs.yaml b/charts/tezos/templates/configs.yaml index 2d33db835..ec52444e1 100644 --- a/charts/tezos/templates/configs.yaml +++ b/charts/tezos/templates/configs.yaml @@ -15,6 +15,8 @@ data: ROLLING_SNAPSHOT_URL: "{{ .Values.rolling_snapshot_url }}" ARCHIVE_TARBALL_URL: "{{ .Values.archive_tarball_url }}" ROLLING_TARBALL_URL: "{{ .Values.rolling_tarball_url }}" + NODE_GLOBALS: | +{{ .Values.node_globals | mustToPrettyJson | indent 4 }} NODES: | {{ .Values.nodes | mustToPrettyJson | indent 4 }} SIGNERS: | diff --git a/charts/tezos/values.yaml b/charts/tezos/values.yaml index 172d8c8ad..ac9f25698 100644 --- a/charts/tezos/values.yaml +++ b/charts/tezos/values.yaml @@ -97,10 +97,18 @@ accounts: {} ## automatically for you. ## ## -## Defaults are filled in for most of the above values. +## Defaults are filled in for most of the above values. You can also provide +## global defaults for all nodes via a node_globals: section which is also +## a dictionary. Currently, the only key defined is "config" which provides +## a default for that section in the nodes:. ## ## Example config: ## +# +# node_globals: +# config: +# shell: +# history_mode: full # nodes: # tezos-baking-node: # labels: diff --git a/utils/config-generator.py b/utils/config-generator.py index 10c372767..d9246aaba 100755 --- a/utils/config-generator.py +++ b/utils/config-generator.py @@ -15,13 +15,15 @@ ACCOUNTS = json.loads(os.environ["ACCOUNTS"]) CHAIN_PARAMS = json.loads(os.environ["CHAIN_PARAMS"]) +NODE_GLOBALS = json.loads(os.environ["NODE_GLOBALS"]) or {} NODES = json.loads(os.environ["NODES"]) SIGNERS = json.loads(os.environ["SIGNERS"]) MY_POD_NAME = os.environ["MY_POD_NAME"] MY_POD_TYPE = os.environ["MY_POD_TYPE"] -MY_POD_CONFIG = None +MY_POD_CLASS = {} +MY_POD_CONFIG = {} ALL_NODES = {} BAKING_NODES = {} @@ -31,6 +33,7 @@ name = f"{cl}-{i}" ALL_NODES[name] = inst if name == MY_POD_NAME: + MY_POD_CLASS = val MY_POD_CONFIG = inst if "runs" in val: if "baker" in val["runs"]: @@ -525,7 +528,6 @@ def create_node_config_json( ): """Create the node's config.json file""" - values_node_config = MY_POD_CONFIG.get("config", {}) computed_node_config = { "data-dir": "/var/tezos/node/data", "rpc": { @@ -538,7 +540,10 @@ def create_node_config_json( }, # "log": {"level": "debug"}, } - node_config = recursive_update(values_node_config, computed_node_config) + node_config = NODE_GLOBALS.get("config", {}) + node_config = recursive_update(node_config, MY_POD_CLASS.get("config", {})) + node_config = recursive_update(node_config, MY_POD_CONFIG.get("config", {})) + node_config = recursive_update(node_config, computed_node_config) if THIS_IS_A_PUBLIC_NET: # `tezos-node config --network ...` will have been run in config-init.sh