fix: Update README with new k3d cluster creation command to work with…#73
Conversation
… lower MTU networks
There was a problem hiding this comment.
Pull request overview
Updates the README’s k3d cluster bootstrap command to pre-create a dedicated Docker bridge network with a lower MTU, improving reliability in lower-MTU environments.
Changes:
- Adds deletion/recreation of a
k3d-glueops-netDocker network before creating the cluster - Sets the Docker network MTU to
1400viacom.docker.network.driver.mtu
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Run: | ||
| ```bash | ||
| k3d cluster delete captain || true && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | ||
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
There was a problem hiding this comment.
This single-line command is getting quite long and hard to troubleshoot when one step fails. Splitting it across multiple lines (continuations) or separating into a small script section in the README would improve readability and make failures easier for users to pinpoint.
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | |
| k3d cluster delete captain || true && \ | |
| docker network rm k3d-glueops-net || true && \ | |
| docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && \ | |
| curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && \ | |
| k3d cluster create --config k3d-config.yaml && \ | |
| bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
| Run: | ||
| ```bash | ||
| k3d cluster delete captain || true && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | ||
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
There was a problem hiding this comment.
The docker network rm ... || true can mask a failed removal (e.g., network still has active endpoints). In that case the subsequent docker network create ... k3d-glueops-net will fail because the network name already exists, stopping the whole chain. Consider either (1) making the create step tolerant of an existing network, or (2) explicitly detecting/remediating the “network in use” case and telling the user what to do (remove endpoints / pick a different network name) so the command is reliable.
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | |
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && (docker network inspect k3d-glueops-net >/dev/null 2>&1 || docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net) && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
| Run: | ||
| ```bash | ||
| k3d cluster delete captain || true && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | ||
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
There was a problem hiding this comment.
The curl https://... -o k3d-config.yaml download does not fail the command chain on HTTP errors (e.g., 404/500), which can lead to creating a cluster with an invalid/HTML config file. Using curl’s “fail on HTTP error” option (and keeping the rest of the pipeline unchanged) would make this setup command safer and easier to debug.
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) | |
| k3d cluster delete captain || true && docker network rm k3d-glueops-net || true && docker network create --driver bridge --opt com.docker.network.driver.mtu=1400 k3d-glueops-net && curl -f https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh) |
… lower MTU networks