diff --git a/01-kind-cluster.sh b/01-kind-cluster.sh index 3f594fb..4d03f2b 100755 --- a/01-kind-cluster.sh +++ b/01-kind-cluster.sh @@ -20,3 +20,10 @@ else echo "kind cluster already running" fi kubectl cluster-info +KINDMTU=$(docker network inspect kind | jq -r '.[] | .Options."com.docker.network.driver.mtu"') +if test $KINDMTU -gt $DOCKERMTU; then + echo -e "\e[0;31mWARNING: Found kind MTU $KINDMTU > docker0 $DOCKERMTU\e[0;0m" + ehoc " Consider setting { \"mtu\": $((8*($CLOUDMTU/8))) } in /etc/docker/daemon.json" + echo " and restart docker and do docker network rm kind ..." + echo "If you see ImagePullBackOff and ImagePullErrors, you now know why." +fi diff --git a/08-create-cluster.sh b/08-create-cluster.sh index b651eb0..a1a9c0a 100755 --- a/08-create-cluster.sh +++ b/08-create-cluster.sh @@ -11,6 +11,7 @@ else fi # Read settings -- make sure you can trust it source "$SET" +unset KUBECONFIG # Sanity checks if test -z "$CS_MAINVER"; then echo "Configure CS_MAINVER"; exit 2; fi if test -z "$CS_VERSION"; then echo "Configure CS_VERSION"; exit 3; fi diff --git a/22-sonobuoy.sh b/22-sonobuoy.sh index 4763c85..3413ae6 100755 --- a/22-sonobuoy.sh +++ b/22-sonobuoy.sh @@ -1,3 +1,29 @@ #!/bin/bash +# (c) Kurt Garloff , 11/2025 +# SPDX-License-Identifier: CC-BY-SA-4.0 +set -e +THISDIR=$(dirname $0) +# We need settings +unset KUBECONFIG +if test -n "$1"; then + SET="$1" +else + if test -e cluster-settings.env; then SET=cluster-settings.env; + else echo "You need to pass a cluster-settings.env file as parameter"; exit 1 + fi +fi +# Read settings -- make sure you can trust it +source "$SET" +# Use workload cluster +export KUBECONFIG=~/.kube/$CS_NAMESPACE.$CL_NAME +# Install sonobuoy into ~/bin/ if needed +if ! type -p "sonobuoy" >/dev/null 2>&1; then + cd ~ + curl -LO https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.57.3/sonobuoy_0.57.3_linux_amd64.tar.gz + tar xvzf sonobuoy_0.57.3_linux_amd64.tar.gz + mkdir -p bin + sudo mv sonobuoy bin + if ! echo "$PATH" | grep "$HOME/bin" >/dev/null; then export PATH="$PATH:~/bin"; fi +fi # See also https://github.com/SovereignCloudStack/standards/issues/982 sonobuoy run --plugin-env=e2e.E2E_PROVIDER=openstack --e2e-skip="\[Disruptive\]|NoExecuteTaintManager|HostPort validates that there is no conflict between pods with same hostPort but different hostIP and protocol" diff --git a/23-wait-sonobuoy.sh b/23-wait-sonobuoy.sh new file mode 100755 index 0000000..6777625 --- /dev/null +++ b/23-wait-sonobuoy.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# (c) Kurt Garloff , 11/2025 +# SPDX-License-Identifier: CC-BY-SA-4.0 +set -e +THISDIR=$(dirname $0) +# We need settings +unset KUBECONFIG +if test -n "$1"; then + SET="$1" +else + if test -e cluster-settings.env; then SET=cluster-settings.env; + else echo "You need to pass a cluster-settings.env file as parameter"; exit 1 + fi +fi +# Read settings -- make sure you can trust it +source "$SET" +# Use workload cluster +export KUBECONFIG=~/.kube/$CS_NAMESPACE.$CL_NAME +if ! type -p sonobuoy >/dev/null 2>/dev/null; then export PATH="$PATH:~/bin"; fi +SB=$(sonobuoy status) +while true; do + echo "$SB" + if ! echo "$SB" | grep "still running" >/dev/null; then break; fi + sleep 30 + SB=$(sonobuoy status) +done +sonobuoy retrieve +RES=$(ls -t 20*sonobuoy*.tar.gz | head -n1) +sonobuoy results $RES +NRPASSED=$(echo "$SB" | awk '{ print $3; }' | grep passed | wc -l) +test $NRPASSED = 2