From 853073836b9a1da9bb12faabe3840cc574957889 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Wed, 2 Oct 2024 13:07:33 +0900 Subject: [PATCH 1/2] gh-819 fixes for k3s-base-sanity intermittently failing --- .github/workflows/k3s-base-sanity.yml | 9 +++------ cicd/k3s-base-sanity/config.sh | 7 ++----- pkg/loxinet/route.go | 3 ++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/k3s-base-sanity.yml b/.github/workflows/k3s-base-sanity.yml index cde42293e..08f37688e 100644 --- a/.github/workflows/k3s-base-sanity.yml +++ b/.github/workflows/k3s-base-sanity.yml @@ -38,17 +38,14 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive - - run: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --disable traefik --disable servicelb --disable-cloud-controller --kubelet-arg cloud-provider=external" K3S_KUBECONFIG_MODE="644" sh - + - run: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --disable traefik --disable servicelb" K3S_KUBECONFIG_MODE="644" sh - - run: | - sleep 10 + sleep 20 kubectl "${{ env.KUBECONFIG }}" taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule- sleep 60 kubectl "${{ env.KUBECONFIG }}" get nodes kubectl "${{ env.KUBECONFIG }}" get pods -A - wget https://github.com/loxilb-io/loxi-ccm/raw/master/manifests/loxi-ccm-k3s.yaml - kubectl "${{ env.KUBECONFIG }}" apply -f ./loxi-ccm-k3s.yaml - sleep 60 - kubectl "${{ env.KUBECONFIG }}" get pods -A + sleep 20 - run: | cd cicd/k3s-base-sanity/ ./config.sh "${{ env.KUBECONFIG }}" diff --git a/cicd/k3s-base-sanity/config.sh b/cicd/k3s-base-sanity/config.sh index 430fa8d11..e0b997eaa 100755 --- a/cicd/k3s-base-sanity/config.sh +++ b/cicd/k3s-base-sanity/config.sh @@ -131,9 +131,9 @@ else # Install k3s without external cloud-manager and disabled servicelb #curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.22.9+k3s1 INSTALL_K3S_EXEC="server --disable traefik --disable servicelb --disable-cloud-controller --kubelet-arg cloud-provider=external" K3S_KUBECONFIG_MODE="644" sh - - curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --disable traefik --disable servicelb --disable-cloud-controller --kubelet-arg cloud-provider=external" K3S_KUBECONFIG_MODE="644" sh - + curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --disable traefik --disable servicelb" K3S_KUBECONFIG_MODE="644" sh - - sleep 10 + sleep 20 # Check kubectl works kubectl $KUBECONFIG get pods -A @@ -141,9 +141,6 @@ else # Remove taints in k3s if any (usually happens if started without cloud-manager) kubectl $KUBECONFIG taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule- - # Start loxi-ccm as k3s daemonset - kubectl $KUBECONFIG apply -f https://github.com/loxilb-io/loxi-ccm/raw/master/manifests/loxi-ccm-k3s.yaml - echo "End K3s installation" fi diff --git a/pkg/loxinet/route.go b/pkg/loxinet/route.go index 7e7064a96..dbf01b3c3 100644 --- a/pkg/loxinet/route.go +++ b/pkg/loxinet/route.go @@ -211,13 +211,14 @@ func (r *RtH) RtAdd(Dst net.IPNet, Zone string, Ra RtAttr, Na []RtNhAttr) (int, for i := 0; i < nhLen; i++ { // FIXME - Need to sort before comparing if !Na[i].NhAddr.Equal(rt.NhAttr[i].NhAddr) { - rtMod = false + rtMod = true break } } } if rtMod { + tk.LogIt(tk.LogDebug, "rt change - %s:%s detected\n", Dst.String(), Zone) ret, _ := r.RtDelete(Dst, Zone) if ret != 0 { tk.LogIt(tk.LogError, "rt add - %s:%s del failed on mod\n", Dst.String(), Zone) From f96df22895796c915194df4f0acc60587b6b892d Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Wed, 2 Oct 2024 13:18:48 +0900 Subject: [PATCH 2/2] gh-819 fixes for k3s-base-sanity intermittently failing --- .github/workflows/k3s-base-sanity.yml | 4 +--- cicd/k3s-base-sanity/config.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/k3s-base-sanity.yml b/.github/workflows/k3s-base-sanity.yml index 08f37688e..2017bf091 100644 --- a/.github/workflows/k3s-base-sanity.yml +++ b/.github/workflows/k3s-base-sanity.yml @@ -40,9 +40,7 @@ jobs: submodules: recursive - run: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --disable traefik --disable servicelb" K3S_KUBECONFIG_MODE="644" sh - - run: | - sleep 20 - kubectl "${{ env.KUBECONFIG }}" taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule- - sleep 60 + sleep 80 kubectl "${{ env.KUBECONFIG }}" get nodes kubectl "${{ env.KUBECONFIG }}" get pods -A sleep 20 diff --git a/cicd/k3s-base-sanity/config.sh b/cicd/k3s-base-sanity/config.sh index e0b997eaa..01d7d9a1d 100755 --- a/cicd/k3s-base-sanity/config.sh +++ b/cicd/k3s-base-sanity/config.sh @@ -139,7 +139,7 @@ else kubectl $KUBECONFIG get pods -A # Remove taints in k3s if any (usually happens if started without cloud-manager) - kubectl $KUBECONFIG taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule- + # kubectl $KUBECONFIG taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule- echo "End K3s installation" fi