mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 20:57:20 +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:
@@ -711,6 +711,7 @@ func init() {
|
||||
}
|
||||
out.PodCIDR = in.Spec.PodCIDR
|
||||
out.ExternalID = in.Spec.ExternalID
|
||||
out.Unschedulable = in.Spec.Unschedulable
|
||||
return s.Convert(&in.Spec.Capacity, &out.NodeResources.Capacity, 0)
|
||||
},
|
||||
func(in *Minion, out *newer.Node, s conversion.Scope) error {
|
||||
@@ -742,6 +743,7 @@ func init() {
|
||||
}
|
||||
out.Spec.PodCIDR = in.PodCIDR
|
||||
out.Spec.ExternalID = in.ExternalID
|
||||
out.Spec.Unschedulable = in.Unschedulable
|
||||
return s.Convert(&in.NodeResources.Capacity, &out.Spec.Capacity, 0)
|
||||
},
|
||||
|
||||
|
@@ -677,6 +677,8 @@ const (
|
||||
NodeReachable NodeConditionKind = "Reachable"
|
||||
// NodeReady means the node returns StatusOK for HTTP health check.
|
||||
NodeReady NodeConditionKind = "Ready"
|
||||
// NodeSchedulable means the node is ready to accept new pods.
|
||||
NodeSchedulable NodeConditionKind = "Schedulable"
|
||||
)
|
||||
|
||||
type NodeCondition struct {
|
||||
@@ -731,6 +733,8 @@ type Minion struct {
|
||||
NodeResources NodeResources `json:"resources,omitempty" description:"characterization of node resources"`
|
||||
// Pod IP range assigned to the node
|
||||
PodCIDR string `json:"podCIDR,omitempty" description:"IP range assigned to the node"`
|
||||
// Unschedulable controls node schedulability of new pods. By default node is schedulable.
|
||||
Unschedulable bool `json:"unschedulable,omitempty" description:"disable pod scheduling on the node"`
|
||||
// Status describes the current status of a node
|
||||
Status NodeStatus `json:"status,omitempty" description:"current status of node"`
|
||||
// Labels for the node
|
||||
|
Reference in New Issue
Block a user