resources

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OverSubRatio is the parameter, that determines how much percentage of the traffic to shift
	// from the old to the new revision during each stage in the progressive rollout.
	OverSubRatio = 10

	// DefaultStageRolloutTimeout is the default timeout for stage to accomplish during the rollout.
	DefaultStageRolloutTimeout = 2

	// GroupName is the group name.
	GroupName = "rollout.knative.dev"

	// OverConsumptionRatioKey is the annotation key Knative Service can use to specify the over consumption ratio.
	OverConsumptionRatioKey = GroupName + "/over-consumption-ratio"

	// StageRolloutTimeout is the annotation key Knative Service can use to specify the stage rollout timeout.
	StageRolloutTimeout = GroupName + "/stage-rollout-timeout"

	// ProgressiveRolloutEnabled is the annotation key Knative Service can use to enable or disable the progressive rollout.
	ProgressiveRolloutEnabled = GroupName + "/progressive-rollout-enabled"

	// ConfigMapName is the name of the ConfigMap, that saves the configuration information about the rollout orchestrator.
	ConfigMapName = "config-rolloutorchestrator"

	// ConfigMapNetworkName is the name of the ConfigMap, that saves the configuration information about the network.
	ConfigMapNetworkName = "config-network"
)

Functions

func GetFinalTargetRevision added in v0.40.4

func GetFinalTargetRevision(service *servingv1.Service, config *servingv1.Configuration,
	records map[string]RevisionRecord) []v1.TargetRevision

GetFinalTargetRevision is used to generate the ultimateRevisionTarget. Both of them are needed for the RolloutOrchestrator creation. Only ultimateRevisionTarget for the RolloutOrchestrator update.

func GetInitialTargetRevision added in v0.40.4

func GetInitialTargetRevision(service *servingv1.Service, config *servingv1.Configuration,
	records map[string]RevisionRecord, route *servingv1.Route) []v1.TargetRevision

GetInitialTargetRevision is used to generate the initialTargetRevision. Both of them are needed for the RolloutOrchestrator creation. Only ultimateRevisionTarget for the RolloutOrchestrator update.

func NewInitialFinalTargetRev

func NewInitialFinalTargetRev(initialRevisionStatus, ultimateRevisionTarget []v1.TargetRevision,
	service *servingv1.Service) *v1.RolloutOrchestrator

NewInitialFinalTargetRev creates a RolloutOrchestrator with InitialRevisions and TargetRevisions.

func ReadIntAnnotation

func ReadIntAnnotation(revision *servingv1.Revision, key string) (result *int32)

ReadIntAnnotation reads the int value of a specific key in the annotation of the revision.

func ReadIntRevisionRecord

func ReadIntRevisionRecord(val RevisionRecord) (min *int32, max *int32)

ReadIntRevisionRecord reads the minScale and maxScale in the RevisionRecord.

func ReadIntServiceAnnotation

func ReadIntServiceAnnotation(service *servingv1.Service, key string) (result *int32)

ReadIntServiceAnnotation reads the int value of a specific key in the annotation of the service.

func UpdateInitialFinalTargetRev

func UpdateInitialFinalTargetRev(ultimateRevisionTarget []v1.TargetRevision, ro *v1.RolloutOrchestrator,
	route *servingv1.Route, deploymentLister appsv1listers.DeploymentLister)

UpdateInitialFinalTargetRev updates InitialRevisions, TargetRevisions and StageTargetRevisions for RolloutOrchestrator. Param: ultimateRevisionTarget is the most updated target revisions. Param: ro is the custom resource of RolloutOrchestrator.

Types

type RevisionRecord

type RevisionRecord struct {
	MinScale *int32
	MaxScale *int32
	Name     string
}

RevisionRecord is a struct that hosts the name, minScale and maxScale for the revision.

Jump to

Keyboard shortcuts

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