diff --git a/labsim/cilium-ipam-switch.sh b/labsim/cilium-ipam-switch.sh index e703343..144cd0f 100755 --- a/labsim/cilium-ipam-switch.sh +++ b/labsim/cilium-ipam-switch.sh @@ -12,6 +12,25 @@ # ./cilium-ipam-switch.sh verify compare against preflight, report renumbering # # KUBECONFIG=... ./cilium-ipam-switch.sh preflight +# +# Whether a recycle is needed is CONDITIONAL, and `verify` is what decides it. +# +# The operator does not preserve which node held which /24 -- it adopts whatever +# CiliumNode.spec.ipam.podCIDRs already says. So: +# +# * If CiliumNode already agrees with node.spec.podCIDRs on every node -- which +# is the case for any cluster that has only ever run ipam=kubernetes, because +# the operator syncs one from the other -- the pool adopts the existing +# allocation, no node is renumbered, and NO pod recycle is needed. Verified +# on the 3-node labsim cluster: CIDRs unchanged, nothing stranded, the only +# blip was the cilium DaemonSet restarting itself. +# +# * If the two sources DISAGREE, nodes can swap /24s. Their running pods keep +# addresses that no longer fall inside the node's range, every other node +# routes that prefix to the wrong node, and those pods go unreachable +# cross-node while still showing Running. Then a full recycle is mandatory. +# +# Do not skip `verify` on the assumption of the good case. Run it and read it. set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" STATE="${STATE:-$SCRIPT_DIR/.ipam-switch-state}"