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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user