-
-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] v5.0.0 Sporadic cluster creation failures when trying to inject host IP #772
Comments
Install version 4.X.X for now, since 5.0.0 new release removed the --no-hostip flag and it seems to be failing in the CI with an error similar to k3d-io/k3d#772
I guess when a cluster is created with agents, it buys some time for agents to join and patch cm works function _patch_coredns() {
local _br_gateway_ip=$(docker network inspect k3d-$CLUSTER_NAME --format '{{range .IPAM.Config}}{{.Gateway}}{{end}}')
owarn "Wait for core-dns configmap to be available before trying to patch"
until kubectl -n kube-system get cm coredns &>/dev/null
do
sleep 2
done
kubectl -n kube-system get cm coredns -o yaml > coredns.yaml
if grep -q "NodeHosts" "coredns.yaml" && grep -q ".*${k3d-*-server-0}" "coredns.yaml"; then
owarn "Patching core-dns configmap to include '${_br_gateway_ip} host.k3d.internal'"
cat coredns.yaml | sed -e "s/NodeHosts: |/NodeHosts: |\n ${_br_gateway_ip} host.k3d.internal/g" > coredns-patched.yaml
kubectl -n kube-system apply -f coredns-patched.yaml 2>/dev/null
rm coredns.yaml coredns-patched.yaml
else
log "core-dns configmap already patched"
fi
return 0
} |
I'm hitting this also, as long as I set (And trying to debug it, I run into this: #750 ) |
@josephprem , thanks for opening this issue! |
Hi @iwilltry42 running with --trace or --verbose crashes unfortunately with a seg fault . Will try v5.0.1-rc.0 and capture the logs |
Hey there, please also give https://github.com/rancher/k3d/releases/tag/v5.0.1-rc.1 a try. |
Using the same OS/Arch it worked perfectly. I repeated it a couple of times with no issues Version:
Output:
@iwilltry42 looking good!! |
I hope that others experience the same improvement as @jrhoward , so I'll go ahead and close this issue for now. |
Thanks a lot @iwilltry42 was busy lately. just tried today and confirm all my five tries worked without issues
|
Related Issues
Original Issue
Cluster creation fails when trying to patch core-dns configmap.
I am not sure how async the deployment of core-dns is. The core-dns cm may not be available when the function to patch the configmap is called.
Moreover, in v5.0.0 --no-host-ip (disableHostIPInjection) is removed and hence there is no consistent way to workaround this issue
What did you do
k3d cluster create --config config.yaml
config yaml
What did you expect to happen
Expect to cluster creation to be successful
Screenshots or terminal output
Which OS & Architecture
Which version of
k3d
Which version of docker
docker version
anddocker info
The text was updated successfully, but these errors were encountered: