Documentation
¶
Index ¶
- Constants
- func CalculateStatus(rollingset *carbonv1.RollingSet, replicaSet []*carbonv1.Replica) (carbonv1.RollingSetStatus, int64)
- func CheckSum(rollingset *carbonv1.RollingSet) (string, error)
- func GetActiveReplicaCount(replicaSet []*carbonv1.Replica) (activeReplicas, notAssignedReplicas, workerModeNotMatchReplicas int32)
- func GetAllocatedReplicaCount(replicaSet []*carbonv1.Replica) int32
- func GetAvailableReplicaCount(replicaSet []*carbonv1.Replica) int32
- func GetCompleteReplicaCount(replicaSet []*carbonv1.Replica) int32
- func GetReleasingReplicaCount(replicaSet []*carbonv1.Replica) (int32, int32)
- func GetTotalWorkers(replicaSet []*carbonv1.Replica) int32
- func GetUpdatedReplicaCount(replicaSet []*carbonv1.Replica, latestVersion string) int32
- func GetVersionCount(replicaSet []*carbonv1.Replica, latestVersion string) int32
- func GroupByStandbyCount(replicaSet []*carbonv1.Replica) (cold, warm, hot int32)
- func HasSmoothFinalizer(rollingset *carbonv1.RollingSet) bool
- func RecordRollingsetHistory(rollingset *carbonv1.RollingSet)
- func Signature(a interface{}) (string, error)
- type ByAvailableAndName
- type ByDeletionCost
- type ByScore
- type ByUnAssignedSlot
- type CmpFunc
- type Controller
- type InPlaceScheduler
- type InactiveStandbyRedundantSort
- type Int64Slice
- type RedundantSort
Constants ¶
const ( // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" // RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment. RevisionHistoryAnnotation = "deployment.kubernetes.io/revision-history" // DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation // in its replica sets. Helps in separating scaling events from the rollout process and for // determining if the new replica set for a deployment is really saturated. DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas" // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which // is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their // proportions in case the deployment has surge replicas. MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas" // RollbackRevisionNotFound is not found rollback event reason RollbackRevisionNotFound = "DeploymentRollbackRevisionNotFound" // RollbackTemplateUnchanged is the template unchanged rollback event reason RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged" // RollbackDone is the done rollback event reason RollbackDone = "DeploymentRollback" // ReplicaUpdatedReason is added in a deployment when one of its replica sets is updated as part // of the rollout process. ReplicaUpdatedReason = "ReplicaUpdated" // FailedReplicaCreateReason is added in a deployment when it cannot create a new replica set. FailedReplicaCreateReason = "ReplicaCreateError" // NewReplicaReason is added in a deployment when it creates a new replica set. NewReplicaReason = "NewReplicaCreated" // FoundNewReplicaReason is added in a deployment when it adopts an existing replica set. FoundNewReplicaReason = "FoundNewReplica" // NewReplicaAvailableReason is added in a deployment when its newest replica set is made available // ie. the number of new pods that have passed readiness checks and run for at least minReadySeconds // is at least the minimum available pods that need to run for the deployment. NewReplicaAvailableReason = "NewReplicaAvailable" // TimedOutReason is added in a deployment when its newest replica set fails to show any progress // within the given deadline (progressDeadlineSeconds). TimedOutReason = "ProgressDeadlineExceeded" // PausedDeployReason is added in a deployment when it is paused. Lack of progress shouldn't be // estimated once a deployment is paused. PausedDeployReason = "RollingsetPaused" // ResumedDeployReason is added in a deployment when it is resumed. Useful for not failing accidentally // deployments that paused amidst a rollout and are bounded by a deadline. ResumedDeployReason = "RollingsetResumed" // MinimumReplicasAvailable is added in a deployment when it has its minimum replicas required available. MinimumReplicasAvailable = "MinimumReplicasAvailable" // available. MinimumReplicasUnavailable = "MinimumReplicasUnavailable" //ReplicaMaxBatchSize rolling处理replica一次批量上限 ReplicaMaxBatchSize = 4000 //TimeFormat TimeFormat TimeFormat = "2006-01-02-15-04-05" )
const (
// SuccessSynced is used as part of the Event 'reason' when a Rollingset is synced
SuccessSynced = "Synced"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateStatus ¶
func CalculateStatus(rollingset *carbonv1.RollingSet, replicaSet []*carbonv1.Replica) (carbonv1.RollingSetStatus, int64)
CalculateStatus calculates the latest status for the provided deployment by looking into the provided replica sets.
func CheckSum ¶
func CheckSum(rollingset *carbonv1.RollingSet) (string, error)
CheckSum rollingset checksum
func GetActiveReplicaCount ¶
func GetActiveReplicaCount(replicaSet []*carbonv1.Replica) (activeReplicas, notAssignedReplicas, workerModeNotMatchReplicas int32)
GetActiveReplicaCount returns the number of active pods corresponding to the given replica sets.
func GetAllocatedReplicaCount ¶
GetAllocatedReplicaCount returns the number of allocated pods corresponding to the given replica sets.
func GetAvailableReplicaCount ¶
GetAvailableReplicaCount returns the number of available pods corresponding to the given replica sets.
func GetCompleteReplicaCount ¶
GetCompleteReplicaCount 已完成的replica数
func GetReleasingReplicaCount ¶
GetReleasingReplicaCount 获取rs释放中的replica数
func GetTotalWorkers ¶
GetTotalWorkers GetTotalWorkers
func GetUpdatedReplicaCount ¶
GetUpdatedReplicaCount 已更新的replica数
func GetVersionCount ¶
GetVersionCount 获取rollingset的版本数
func GroupByStandbyCount ¶
GroupByStandbyCount return cold warm hot standby count
func HasSmoothFinalizer ¶
func HasSmoothFinalizer(rollingset *carbonv1.RollingSet) bool
HasSmoothFinalizer 是否带了SmoothFinalizer
func RecordRollingsetHistory ¶
func RecordRollingsetHistory(rollingset *carbonv1.RollingSet)
RecordRollingsetHistory 记录rollingset版本变更信息
Types ¶
type ByAvailableAndName ¶
ByAvailableAndName 按照可用度排序, UnAvaiable,UnAssignedSolt排前面
func (ByAvailableAndName) Len ¶
func (a ByAvailableAndName) Len() int
func (ByAvailableAndName) Less ¶
func (a ByAvailableAndName) Less(i, j int) bool
func (ByAvailableAndName) Swap ¶
func (a ByAvailableAndName) Swap(i, j int)
type ByDeletionCost ¶
func (ByDeletionCost) Len ¶
func (a ByDeletionCost) Len() int
func (ByDeletionCost) Less ¶
func (a ByDeletionCost) Less(i, j int) bool
func (ByDeletionCost) Swap ¶
func (a ByDeletionCost) Swap(i, j int)
type ByUnAssignedSlot ¶
ByUnAssignedSlot 按照AssignedSlot排序, AssignedSolt排前面
func (ByUnAssignedSlot) Len ¶
func (a ByUnAssignedSlot) Len() int
func (ByUnAssignedSlot) Less ¶
func (a ByUnAssignedSlot) Less(i, j int) bool
func (ByUnAssignedSlot) Swap ¶
func (a ByUnAssignedSlot) Swap(i, j int)
type Controller ¶
type Controller struct { controller.DefaultController // contains filtered or unexported fields }
Controller is the controller implementation for RollingSet resources
func NewController ¶
func NewController(cluster string, kubeclientset kubernetes.Interface, carbonclientset clientset.Interface, rollingSetInformer informers.RollingSetInformer, workerInformer informers.WorkerNodeInformer, writeLabels map[string]string) *Controller
NewController returns a new rollingset controller
func (*Controller) DeleteSubObj ¶
func (c *Controller) DeleteSubObj(namespace, name string) error
DeleteSubObj do garbage collect
func (*Controller) GetObj ¶
func (c *Controller) GetObj(namespace, key string) (interface{}, error)
GetObj grep rollingSet
func (*Controller) Sync ¶
func (c *Controller) Sync(key string) error
Sync compares the actual state with the desired, and attempts to converge the two.
func (*Controller) WaitForCacheSync ¶
func (c *Controller) WaitForCacheSync(stopCh <-chan struct{}) bool
WaitForCacheSync wait informers synced
type InPlaceScheduler ¶
type InPlaceScheduler struct {
// contains filtered or unexported fields
}
InPlaceScheduler schedule the replicas in place
type InactiveStandbyRedundantSort ¶
InactiveStandbyRedundantSort Assigned/OnActive排前面
func (InactiveStandbyRedundantSort) Len ¶
func (a InactiveStandbyRedundantSort) Len() int
func (InactiveStandbyRedundantSort) Less ¶
func (a InactiveStandbyRedundantSort) Less(i, j int) bool
func (InactiveStandbyRedundantSort) Swap ¶
func (a InactiveStandbyRedundantSort) Swap(i, j int)
type Int64Slice ¶
type Int64Slice []int64
func (Int64Slice) Len ¶
func (x Int64Slice) Len() int
func (Int64Slice) Less ¶
func (x Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (x Int64Slice) Swap(i, j int)
type RedundantSort ¶
RedundantSort Assigned/OnActive排前面
func (RedundantSort) Len ¶
func (a RedundantSort) Len() int
func (RedundantSort) Less ¶
func (a RedundantSort) Less(i, j int) bool
func (RedundantSort) Swap ¶
func (a RedundantSort) Swap(i, j int)