Skip to content

Commit

Permalink
Set node config for pods without dedicated instance configs (#507)
Browse files Browse the repository at this point in the history
In combination with a horizontal pod autoscaler (not supported in tezos-k8s yet),
this will ensure that any additional replicas spun up by the autoscaler will also
be configured according to the statefulset-level config in values.yaml (and node_globals as well)
  • Loading branch information
puppetninja authored Dec 12, 2022
1 parent d78f73f commit 47e4db7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
if "baker" in val["runs"]:
BAKING_NODES[name] = inst

# MY_POD_CLASS is not set after iterating nodes configurations,
# this can happen when the pod is one which scaled out by autoscaler.
# Set this value to the value mapped by MY_NODE_CLASS to read possible config specified in at NODES
if not MY_POD_CLASS:
my_node_class = os.environ["MY_NODE_CLASS"]
MY_POD_CLASS = NODES[my_node_class]

if MY_POD_TYPE == "signing":
MY_POD_CONFIG = SIGNERS[MY_POD_NAME]

Expand Down

0 comments on commit 47e4db7

Please sign in to comment.