UNCLASSIFIED - NO CUI

k3d-dev.sh race conditions, k3d hang, and unclear /etc/hosts instructions

Several issues in k3d-dev.sh cause intermittent failures and a confusing post-deployment experience:

Race conditions

  • kubectl create for MetalLB IPAddressPool/L2Advertisement resources fires before the CRDs are registered, causing sporadic "no matches for kind" errors
  • Proxy container startup is chained in the same batch as MetalLB config — if config fails, proxies are silently skipped
  • kubectl create configmap coredns-custom fails on reruns because the configmap already exists (not idempotent)

k3d cluster create hang

  • ssh -t in run_batch_execute allocates a pseudo-TTY for non-interactive batch scripts, which can cause the session to hang waiting for background processes to exit
  • k3d cluster create itself occasionally hangs indefinitely on agent readiness (upstream k3d-io/k3d#1420), with no timeout to detect or recover from the stall

Unclear /etc/hosts output

  • When using dual public IPs (-a), the instructions don't clearly label which IP maps to which Istio gateway, making it easy to put the wrong domains on the wrong IP
Edited by Daniel Pritchett