mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 05:02:50 +00:00
Add requirements based scheduling.
This commit is contained in:
@@ -108,6 +108,10 @@ func init() {
|
||||
if err := s.Convert(&in.CurrentState, &out.CurrentState, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := s.Convert(&in.NodeSelector, &out.NodeSelector, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
func(in *Pod, out *newer.Pod, s conversion.Scope) error {
|
||||
@@ -127,6 +131,10 @@ func init() {
|
||||
if err := s.Convert(&in.CurrentState, &out.CurrentState, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := s.Convert(&in.NodeSelector, &out.NodeSelector, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -279,6 +287,9 @@ func init() {
|
||||
if err := s.Convert(&in.ObjectMeta, &out.TypeMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.Labels, &out.Labels, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
out.HostIP = in.HostIP
|
||||
return s.Convert(&in.NodeResources, &out.NodeResources, 0)
|
||||
@@ -290,6 +301,9 @@ func init() {
|
||||
if err := s.Convert(&in.TypeMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.Labels, &out.Labels, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
out.HostIP = in.HostIP
|
||||
return s.Convert(&in.NodeResources, &out.NodeResources, 0)
|
||||
|
@@ -360,6 +360,8 @@ type Pod struct {
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
DesiredState PodState `json:"desiredState,omitempty" yaml:"desiredState,omitempty"`
|
||||
CurrentState PodState `json:"currentState,omitempty" yaml:"currentState,omitempty"`
|
||||
// NodeSelector is a selector which must be true for the pod to fit on a node
|
||||
NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
|
||||
}
|
||||
|
||||
// ReplicationControllerState is the state of a replication controller, either input (create, update) or as output (list, get).
|
||||
@@ -456,6 +458,8 @@ type Minion struct {
|
||||
HostIP string `json:"hostIP,omitempty" yaml:"hostIP,omitempty"`
|
||||
// Resources available on the node
|
||||
NodeResources NodeResources `json:"resources,omitempty" yaml:"resources,omitempty"`
|
||||
// Labels for the node
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
}
|
||||
|
||||
// MinionList is a list of minions.
|
||||
|
Reference in New Issue
Block a user