k8s: REGION in config.env; the no-public-address warning names --announce

REGION (place names or geohashes, comma separated) is passed to the node by the StatefulSet script, which now builds its arguments with set -- so a region is optional and PUBLIC_HOST must be set. The warning for a --public node without a public address now says which case it is (no --announce, or one that is not reachable) and the flag that fixes it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 23:37:55 +01:00
co-authored by Claude Sonnet 5.5
parent 4e7cbd3dbd
commit 803202e94e
6 changed files with 80 additions and 8 deletions
+15 -3
View File
@@ -34,13 +34,19 @@ spec:
# bootstrap node has nothing to recover; its identity is its peer ID,
# which lives on the volume). Then run as a bootstrap node: --public
# serves the DHT and relays for nodes behind a NAT, --announce names
# the address the router forwards.
# the address the router forwards, and REGION (config.env) the regions
# to keep listings for, if any.
#
# When you edit this script: every line of the `set --` command but
# the last ends in a backslash. A missing one cuts the command short
# and silently drops the flags below it (--announce above all); the
# node then logs "--public, but this node has no public address".
command: ["/bin/sh", "-c"]
args:
- |
: "${PUBLIC_HOST:?set PUBLIC_HOST in k8s/base/config.env}"
[ -f /data/admin.token ] || allmende init --no-phrase
exec allmende run \
--public \
set -- --public \
--no-default-bootstrap \
--no-mdns \
--no-login-link \
@@ -49,6 +55,12 @@ spec:
--listen /ip4/0.0.0.0/udp/4001/quic-v1 \
--announce "/dns4/${PUBLIC_HOST}/tcp/${PUBLIC_PORT}" \
--announce "/dns4/${PUBLIC_HOST}/udp/${PUBLIC_PORT}/quic-v1"
if [ -n "${REGION}" ]; then
set -f; IFS=,
for r in ${REGION}; do set -- "$@" --region "$r"; done
unset IFS; set +f
fi
exec allmende run "$@"
envFrom:
- configMapRef:
name: allmende-config