Merge pull request #7704 from smarterclayton/parallel_allocator
Use etcd to allocate PortalIPs instead of in-mem
This commit is contained in:
@@ -65,6 +65,7 @@ func init() {
|
||||
&ComponentStatus{},
|
||||
&ComponentStatusList{},
|
||||
&SerializedReference{},
|
||||
&RangeAllocation{},
|
||||
)
|
||||
// Legacy names are supported
|
||||
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
|
||||
@@ -111,3 +112,4 @@ func (*PodProxyOptions) IsAnAPIObject() {}
|
||||
func (*ComponentStatus) IsAnAPIObject() {}
|
||||
func (*ComponentStatusList) IsAnAPIObject() {}
|
||||
func (*SerializedReference) IsAnAPIObject() {}
|
||||
func (*RangeAllocation) IsAnAPIObject() {}
|
||||
|
@@ -1915,3 +1915,24 @@ type SELinuxOptions struct {
|
||||
// SELinux level label.
|
||||
Level string `json:"level,omitempty" description:"the level label to apply to the container"`
|
||||
}
|
||||
|
||||
// RangeAllocation is an opaque API object (not exposed to end users) that can be persisted to record
|
||||
// the global allocation state of the cluster. The schema of Range and Data generic, in that Range
|
||||
// should be a string representation of the inputs to a range (for instance, for IP allocation it
|
||||
// might be a CIDR) and Data is an opaque blob understood by an allocator which is typically a
|
||||
// binary range. Consumers should use annotations to record additional information (schema version,
|
||||
// data encoding hints). A range allocation should *ALWAYS* be recreatable at any time by observation
|
||||
// of the cluster, thus the object is less strongly typed than most.
|
||||
type RangeAllocation struct {
|
||||
TypeMeta `json:",inline"`
|
||||
ObjectMeta `json:"metadata,omitempty"`
|
||||
// A string representing a unique label for a range of resources, such as a CIDR "10.0.0.0/8" or
|
||||
// port range "10000-30000". Range is not strongly schema'd here. The Range is expected to define
|
||||
// a start and end unless there is an implicit end.
|
||||
Range string `json:"range"`
|
||||
// A byte array representing the serialized state of a range allocation. Additional clarifiers on
|
||||
// the type or format of data should be represented with annotations. For IP allocations, this is
|
||||
// represented as a bit array starting at the base IP of the CIDR in Range, with each bit representing
|
||||
// a single allocated address (the fifth bit on CIDR 10.0.0.0/8 is 10.0.0.4).
|
||||
Data []byte `json:"data"`
|
||||
}
|
||||
|
@@ -64,6 +64,7 @@ func init() {
|
||||
&ComponentStatus{},
|
||||
&ComponentStatusList{},
|
||||
&SerializedReference{},
|
||||
&RangeAllocation{},
|
||||
)
|
||||
// Legacy names are supported
|
||||
api.Scheme.AddKnownTypeWithName("v1", "Minion", &Node{})
|
||||
@@ -108,3 +109,4 @@ func (*PodProxyOptions) IsAnAPIObject() {}
|
||||
func (*ComponentStatus) IsAnAPIObject() {}
|
||||
func (*ComponentStatusList) IsAnAPIObject() {}
|
||||
func (*SerializedReference) IsAnAPIObject() {}
|
||||
func (*RangeAllocation) IsAnAPIObject() {}
|
||||
|
@@ -1780,3 +1780,12 @@ type SELinuxOptions struct {
|
||||
// SELinux level label.
|
||||
Level string `json:"level,omitempty" description:"the level label to apply to the container"`
|
||||
}
|
||||
|
||||
// RangeAllocation is not a public type
|
||||
type RangeAllocation struct {
|
||||
TypeMeta `json:",inline"`
|
||||
ObjectMeta `json:"metadata,omitempty" description:"standard list metadata; see http://docs.k8s.io/api-conventions.md#metadata"`
|
||||
|
||||
Range string `json:"range" description:"a range string that identifies the range represented by 'data'; required"`
|
||||
Data []byte `json:"data" description:"a bit array containing all allocated addresses in the previous segment"`
|
||||
}
|
||||
|
@@ -71,6 +71,7 @@ func init() {
|
||||
&ComponentStatus{},
|
||||
&ComponentStatusList{},
|
||||
&SerializedReference{},
|
||||
&RangeAllocation{},
|
||||
)
|
||||
// Future names are supported
|
||||
api.Scheme.AddKnownTypeWithName("v1beta1", "Node", &Minion{})
|
||||
@@ -116,3 +117,4 @@ func (*PodProxyOptions) IsAnAPIObject() {}
|
||||
func (*ComponentStatus) IsAnAPIObject() {}
|
||||
func (*ComponentStatusList) IsAnAPIObject() {}
|
||||
func (*SerializedReference) IsAnAPIObject() {}
|
||||
func (*RangeAllocation) IsAnAPIObject() {}
|
||||
|
@@ -1700,3 +1700,11 @@ type SELinuxOptions struct {
|
||||
// SELinux level label.
|
||||
Level string `json:"level,omitempty" description:"the level label to apply to the container"`
|
||||
}
|
||||
|
||||
// RangeAllocation is not a public type
|
||||
type RangeAllocation struct {
|
||||
TypeMeta `json:",inline"`
|
||||
|
||||
Range string `json:"range" description:"a range string that identifies the range represented by 'data'; required"`
|
||||
Data []byte `json:"data" description:"a bit array containing all allocated addresses in the previous segment"`
|
||||
}
|
||||
|
@@ -71,6 +71,7 @@ func init() {
|
||||
&ComponentStatus{},
|
||||
&ComponentStatusList{},
|
||||
&SerializedReference{},
|
||||
&RangeAllocation{},
|
||||
)
|
||||
// Future names are supported
|
||||
api.Scheme.AddKnownTypeWithName("v1beta2", "Node", &Minion{})
|
||||
@@ -116,3 +117,4 @@ func (*PodProxyOptions) IsAnAPIObject() {}
|
||||
func (*ComponentStatus) IsAnAPIObject() {}
|
||||
func (*ComponentStatusList) IsAnAPIObject() {}
|
||||
func (*SerializedReference) IsAnAPIObject() {}
|
||||
func (*RangeAllocation) IsAnAPIObject() {}
|
||||
|
@@ -1762,3 +1762,11 @@ type SELinuxOptions struct {
|
||||
// SELinux level label.
|
||||
Level string `json:"level,omitempty" description:"the level label to apply to the container"`
|
||||
}
|
||||
|
||||
// RangeAllocation is not a public type
|
||||
type RangeAllocation struct {
|
||||
TypeMeta `json:",inline"`
|
||||
|
||||
Range string `json:"range" description:"a range string that identifies the range represented by 'data'; required"`
|
||||
Data []byte `json:"data" description:"a bit array containing all allocated addresses in the previous segment"`
|
||||
}
|
||||
|
@@ -2909,6 +2909,40 @@ func convert_api_Probe_To_v1beta3_Probe(in *newer.Probe, out *Probe, s conversio
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1beta3_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *newer.RangeAllocation, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*RangeAllocation))(in)
|
||||
}
|
||||
if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Range = in.Range
|
||||
if err := s.Convert(&in.Data, &out.Data, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_api_RangeAllocation_To_v1beta3_RangeAllocation(in *newer.RangeAllocation, out *RangeAllocation, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*newer.RangeAllocation))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Range = in.Range
|
||||
if err := s.Convert(&in.Data, &out.Data, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1beta3_ReplicationController_To_api_ReplicationController(in *ReplicationController, out *newer.ReplicationController, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ReplicationController))(in)
|
||||
@@ -4192,6 +4226,7 @@ func init() {
|
||||
convert_api_PodTemplate_To_v1beta3_PodTemplate,
|
||||
convert_api_Pod_To_v1beta3_Pod,
|
||||
convert_api_Probe_To_v1beta3_Probe,
|
||||
convert_api_RangeAllocation_To_v1beta3_RangeAllocation,
|
||||
convert_api_ReplicationControllerList_To_v1beta3_ReplicationControllerList,
|
||||
convert_api_ReplicationControllerSpec_To_v1beta3_ReplicationControllerSpec,
|
||||
convert_api_ReplicationControllerStatus_To_v1beta3_ReplicationControllerStatus,
|
||||
@@ -4297,6 +4332,7 @@ func init() {
|
||||
convert_v1beta3_PodTemplate_To_api_PodTemplate,
|
||||
convert_v1beta3_Pod_To_api_Pod,
|
||||
convert_v1beta3_Probe_To_api_Probe,
|
||||
convert_v1beta3_RangeAllocation_To_api_RangeAllocation,
|
||||
convert_v1beta3_ReplicationControllerList_To_api_ReplicationControllerList,
|
||||
convert_v1beta3_ReplicationControllerSpec_To_api_ReplicationControllerSpec,
|
||||
convert_v1beta3_ReplicationControllerStatus_To_api_ReplicationControllerStatus,
|
||||
|
@@ -64,6 +64,7 @@ func init() {
|
||||
&ComponentStatus{},
|
||||
&ComponentStatusList{},
|
||||
&SerializedReference{},
|
||||
&RangeAllocation{},
|
||||
)
|
||||
// Legacy names are supported
|
||||
api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{})
|
||||
@@ -108,3 +109,4 @@ func (*PodProxyOptions) IsAnAPIObject() {}
|
||||
func (*ComponentStatus) IsAnAPIObject() {}
|
||||
func (*ComponentStatusList) IsAnAPIObject() {}
|
||||
func (*SerializedReference) IsAnAPIObject() {}
|
||||
func (*RangeAllocation) IsAnAPIObject() {}
|
||||
|
@@ -1780,3 +1780,12 @@ type SELinuxOptions struct {
|
||||
// SELinux level label.
|
||||
Level string `json:"level,omitempty" description:"the level label to apply to the container"`
|
||||
}
|
||||
|
||||
// RangeAllocation is not a public type
|
||||
type RangeAllocation struct {
|
||||
TypeMeta `json:",inline"`
|
||||
ObjectMeta `json:"metadata,omitempty" description:"standard list metadata; see http://docs.k8s.io/api-conventions.md#metadata"`
|
||||
|
||||
Range string `json:"range" description:"a range string that identifies the range represented by 'data'; required"`
|
||||
Data []byte `json:"data" description:"a bit array containing all allocated addresses in the previous segment"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user