workloads

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 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 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 DeploymentRolloutController added in v1.0.4

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

DeploymentRolloutController is responsible for handling rollout deployment type of workloads

func NewDeploymentRolloutController added in v1.1.0

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 added in v1.0.4

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 added in v1.0.4

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

Finalize makes sure the Deployment is all upgraded

func (*DeploymentRolloutController) FinalizeOneBatch added in v1.0.4

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

FinalizeOneBatch makes sure that the rollout status are updated correctly

func (*DeploymentRolloutController) Initialize added in v1.0.4

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 added in v1.0.4

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 added in v1.0.4

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

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

type DeploymentScaleController added in v1.0.4

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

DeploymentScaleController is responsible for handle scale Deployment type of workloads

func NewDeploymentScaleController added in v1.0.4

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 added in v1.0.4

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 added in v1.0.4

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

Finalize makes sure the deployment is scaled and ready to use

func (*DeploymentScaleController) FinalizeOneBatch added in v1.0.4

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 added in v1.0.4

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

Initialize makes sure that the deployment is under our control

func (*DeploymentScaleController) RolloutOneBatchPods added in v1.0.4

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 added in v1.0.4

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

VerifySpec verifies that the deployment is stable and can be scaled

type StatefulSetRolloutController added in v1.1.3

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

StatefulSetRolloutController is responsible for handle rollout StatefulSet type of workloads

func NewStatefulSetRolloutController added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

Finalize makes sure the StatefulSet is all upgraded

func (*StatefulSetRolloutController) FinalizeOneBatch added in v1.1.3

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

FinalizeOneBatch makes sure that the rollout status are updated correctly

func (*StatefulSetRolloutController) Initialize added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

type StatefulSetScaleController added in v1.1.0

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

StatefulSetScaleController is responsible for handle scale StatefulSet type of workloads

func NewStatefulSetScaleController added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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

Finalize makes sure the StatefulSet is scaled and ready to use

func (*StatefulSetScaleController) FinalizeOneBatch added in v1.1.0

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 added in v1.1.0

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

Initialize makes sure that the StatefulSet is under our control

func (*StatefulSetScaleController) RolloutOneBatchPods added in v1.1.0

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 added in v1.1.0

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