Documentation ¶
Overview ¶
Package mock_rollalgorithm is a generated GoMock package.
Package mock_rollalgorithm is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ComputeLatestReplicas(ratio int32, replicas int32, strategy CarryStrategyType) (latestReplicas int32)
- func FixStrategy(replicas int32, defaultMaxUnavailable *intstr.IntOrString, ...) bool
- func GetIntOrPercentValue(intOrStr *intstr.IntOrString) (int, bool, error)
- func InitFlags(flagset *pflag.FlagSet)
- func IsRecreate(strategy apps.DeploymentStrategy) bool
- func ParseScheduleStrategy(plan SchedulePlan) (maxSurge int32, maxUnavailable int32, minAvailable int32, ...)
- func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
- type ByAvailable
- type ByGeneration
- type CarryStrategyType
- type GroupNode
- type GroupNodeSetArgs
- type GroupScheduleParams
- type GroupScheduleTarget
- type GroupScheduler
- type GroupSyncSlidingScheduler
- type InPlaceShardScheduler
- type MockNode
- func (m *MockNode) EXPECT() *MockNodeMockRecorder
- func (m *MockNode) GetDeletionCost() int
- func (m *MockNode) GetDependencyReady() bool
- func (m *MockNode) GetName() string
- func (m *MockNode) GetScore() int
- func (m *MockNode) GetVersion() string
- func (m *MockNode) GetVersionPlan() interface{}
- func (m *MockNode) IsEmpty() bool
- func (m *MockNode) IsReady() bool
- func (m *MockNode) IsRelease() bool
- func (m *MockNode) SetDependencyReady(arg0 bool)
- func (m *MockNode) SetVersion(arg0 string, arg1 interface{})
- func (m *MockNode) Stop()
- type MockNodeMockRecorder
- func (mr *MockNodeMockRecorder) GetDeletionCost() *gomock.Call
- func (mr *MockNodeMockRecorder) GetDependencyReady() *gomock.Call
- func (mr *MockNodeMockRecorder) GetName() *gomock.Call
- func (mr *MockNodeMockRecorder) GetScore() *gomock.Call
- func (mr *MockNodeMockRecorder) GetVersion() *gomock.Call
- func (mr *MockNodeMockRecorder) GetVersionPlan() *gomock.Call
- func (mr *MockNodeMockRecorder) IsEmpty() *gomock.Call
- func (mr *MockNodeMockRecorder) IsReady() *gomock.Call
- func (mr *MockNodeMockRecorder) IsRelease() *gomock.Call
- func (mr *MockNodeMockRecorder) SetDependencyReady(arg0 interface{}) *gomock.Call
- func (mr *MockNodeMockRecorder) SetVersion(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockNodeMockRecorder) Stop() *gomock.Call
- type MockShard
- func (m *MockShard) EXPECT() *MockShardMockRecorder
- func (m *MockShard) GetCPU() int32
- func (m *MockShard) GetCarbonRoleName() string
- func (m *MockShard) GetDependencyLevel() int32
- func (m *MockShard) GetLatestVersionRatio(version string) int32
- func (m *MockShard) GetName() string
- func (m *MockShard) GetRawReplicas() int32
- func (m *MockShard) GetReplicas() int32
- func (m *MockShard) GetResourceVersionStatus() map[string]*ResourceVersionStatus
- func (m *MockShard) GetVersionStatus() map[string]*VersionStatus
- type MockShardMockRecorder
- func (mr *MockShardMockRecorder) GetCPU() *gomock.Call
- func (mr *MockShardMockRecorder) GetCarbonRoleName() *gomock.Call
- func (mr *MockShardMockRecorder) GetDependencyLevel() *gomock.Call
- func (mr *MockShardMockRecorder) GetLatestVersionRatio(version interface{}) *gomock.Call
- func (mr *MockShardMockRecorder) GetName() *gomock.Call
- func (mr *MockShardMockRecorder) GetRawReplicas() *gomock.Call
- func (mr *MockShardMockRecorder) GetReplicas() *gomock.Call
- func (mr *MockShardMockRecorder) GetResourceVersionStatus() *gomock.Call
- func (mr *MockShardMockRecorder) GetVersionStatus() *gomock.Call
- type MockShardScheduler
- type MockShardSchedulerMockRecorder
- type Node
- type NodeSet
- type NodeSetUpdater
- type NodeUpdateScore
- type ResourceVersionStatus
- type RollingUpdateArgs
- func (args *RollingUpdateArgs) GetCPU() int32
- func (args *RollingUpdateArgs) GetCarbonRoleName() string
- func (args *RollingUpdateArgs) GetDependencyLevel() int32
- func (args *RollingUpdateArgs) GetLatestVersionRatio(version string) int32
- func (args *RollingUpdateArgs) GetName() string
- func (args *RollingUpdateArgs) GetRawReplicas() int32
- func (args *RollingUpdateArgs) GetReplicas() int32
- func (args *RollingUpdateArgs) GetResourceVersionStatus() map[string]*ResourceVersionStatus
- func (args *RollingUpdateArgs) GetVersionStatus() map[string]*VersionStatus
- type RollingUpdater
- type SchedulePlan
- type Shard
- type ShardInternalArgs
- type ShardRuntimeArgs
- type ShardScheduleParams
- type ShardScheduler
- type VersionStatus
Constants ¶
const ( RollingStrategyOldFirst = "oldFirst" RollingStrategyLatestFirst = "latestFirst" RollingStrategyLessFirst = "lessFirst" )
RollingStrategy
const (
SchedulerTypeRolling = "rollingScheduler"
)
ScheduleType
Variables ¶
var ( // Default25IntOrString 默认25% Default25IntOrString = intstr.FromString("25%") // Default10IntOrString 默认0% Default10IntOrString = intstr.FromString("10%") //DefaultLatestVersionRatio 默认100 DefaultLatestVersionRatio = int32(100) )
Functions ¶
func ComputeLatestReplicas ¶
func ComputeLatestReplicas(ratio int32, replicas int32, strategy CarryStrategyType) (latestReplicas int32)
func FixStrategy ¶
func FixStrategy(replicas int32, defaultMaxUnavailable *intstr.IntOrString, strategy *app.DeploymentStrategy) bool
func GetIntOrPercentValue ¶
func GetIntOrPercentValue(intOrStr *intstr.IntOrString) (int, bool, error)
func IsRecreate ¶
func IsRecreate(strategy apps.DeploymentStrategy) bool
IsRecreate returns true if the strategy type is a rolling recreate.
func ParseScheduleStrategy ¶
func ParseScheduleStrategy(plan SchedulePlan) (maxSurge int32, maxUnavailable int32, minAvailable int32, maxSurgePercent int32, maxUnavailablePercent int32, minAvailablePercent int32)
ParseScheduleStrategy returns the maxSurge, maxUnavailable, and minAvailable
func ResolveFenceposts ¶
func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32, ) (int32, int32, error)
ResolveFenceposts resolves both maxSurge and maxUnavailable. This needs to happen in one step. For example:
2 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1), then old(-1), then new(+1) 1 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1) 2 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1) 2 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1)
Types ¶
type ByAvailable ¶
type ByAvailable struct {
// contains filtered or unexported fields
}
ByAvailable is used to sort sharGroupVersion by generation
func (ByAvailable) Len ¶
func (a ByAvailable) Len() int
func (ByAvailable) Less ¶
func (a ByAvailable) Less(i, j int) bool
func (ByAvailable) Swap ¶
func (a ByAvailable) Swap(i, j int)
type ByGeneration ¶
type ByGeneration struct {
// contains filtered or unexported fields
}
ByGeneration is used to sort sharGroupVersion by generation
func (ByGeneration) Len ¶
func (a ByGeneration) Len() int
func (ByGeneration) Less ¶
func (a ByGeneration) Less(i, j int) bool
func (ByGeneration) Swap ¶
func (a ByGeneration) Swap(i, j int)
type CarryStrategyType ¶
type CarryStrategyType string
CarryStrategyType CarryStrategyType
const ( CeilCarryStrategyType CarryStrategyType = "Ceil" FloorCarryStrategyType CarryStrategyType = "Floor" )
CarryStrategyTypes
type GroupNode ¶
type GroupNode interface { GetGroupVersion() string GetDependencyReady() bool SetDependencyReady(bool) }
GroupNode interface contains setter and getter for parameters controlled by a Group.
type GroupNodeSetArgs ¶
type GroupNodeSetArgs struct { GroupVersionMap map[string]string VersionHoldMatrixPercent map[string]float64 PaddedLatestVersionRatio *int32 VersionDependencyMatrixPercent map[string]float64 LatestVersionCarryStrategy CarryStrategyType }
GroupNodeSetArgs contains parameters for NodeSet updates controlled by a Group.
type GroupScheduleParams ¶
type GroupScheduleParams struct { Name string NewShards []string Metas map[string]string TargetShardStrategys map[string]*app.DeploymentStrategy DefaultStrategy app.DeploymentStrategy LatestPercent int32 MaxSurge int32 ShardGroupVersion string RollingStrategy string Paused bool ShardStatus []Shard }
GroupScheduleParams GroupScheduleParams
func (*GroupScheduleParams) String ¶
func (gsp *GroupScheduleParams) String() string
type GroupScheduleTarget ¶
type GroupScheduleTarget map[string]ShardScheduleParams
GroupScheduleTarget is the target of group
func (*GroupScheduleTarget) String ¶
func (gst *GroupScheduleTarget) String() string
type GroupScheduler ¶
type GroupScheduler interface {
Schedule(params *GroupScheduleParams) (map[string]ShardScheduleParams, int32, error)
}
GroupScheduler coordinate rolling of all columns
func NewSyncSlidingScheduler ¶
func NewSyncSlidingScheduler() GroupScheduler
NewSyncSlidingScheduler create GroupSyncSlidingScheduler
type GroupSyncSlidingScheduler ¶
type GroupSyncSlidingScheduler struct{}
GroupSyncSlidingScheduler use target available ratio add sliding window to rolling
func (*GroupSyncSlidingScheduler) Schedule ¶
func (gss *GroupSyncSlidingScheduler) Schedule(params *GroupScheduleParams) (map[string]ShardScheduleParams, int32, error)
Schedule Schedule
type InPlaceShardScheduler ¶
type InPlaceShardScheduler struct {
// contains filtered or unexported fields
}
InPlaceShardScheduler control one shard rolling inplace whithout create new replica And it can degenerate into normal scheduler if maxUnavailable == 0 and maxSuger > 0.
func (*InPlaceShardScheduler) Schedule ¶
func (s *InPlaceShardScheduler) Schedule(shard Shard, params *ShardScheduleParams) (map[string]int32, map[string]int32, error)
Schedule Schedule
type MockNode ¶
type MockNode struct {
// contains filtered or unexported fields
}
MockNode is a mock of Node interface.
func NewMockNode ¶
func NewMockNode(ctrl *gomock.Controller) *MockNode
NewMockNode creates a new mock instance.
func (*MockNode) EXPECT ¶
func (m *MockNode) EXPECT() *MockNodeMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNode) GetDeletionCost ¶
GetDeletionCost mocks base method.
func (*MockNode) GetDependencyReady ¶
GetDependencyReady mocks base method.
func (*MockNode) GetVersionPlan ¶
func (m *MockNode) GetVersionPlan() interface{}
GetVersionPlan mocks base method.
func (*MockNode) SetDependencyReady ¶
SetDependencyReady mocks base method.
func (*MockNode) SetVersion ¶
SetVersion mocks base method.
type MockNodeMockRecorder ¶
type MockNodeMockRecorder struct {
// contains filtered or unexported fields
}
MockNodeMockRecorder is the mock recorder for MockNode.
func (*MockNodeMockRecorder) GetDeletionCost ¶
func (mr *MockNodeMockRecorder) GetDeletionCost() *gomock.Call
GetDeletionCost indicates an expected call of GetDeletionCost.
func (*MockNodeMockRecorder) GetDependencyReady ¶
func (mr *MockNodeMockRecorder) GetDependencyReady() *gomock.Call
GetDependencyReady indicates an expected call of GetDependencyReady.
func (*MockNodeMockRecorder) GetName ¶
func (mr *MockNodeMockRecorder) GetName() *gomock.Call
GetName indicates an expected call of GetName.
func (*MockNodeMockRecorder) GetScore ¶
func (mr *MockNodeMockRecorder) GetScore() *gomock.Call
GetScore indicates an expected call of GetScore.
func (*MockNodeMockRecorder) GetVersion ¶
func (mr *MockNodeMockRecorder) GetVersion() *gomock.Call
GetVersion indicates an expected call of GetVersion.
func (*MockNodeMockRecorder) GetVersionPlan ¶
func (mr *MockNodeMockRecorder) GetVersionPlan() *gomock.Call
GetVersionPlan indicates an expected call of GetVersionPlan.
func (*MockNodeMockRecorder) IsEmpty ¶
func (mr *MockNodeMockRecorder) IsEmpty() *gomock.Call
IsEmpty indicates an expected call of IsEmpty.
func (*MockNodeMockRecorder) IsReady ¶
func (mr *MockNodeMockRecorder) IsReady() *gomock.Call
IsReady indicates an expected call of IsReady.
func (*MockNodeMockRecorder) IsRelease ¶
func (mr *MockNodeMockRecorder) IsRelease() *gomock.Call
IsRelease indicates an expected call of IsRelease.
func (*MockNodeMockRecorder) SetDependencyReady ¶
func (mr *MockNodeMockRecorder) SetDependencyReady(arg0 interface{}) *gomock.Call
SetDependencyReady indicates an expected call of SetDependencyReady.
func (*MockNodeMockRecorder) SetVersion ¶
func (mr *MockNodeMockRecorder) SetVersion(arg0, arg1 interface{}) *gomock.Call
SetVersion indicates an expected call of SetVersion.
func (*MockNodeMockRecorder) Stop ¶
func (mr *MockNodeMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
type MockShard ¶
type MockShard struct {
// contains filtered or unexported fields
}
MockShard is a mock of Shard interface
func NewMockShard ¶
func NewMockShard(ctrl *gomock.Controller) *MockShard
NewMockShard creates a new mock instance
func (*MockShard) EXPECT ¶
func (m *MockShard) EXPECT() *MockShardMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockShard) GetCarbonRoleName ¶
GetCarbonRoleName mocks base method
func (*MockShard) GetDependencyLevel ¶
GetDependencyLevel mocks base method
func (*MockShard) GetLatestVersionRatio ¶
GetLatestVersionRatio mocks base method
func (*MockShard) GetRawReplicas ¶
GetRawReplicas mocks base method
func (*MockShard) GetReplicas ¶
GetReplicas mocks base method
func (*MockShard) GetResourceVersionStatus ¶
func (m *MockShard) GetResourceVersionStatus() map[string]*ResourceVersionStatus
GetResourceVersionStatus mocks base method
func (*MockShard) GetVersionStatus ¶
func (m *MockShard) GetVersionStatus() map[string]*VersionStatus
GetVersionStatus mocks base method
type MockShardMockRecorder ¶
type MockShardMockRecorder struct {
// contains filtered or unexported fields
}
MockShardMockRecorder is the mock recorder for MockShard
func (*MockShardMockRecorder) GetCPU ¶
func (mr *MockShardMockRecorder) GetCPU() *gomock.Call
GetCPU indicates an expected call of GetCPU
func (*MockShardMockRecorder) GetCarbonRoleName ¶
func (mr *MockShardMockRecorder) GetCarbonRoleName() *gomock.Call
GetCarbonRoleName indicates an expected call of GetCarbonRoleName
func (*MockShardMockRecorder) GetDependencyLevel ¶
func (mr *MockShardMockRecorder) GetDependencyLevel() *gomock.Call
GetDependencyLevel indicates an expected call of GetDependencyLevel
func (*MockShardMockRecorder) GetLatestVersionRatio ¶
func (mr *MockShardMockRecorder) GetLatestVersionRatio(version interface{}) *gomock.Call
GetLatestVersionRatio indicates an expected call of GetLatestVersionRatio
func (*MockShardMockRecorder) GetName ¶
func (mr *MockShardMockRecorder) GetName() *gomock.Call
GetName indicates an expected call of GetName
func (*MockShardMockRecorder) GetRawReplicas ¶
func (mr *MockShardMockRecorder) GetRawReplicas() *gomock.Call
GetRawReplicas indicates an expected call of GetRawReplicas
func (*MockShardMockRecorder) GetReplicas ¶
func (mr *MockShardMockRecorder) GetReplicas() *gomock.Call
GetReplicas indicates an expected call of GetReplicas
func (*MockShardMockRecorder) GetResourceVersionStatus ¶
func (mr *MockShardMockRecorder) GetResourceVersionStatus() *gomock.Call
GetResourceVersionStatus indicates an expected call of GetResourceVersionStatus
func (*MockShardMockRecorder) GetVersionStatus ¶
func (mr *MockShardMockRecorder) GetVersionStatus() *gomock.Call
GetVersionStatus indicates an expected call of GetVersionStatus
type MockShardScheduler ¶
type MockShardScheduler struct {
// contains filtered or unexported fields
}
MockShardScheduler is a mock of ShardScheduler interface
func NewMockShardScheduler ¶
func NewMockShardScheduler(ctrl *gomock.Controller) *MockShardScheduler
NewMockShardScheduler creates a new mock instance
func (*MockShardScheduler) EXPECT ¶
func (m *MockShardScheduler) EXPECT() *MockShardSchedulerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockShardScheduler) Schedule ¶
func (m *MockShardScheduler) Schedule(shard Shard, params *ShardScheduleParams) (map[string]int32, map[string]int32, error)
Schedule mocks base method
type MockShardSchedulerMockRecorder ¶
type MockShardSchedulerMockRecorder struct {
// contains filtered or unexported fields
}
MockShardSchedulerMockRecorder is the mock recorder for MockShardScheduler
func (*MockShardSchedulerMockRecorder) Schedule ¶
func (mr *MockShardSchedulerMockRecorder) Schedule(shard, params interface{}) *gomock.Call
Schedule indicates an expected call of Schedule
type Node ¶
type Node interface { GetName() string GetVersion() string GetVersionPlan() interface{} GetScore() int GetDeletionCost() int IsReady() bool IsEmpty() bool IsRelease() bool SetVersion(string, interface{}) Stop() }
Node represents an abstract node that can be rolled updated.
type NodeSetUpdater ¶
type NodeSetUpdater struct {
// contains filtered or unexported fields
}
NodeSetUpdater implements a generic rolling update method.
func (*NodeSetUpdater) Schedule ¶
func (n *NodeSetUpdater) Schedule(args *RollingUpdateArgs) (map[string]NodeSet, map[string]NodeSet, NodeSet, error)
Schedule is the generic rolling update function.
type NodeUpdateScore ¶
type NodeUpdateScore interface {
GetUpdateScore() int
}
NodeUpdateScore interface contains score which represent the weight of node when upgrading.
type ResourceVersionStatus ¶
type ResourceVersionStatus struct { // CPU core数 CPU int32 `json:"cpu"` // ResourceVersion 资源版本 ResourceVersion string `json:"resourceVersion"` // Total number of non-terminated Replica targeted by this rollingset (their labels match the selector). // +optional Replicas int32 `json:"replicas"` // Total number of complete Replica, latest version and available. // +optional AvailableReplicas int32 `json:"availableReplicas"` }
ResourceVersionStatus 资源版本的状态
func (*ResourceVersionStatus) DeepCopy ¶
func (in *ResourceVersionStatus) DeepCopy() *ResourceVersionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionStatus.
func (*ResourceVersionStatus) DeepCopyInto ¶
func (in *ResourceVersionStatus) DeepCopyInto(out *ResourceVersionStatus)
DeepCopyInto DeepCopyInto
type RollingUpdateArgs ¶
type RollingUpdateArgs struct { Nodes NodeSet CreateNode func() Node // Schedule Plan Params Replicas *int32 LatestVersionRatio *int32 MaxSurge *intstr.IntOrString LatestVersion string LatestVersionPlan interface{} RollingStrategy string Release bool GroupNodeSetArgs ExtraNodes NodeSet DisableReplaceEmpty bool NodeSetName string }
RollingUpdateArgs contains common parameters for rolling updates.
func (*RollingUpdateArgs) GetCPU ¶
func (args *RollingUpdateArgs) GetCPU() int32
GetCPU returns CPU. The implementation of Shard interface.
func (*RollingUpdateArgs) GetCarbonRoleName ¶
func (args *RollingUpdateArgs) GetCarbonRoleName() string
GetCarbonRoleName returns CarbonRoleName. The implementation of Shard interface.
func (*RollingUpdateArgs) GetDependencyLevel ¶
func (args *RollingUpdateArgs) GetDependencyLevel() int32
GetDependencyLevel returns DependencyLevel. The implementation of Shard interface.
func (*RollingUpdateArgs) GetLatestVersionRatio ¶
func (args *RollingUpdateArgs) GetLatestVersionRatio(version string) int32
GetLatestVersionRatio returns LatestVersionRatio. The implementation of Shard interface.
func (*RollingUpdateArgs) GetName ¶
func (args *RollingUpdateArgs) GetName() string
GetName returns Name. The implementation of Shard interface.
func (*RollingUpdateArgs) GetRawReplicas ¶
func (args *RollingUpdateArgs) GetRawReplicas() int32
GetRawReplicas returns RawReplicas. The implementation of Shard interface.
func (*RollingUpdateArgs) GetReplicas ¶
func (args *RollingUpdateArgs) GetReplicas() int32
GetReplicas returns replicas. The implementation of Shard interface.
func (*RollingUpdateArgs) GetResourceVersionStatus ¶
func (args *RollingUpdateArgs) GetResourceVersionStatus() map[string]*ResourceVersionStatus
GetResourceVersionStatus returns ResourceVersionStatus. The implementation of Shard interface.
func (*RollingUpdateArgs) GetVersionStatus ¶
func (args *RollingUpdateArgs) GetVersionStatus() map[string]*VersionStatus
GetVersionStatus returns VersionStatus. The implementation of Shard interface.
type RollingUpdater ¶
type RollingUpdater interface {
Schedule(*RollingUpdateArgs) (map[string]NodeSet, map[string]NodeSet, NodeSet, error)
}
RollingUpdater interface contains rolling update Shcedule interface.
func NewDefaultNodeSetUpdater ¶
func NewDefaultNodeSetUpdater(diffLogger *utils.DiffLogger) RollingUpdater
NewDefaultNodeSetUpdater create a new default NodeSetUpdater
func NewNodeSetUpdater ¶
func NewNodeSetUpdater(scheduler ShardScheduler, diffLogger *utils.DiffLogger) RollingUpdater
NewNodeSetUpdater create a new NodeSetUpdater
type SchedulePlan ¶
type SchedulePlan struct { //Replicas 目标总数, 不能为nil Replicas *int32 `json:"replicas"` //依赖级别,是否依赖其它role,数值越大依赖越深, DependencyLevel *int32 `json:"dependencyLevel"` // The rollingset strategy to use to replace existing replica with new ones. // +optional // +patchStrategy=retainKeys Strategy app.DeploymentStrategy `json:"strategy,omitempty"` RollingStrategy string `json:"rollingStrategy,omitempty"` // The percent of new Replicas. should be 0 - 100 // Defaults to 100. // +optional LatestVersionRatio *int32 `json:"latestVersionRatio,omitempty"` PaddedLatestVersionRatio *int32 `json:"paddedLatestVersionRatio,omitempty"` // +optional LatestVersionCarryStrategy CarryStrategyType `json:"latestVersionCarryStrategy,omitempty"` // Indicates that the rollingset is paused. // +optional Paused bool `json:"paused,omitempty"` //VersionHoldMatrix 每个版本的hold节点数 VersionHoldMatrix map[string]int32 `json:"versionHoldMatrix,omitempty"` VersionHoldMatrixPercent map[string]float64 `json:"versionHoldMatrixPercent,omitempty"` //VersionDependencyReady 每个版本多少个节点依赖ok了,等比例挂流量 VersionDependencyMatrix map[string]int32 `json:"versionDependencyReady,omitempty"` VersionDependencyMatrixPercent map[string]float64 `json:"versionDependencyReadyPercent,omitempty"` // +optional 在同版本的情况,当subrsLatestVersionRatio,指定了更小的比例,是否可以回滚 SubrsCanRollback bool `json:"subrsCanRollback,omitempty"` SubrsPaused bool `json:"subrsPaused,omitempty"` }
SchedulePlan is the spec for a SchedulePlan resource
func (*SchedulePlan) DeepCopy ¶
func (in *SchedulePlan) DeepCopy() *SchedulePlan
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulePlan.
func (*SchedulePlan) DeepCopyInto ¶
func (in *SchedulePlan) DeepCopyInto(out *SchedulePlan)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SchedulePlan) GetLatestVersionRatio ¶
func (p *SchedulePlan) GetLatestVersionRatio() int32
GetLatestVersionRatio GetLatestVersionRatio
func (*SchedulePlan) GetReplicas ¶
func (p *SchedulePlan) GetReplicas() int32
GetReplicas GetReplicas
func (*SchedulePlan) String ¶
func (p *SchedulePlan) String() string
type Shard ¶
type Shard interface { GetReplicas() int32 GetLatestVersionRatio(version string) int32 GetRawReplicas() int32 GetDependencyLevel() int32 GetCPU() int32 GetName() string GetCarbonRoleName() string GetVersionStatus() map[string]*VersionStatus GetResourceVersionStatus() map[string]*ResourceVersionStatus }
Shard express a single shard in a group
type ShardInternalArgs ¶
type ShardInternalArgs struct { Desired int32 //目标值 CurLatestReplicas int32 //当前新版replica数 CurOldReplicas int32 //当前老版replica数 CurTotalReplicas int32 //当前replica数 VersionReadyCountMap map[string]int32 VersionCountMap map[string]int32 VersionReadyPercentMap map[string]float64 VersionSortKeys []string //versionRepliaMap的key做排序,保证遍历顺序 GroupVersionSortKeys []string //versionRepliaMap的key做排序,保证遍历顺序 // contains filtered or unexported fields }
ShardInternalArgs ShardInternalArgs
type ShardRuntimeArgs ¶
type ShardRuntimeArgs struct { Releasing bool ScheduleID string LatestVersion string LatestGroupVersion string LatestResourceVersion string RollingStrategy string RestartAfterResourceChange *bool EnsureAvailableCPUCores bool GroupVersionToVersionMap map[string]string }
ShardRuntimeArgs is rolling args runtime
type ShardScheduleParams ¶
type ShardScheduleParams struct { Plan SchedulePlan //target算法需要 ShardInternalArgs ShardRuntimeArgs Metas map[string]string LatestRowComplete bool }
ShardScheduleParams ShardScheduleParams
func NewShardScheduleParams ¶
func NewShardScheduleParams(shard Shard, plan SchedulePlan, releasing bool, scheduleID string, latestVersion string, rollingStrategy string, groupVersionToVersionMap map[string]string, metas map[string]string) *ShardScheduleParams
NewShardScheduleParams create new ShardScheduleParams
func (*ShardScheduleParams) String ¶
func (s *ShardScheduleParams) String() string
type ShardScheduler ¶
type ShardScheduler interface {
Schedule(shard Shard, params *ShardScheduleParams) (map[string]int32, map[string]int32, error)
}
ShardScheduler control one shard rolling
func NewShardScheduler ¶
func NewShardScheduler(diffLogger *utils.DiffLogger) ShardScheduler
NewShardScheduler NewShardScheduler
type VersionStatus ¶
type VersionStatus struct { Version string `json:"version"` // Total number of non-terminated Replica targeted by this rollingset (their labels match the selector). // +optional Replicas int32 `json:"replicas"` // Total number of complete Replica, latest version and available. // +optional ReadyReplicas int32 `json:"readyReplicas"` DataReadyReplicas int32 `json:"dataReadyReplicas"` // ref rollingset.spec.signature Signature string `json:"signature"` ResourceVersionStatus map[string]*ResourceVersionStatus `json:"resourceVersionStatus,omitempty"` }
VersionStatus 版本的状态
func (*VersionStatus) DeepCopy ¶
func (in *VersionStatus) DeepCopy() *VersionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionStatus.
func (*VersionStatus) DeepCopyInto ¶
func (in *VersionStatus) DeepCopyInto(out *VersionStatus)
DeepCopyInto DeepCopyInto