Skip to content

Commit

Permalink
Skip unreachable node during collecting NodeBundles
Browse files Browse the repository at this point in the history
We currently skip nodes with unavailable network and not ready kubelet.
Nodes tainted with `node.kubernetes.io/unschedulable:NoSchedule` are tolerated.

Signed-off-by: Weihang Lo <weihang.lo@suse.com>
  • Loading branch information
weihanglo authored and bk201 committed Nov 24, 2021
1 parent 81e055d commit 7899273
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/manager/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func (a *AgentDaemonSet) Create(image string, managerURL string) error {
Key: types.DrainKey,
Value: "scheduling",
},
{
Key: corev1.TaintNodeUnschedulable,
Operator: corev1.TolerationOpExists,
Effect: corev1.TaintEffectNoSchedule,
},
},
Containers: []corev1.Container{
{
Expand Down
15 changes: 15 additions & 0 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/rancher/wrangler/pkg/signals"
"github.com/sirupsen/logrus"

v1 "k8s.io/api/core/v1"
"k8s.io/client-go/rest"

"github.com/rancher/support-bundle-kit/pkg/manager/client"
Expand Down Expand Up @@ -323,7 +324,21 @@ func (m *SupportBundleManager) refreshNodes() error {
}

m.expectedNodes = make(map[string]string)

NODE_LOOP:
for _, node := range nodes.Items {
for _, cond := range node.Status.Conditions {
switch cond.Type {
case v1.NodeReady:
if cond.Status != v1.ConditionTrue {
continue NODE_LOOP
}
case v1.NodeNetworkUnavailable:
if cond.Status == v1.ConditionTrue {
continue NODE_LOOP
}
}
}
m.expectedNodes[node.Name] = ""
}

Expand Down

0 comments on commit 7899273

Please sign in to comment.