mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 12:48:51 +00:00
Allow admin user to explicitly unschedule the node
Setting Unschedulable on the node will not touch any existing pods on the node but will block scheduling of new pods on the node.
This commit is contained in:
@@ -432,7 +432,7 @@ func printSecretList(list *api.SecretList, w io.Writer) error {
|
||||
|
||||
func printNode(node *api.Node, w io.Writer) error {
|
||||
conditionMap := make(map[api.NodeConditionType]*api.NodeCondition)
|
||||
NodeAllConditions := []api.NodeConditionType{api.NodeReady, api.NodeReachable}
|
||||
NodeAllConditions := []api.NodeConditionType{api.NodeSchedulable, api.NodeReady, api.NodeReachable}
|
||||
for i := range node.Status.Conditions {
|
||||
cond := node.Status.Conditions[i]
|
||||
conditionMap[cond.Type] = &cond
|
||||
|
@@ -567,6 +567,26 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
},
|
||||
status: "Unknown",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo7"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull}}},
|
||||
},
|
||||
status: "Schedulable,Ready,Reachable",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo8"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionNone},
|
||||
{Type: api.NodeReady, Status: api.ConditionNone},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull}}},
|
||||
},
|
||||
status: "NotSchedulable,NotReady,Reachable",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range table {
|
||||
|
Reference in New Issue
Block a user