Skip to content

Commit

Permalink
Merge pull request #821 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR: gh-819 fixes for k3s-base-sanity intermittently failing
  • Loading branch information
UltraInstinct14 authored Oct 2, 2024
2 parents 49c623f + f96df22 commit 7273c85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/k3s-base-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ 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
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
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 }}"
Expand Down
9 changes: 3 additions & 6 deletions cicd/k3s-base-sanity/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,15 @@ 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

# 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
# kubectl $KUBECONFIG taint nodes --all node.cloudprovider.kubernetes.io/uninitialized=false:NoSchedule-

echo "End K3s installation"
fi
Expand Down
3 changes: 2 additions & 1 deletion pkg/loxinet/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7273c85

Please sign in to comment.