Documentation ¶
Index ¶
- type CloneSetRolloutController
- func (c *CloneSetRolloutController) CheckOneBatchPods(ctx context.Context) (bool, error)
- func (c *CloneSetRolloutController) Finalize(ctx context.Context, succeed bool) bool
- func (c *CloneSetRolloutController) FinalizeOneBatch(ctx context.Context) (bool, error)
- func (c *CloneSetRolloutController) Initialize(ctx context.Context) (bool, error)
- func (c *CloneSetRolloutController) RolloutOneBatchPods(ctx context.Context) (bool, error)
- func (c *CloneSetRolloutController) VerifySpec(ctx context.Context) (bool, error)
- type CloneSetScaleController
- func (s *CloneSetScaleController) CheckOneBatchPods(ctx context.Context) (bool, error)
- func (s *CloneSetScaleController) Finalize(ctx context.Context, succeed bool) bool
- func (s *CloneSetScaleController) FinalizeOneBatch(ctx context.Context) (bool, error)
- func (s *CloneSetScaleController) Initialize(ctx context.Context) (bool, error)
- func (s *CloneSetScaleController) RolloutOneBatchPods(ctx context.Context) (bool, error)
- func (s *CloneSetScaleController) VerifySpec(ctx context.Context) (bool, error)
- type DeploymentController
- func (c *DeploymentController) CheckOneBatchPods(ctx context.Context) (bool, error)
- func (c *DeploymentController) Finalize(ctx context.Context, succeed bool) bool
- func (c *DeploymentController) FinalizeOneBatch(ctx context.Context) (bool, error)
- func (c *DeploymentController) Initialize(ctx context.Context) (bool, error)
- func (c *DeploymentController) RolloutOneBatchPods(ctx context.Context) (bool, error)
- func (c *DeploymentController) VerifySpec(ctx context.Context) (bool, error)
- type WorkloadController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloneSetRolloutController ¶ added in v1.0.2
type CloneSetRolloutController struct {
// contains filtered or unexported fields
}
CloneSetRolloutController is responsible for handle rollout Cloneset type of workloads
func NewCloneSetRolloutController ¶ added in v1.0.2
func NewCloneSetRolloutController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, workloadName types.NamespacedName) *CloneSetRolloutController
NewCloneSetRolloutController creates a new Cloneset rollout controller
func (*CloneSetRolloutController) CheckOneBatchPods ¶ added in v1.0.2
func (c *CloneSetRolloutController) CheckOneBatchPods(ctx context.Context) (bool, error)
CheckOneBatchPods checks to see if enough pods are upgraded according to the rollout plan
func (*CloneSetRolloutController) Finalize ¶ added in v1.0.2
func (c *CloneSetRolloutController) Finalize(ctx context.Context, succeed bool) bool
Finalize makes sure the Cloneset is all upgraded
func (*CloneSetRolloutController) FinalizeOneBatch ¶ added in v1.0.2
func (c *CloneSetRolloutController) FinalizeOneBatch(ctx context.Context) (bool, error)
FinalizeOneBatch makes sure that the upgradedReplicas and current batch in the status are valid according to the spec
func (*CloneSetRolloutController) Initialize ¶ added in v1.0.2
func (c *CloneSetRolloutController) Initialize(ctx context.Context) (bool, error)
Initialize makes sure that the cloneset is under our control
func (*CloneSetRolloutController) RolloutOneBatchPods ¶ added in v1.0.2
func (c *CloneSetRolloutController) RolloutOneBatchPods(ctx context.Context) (bool, error)
RolloutOneBatchPods calculates the number of pods we can upgrade once according to the rollout spec and then set the partition accordingly, return if we are done
func (*CloneSetRolloutController) VerifySpec ¶ added in v1.0.2
func (c *CloneSetRolloutController) VerifySpec(ctx context.Context) (bool, error)
VerifySpec verifies that the target rollout resource is consistent with the rollout spec
type CloneSetScaleController ¶ added in v1.0.2
type CloneSetScaleController struct {
// contains filtered or unexported fields
}
CloneSetScaleController is responsible for handle scale Cloneset type of workloads
func NewCloneSetScaleController ¶ added in v1.0.2
func NewCloneSetScaleController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, workloadName types.NamespacedName) *CloneSetScaleController
NewCloneSetScaleController creates CloneSet scale controller
func (*CloneSetScaleController) CheckOneBatchPods ¶ added in v1.0.2
func (s *CloneSetScaleController) CheckOneBatchPods(ctx context.Context) (bool, error)
CheckOneBatchPods checks to see if the pods are scaled according to the rollout plan
func (*CloneSetScaleController) Finalize ¶ added in v1.0.2
func (s *CloneSetScaleController) Finalize(ctx context.Context, succeed bool) bool
Finalize makes sure the Cloneset is scaled and ready to use
func (*CloneSetScaleController) FinalizeOneBatch ¶ added in v1.0.2
func (s *CloneSetScaleController) FinalizeOneBatch(ctx context.Context) (bool, error)
FinalizeOneBatch makes sure that the current batch and replica count in the status are validate
func (*CloneSetScaleController) Initialize ¶ added in v1.0.2
func (s *CloneSetScaleController) Initialize(ctx context.Context) (bool, error)
Initialize makes sure that the cloneset is under our control
func (*CloneSetScaleController) RolloutOneBatchPods ¶ added in v1.0.2
func (s *CloneSetScaleController) RolloutOneBatchPods(ctx context.Context) (bool, error)
RolloutOneBatchPods calculates the number of pods we can scale to according to the rollout spec
func (*CloneSetScaleController) VerifySpec ¶ added in v1.0.2
func (s *CloneSetScaleController) VerifySpec(ctx context.Context) (bool, error)
VerifySpec verifies that the cloneset is stable and can be scaled
type DeploymentController ¶ added in v1.0.0
type DeploymentController struct {
// contains filtered or unexported fields
}
DeploymentController is responsible for handling rollout deployment type of workloads
func NewDeploymentController ¶ added in v1.0.0
func NewDeploymentController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, sourceNamespacedName, targetNamespacedName types.NamespacedName) *DeploymentController
NewDeploymentController creates a new deployment rollout controller
func (*DeploymentController) CheckOneBatchPods ¶ added in v1.0.0
func (c *DeploymentController) CheckOneBatchPods(ctx context.Context) (bool, error)
CheckOneBatchPods checks to see if the pods are all available according to the rollout plan
func (*DeploymentController) Finalize ¶ added in v1.0.0
func (c *DeploymentController) Finalize(ctx context.Context, succeed bool) bool
Finalize makes sure the Deployment is all upgraded
func (*DeploymentController) FinalizeOneBatch ¶ added in v1.0.0
func (c *DeploymentController) FinalizeOneBatch(ctx context.Context) (bool, error)
FinalizeOneBatch makes sure that the rollout status are updated correctly
func (*DeploymentController) Initialize ¶ added in v1.0.0
func (c *DeploymentController) Initialize(ctx context.Context) (bool, error)
Initialize makes sure that the source and target deployment is under our control
func (*DeploymentController) RolloutOneBatchPods ¶ added in v1.0.0
func (c *DeploymentController) RolloutOneBatchPods(ctx context.Context) (bool, error)
RolloutOneBatchPods calculates the number of pods we can upgrade once according to the rollout spec and then set the partition accordingly
func (*DeploymentController) VerifySpec ¶ added in v1.0.0
func (c *DeploymentController) VerifySpec(ctx context.Context) (bool, error)
VerifySpec verifies that the rollout resource is consistent with the rollout spec
type WorkloadController ¶
type WorkloadController interface { // VerifySpec makes sure that the resources can be upgraded according to the rollout plan // it returns if the verification succeeded/failed or should retry VerifySpec(ctx context.Context) (bool, error) // Initialize make sure that the resource is ready to be upgraded // this function is tasked to do any initialization work on the resources // it returns if the initialization succeeded/failed or should retry Initialize(ctx context.Context) (bool, error) // RolloutOneBatchPods tries to upgrade pods in the resources following the rollout plan // it will upgrade pods as the rollout plan allows at once // it returns if the upgrade actionable items succeeded/failed or should continue RolloutOneBatchPods(ctx context.Context) (bool, error) // CheckOneBatchPods checks how many pods are ready to serve requests in the current batch // it returns whether the number of pods upgraded in this round satisfies the rollout plan CheckOneBatchPods(ctx context.Context) (bool, error) // FinalizeOneBatch makes sure that the rollout can start the next batch // it returns if the finalization of this batch succeeded/failed or should retry FinalizeOneBatch(ctx context.Context) (bool, error) // Finalize makes sure the resources are in a good final state. // It might depend on if the rollout succeeded or not. // For example, we may remove the source object to prevent scalar traits to ever work // and the finalize rollout web hooks will be called after this call succeeds Finalize(ctx context.Context, succeed bool) bool }
WorkloadController is the interface that all type of cloneSet controller implements