You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use k3d version 5.6.3 with rootless podman, version 4.6.1, and I had no problems creating k3d clusters for the last months but now suddenly during cluster creation the startup of the k3d containers fail.
I found out that startup of software in container is with script k3d-entrypoint.sh which first searches for additional scripts k3d-entrypoint-*.sh and executes them.
The problem I have is in script k3d-entrypoint-dns.sh. First part of the problem is the line
set -o errexit
This will end script execution immediately if a command returns with exit code not equal 0.
The second part of my problem are the lines
Here if ${docker_dns} is not found in /etc/resolv.conf the grep command terminates with 1. This case is handled in the next lines. But this next line is never executed due to set -o errexit and so the script terminates and as a result the complete startup terminates.
My question: Is that as expected or should the startup script k3d-entrypoint-dns.sh be modified to be able to handle the result of the grepcommand?
Btw, set -o errexit is set in nearly every kde-entrypoint-*.sh script. Maybe there are additional code lines with similar behavior?
Best regards
Ulrich.
The text was updated successfully, but these errors were encountered:
Additional information.
In my last post I wrote that start of cluster members failed suddenly. In the meantime I found the reason for that. Cluster member startup only fails if I have the official installation installed on my system (installed using curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash). If I build from branch main everything works fine. There is a difference in file k3d-entrypoint-dns.sh between branch main and main-v5.
From branch main (working in my case)
.
# Update resolv.conf to use the Gateway IP if needed: this will also make CoreDNS use it via k3s' default `forward . /etc/resolv.conf` rule in the CoreDNS config
if grep -q "${docker_dns}" /etc/resolv.conf; then
echo "[$(date -Iseconds)] [DNS Fix] > Replacing IP in /etc/resolv.conf ..."
.
From branch main-v5
.
# Update resolv.conf to use the Gateway IP if needed: this will also make CoreDNS use it via k3s' default `forward . /etc/resolv.conf` rule in the CoreDNS config
grep -q "${docker_dns}" /etc/resolv.conf
grepstatus=$?
if test $grepstatus -eq 0; then
.
In the working case (call of grep within "if") the exit code of the grep is handled by the if and so set -o errexit has no impact.
Please consider to at least merge the content of entrypoint-dns.sh from branch main to main-v5.
Hi,
I use k3d version 5.6.3 with rootless podman, version 4.6.1, and I had no problems creating k3d clusters for the last months but now suddenly during cluster creation the startup of the k3d containers fail.
I found out that startup of software in container is with script
k3d-entrypoint.sh
which first searches for additional scriptsk3d-entrypoint-*.sh
and executes them.The problem I have is in script
k3d-entrypoint-dns.sh
. First part of the problem is the lineThis will end script execution immediately if a command returns with exit code not equal 0.
The second part of my problem are the lines
Here if
${docker_dns}
is not found in/etc/resolv.conf
the grep command terminates with 1. This case is handled in the next lines. But this next line is never executed due toset -o errexit
and so the script terminates and as a result the complete startup terminates.My question: Is that as expected or should the startup script
k3d-entrypoint-dns.sh
be modified to be able to handle the result of thegrep
command?Btw,
set -o errexit
is set in nearly every kde-entrypoint-*.sh script. Maybe there are additional code lines with similar behavior?Best regards
Ulrich.
The text was updated successfully, but these errors were encountered: