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:
Ravi Sankar Penta
2015-02-17 12:03:14 -08:00
parent 07c2035630
commit f6ecec5880
17 changed files with 257 additions and 34 deletions

View File

@@ -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)
},

View File

@@ -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