workloads

package
v0.0.0-...-2c539bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloneSetRolloutController

type CloneSetRolloutController struct {
	// contains filtered or unexported fields
}

CloneSetRolloutController is responsible for handle rollout Cloneset type of workloads

func NewCloneSetRolloutController

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

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

func (c *CloneSetRolloutController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the Cloneset is all upgraded

func (*CloneSetRolloutController) FinalizeOneBatch

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

func (c *CloneSetRolloutController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the cloneset is under our control

func (*CloneSetRolloutController) RolloutOneBatchPods

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

func (c *CloneSetRolloutController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the target rollout resource is consistent with the rollout spec

type CloneSetScaleController

type CloneSetScaleController struct {
	// contains filtered or unexported fields
}

CloneSetScaleController is responsible for handle scale Cloneset type of workloads

func NewCloneSetScaleController

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

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

func (s *CloneSetScaleController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the Cloneset is scaled and ready to use

func (*CloneSetScaleController) FinalizeOneBatch

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

func (s *CloneSetScaleController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the cloneset is under our control

func (*CloneSetScaleController) RolloutOneBatchPods

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

func (s *CloneSetScaleController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the cloneset is stable and can be scaled

type DeploymentRolloutController

type DeploymentRolloutController struct {
	// contains filtered or unexported fields
}

DeploymentRolloutController is responsible for handling rollout deployment type of workloads

func NewDeploymentRolloutController

func NewDeploymentRolloutController(client client.Client, recorder event.Recorder, parentController oam.Object,
	rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, sourceNamespacedName,
	targetNamespacedName types.NamespacedName) *DeploymentRolloutController

NewDeploymentRolloutController creates a new deployment rollout controller

func (*DeploymentRolloutController) CheckOneBatchPods

func (c *DeploymentRolloutController) CheckOneBatchPods(ctx context.Context) (bool, error)

CheckOneBatchPods checks to see if the pods are all available according to the rollout plan

func (*DeploymentRolloutController) Finalize

func (c *DeploymentRolloutController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the Deployment is all upgraded

func (*DeploymentRolloutController) FinalizeOneBatch

func (c *DeploymentRolloutController) FinalizeOneBatch(ctx context.Context) (bool, error)

FinalizeOneBatch makes sure that the rollout status are updated correctly

func (*DeploymentRolloutController) Initialize

func (c *DeploymentRolloutController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the source and target deployment is under our control

func (*DeploymentRolloutController) RolloutOneBatchPods

func (c *DeploymentRolloutController) 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 (*DeploymentRolloutController) VerifySpec

func (c *DeploymentRolloutController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the rollout resource is consistent with the rollout spec

type DeploymentScaleController

type DeploymentScaleController struct {
	// contains filtered or unexported fields
}

DeploymentScaleController is responsible for handle scale Deployment type of workloads

func NewDeploymentScaleController

func NewDeploymentScaleController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, workloadName types.NamespacedName) *DeploymentScaleController

NewDeploymentScaleController creates Deployment scale controller

func (*DeploymentScaleController) CheckOneBatchPods

func (s *DeploymentScaleController) CheckOneBatchPods(ctx context.Context) (bool, error)

CheckOneBatchPods checks to see if the pods are scaled according to the rollout plan

func (*DeploymentScaleController) Finalize

func (s *DeploymentScaleController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the deployment is scaled and ready to use

func (*DeploymentScaleController) FinalizeOneBatch

func (s *DeploymentScaleController) FinalizeOneBatch(ctx context.Context) (bool, error)

FinalizeOneBatch makes sure that the current batch and replica count in the status are validate

func (*DeploymentScaleController) Initialize

func (s *DeploymentScaleController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the deployment is under our control

func (*DeploymentScaleController) RolloutOneBatchPods

func (s *DeploymentScaleController) RolloutOneBatchPods(ctx context.Context) (bool, error)

RolloutOneBatchPods calculates the number of pods we can scale to according to the rollout spec

func (*DeploymentScaleController) VerifySpec

func (s *DeploymentScaleController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the deployment is stable and can be scaled

type StatefulSetRolloutController

type StatefulSetRolloutController struct {
	// contains filtered or unexported fields
}

StatefulSetRolloutController is responsible for handle rollout StatefulSet type of workloads

func NewStatefulSetRolloutController

func NewStatefulSetRolloutController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus,
	targetNamespacedName types.NamespacedName) *StatefulSetRolloutController

NewStatefulSetRolloutController creates StatefulSet rollout controller

func (*StatefulSetRolloutController) CheckOneBatchPods

func (s *StatefulSetRolloutController) CheckOneBatchPods(ctx context.Context) (bool, error)

CheckOneBatchPods checks to see if the pods are all available according to the rollout plan

func (*StatefulSetRolloutController) Finalize

func (s *StatefulSetRolloutController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the StatefulSet is all upgraded

func (*StatefulSetRolloutController) FinalizeOneBatch

func (s *StatefulSetRolloutController) FinalizeOneBatch(ctx context.Context) (bool, error)

FinalizeOneBatch makes sure that the rollout status are updated correctly

func (*StatefulSetRolloutController) Initialize

func (s *StatefulSetRolloutController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the source and target StatefulSet is under our control

func (*StatefulSetRolloutController) RolloutOneBatchPods

func (s *StatefulSetRolloutController) 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 (*StatefulSetRolloutController) VerifySpec

func (s *StatefulSetRolloutController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the rollout resource is consistent with the rollout spec

type StatefulSetScaleController

type StatefulSetScaleController struct {
	// contains filtered or unexported fields
}

StatefulSetScaleController is responsible for handle scale StatefulSet type of workloads

func NewStatefulSetScaleController

func NewStatefulSetScaleController(client client.Client, recorder event.Recorder, parentController oam.Object, rolloutSpec *v1alpha1.RolloutPlan, rolloutStatus *v1alpha1.RolloutStatus, workloadName types.NamespacedName) *StatefulSetScaleController

NewStatefulSetScaleController creates StatefulSet scale controller

func (*StatefulSetScaleController) CheckOneBatchPods

func (s *StatefulSetScaleController) CheckOneBatchPods(ctx context.Context) (bool, error)

CheckOneBatchPods checks to see if the pods are scaled according to the rollout plan

func (*StatefulSetScaleController) Finalize

func (s *StatefulSetScaleController) Finalize(ctx context.Context, succeed bool) bool

Finalize makes sure the StatefulSet is scaled and ready to use

func (*StatefulSetScaleController) FinalizeOneBatch

func (s *StatefulSetScaleController) FinalizeOneBatch(ctx context.Context) (bool, error)

FinalizeOneBatch makes sure that the current batch and replica count in the status are validate

func (*StatefulSetScaleController) Initialize

func (s *StatefulSetScaleController) Initialize(ctx context.Context) (bool, error)

Initialize makes sure that the StatefulSet is under our control

func (*StatefulSetScaleController) RolloutOneBatchPods

func (s *StatefulSetScaleController) RolloutOneBatchPods(ctx context.Context) (bool, error)

RolloutOneBatchPods calculates the number of pods we can scale to according to the rollout spec

func (*StatefulSetScaleController) VerifySpec

func (s *StatefulSetScaleController) VerifySpec(ctx context.Context) (bool, error)

VerifySpec verifies that the StatefulSet is stable and can be scaled

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL