stormservice

package
v0.8.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 34 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProgressingReason              = "Processing"
	ProgressDeadlineExceededReason = "ProgressDeadlineExceeded"
	PausedReason                   = "DeploymentPaused"
	ResumedReason                  = "DeploymentResumed"
)
View Source
const (
	ControllerName              = "stormservice-controller"
	DefaultRequeueAfter         = 15 * time.Second
	DefaultRevisionHistoryLimit = 10
	StormServiceFinalizer       = "orchestration.aibrix.ai/stormservice-finalizer"
)
View Source
const (
	ScalingEventType         = "Scaling"
	RolloutEventType         = "Rollout"
	HeadlessServiceEventType = "HeadlessServiceSynced"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error

Add creates a new ModelAdapter Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func EffectiveUpdateStrategyType added in v0.8.0

EffectiveUpdateStrategyType returns the update strategy type that drives the rollout path.

A declared spec.mode is the source of truth: Replica mode replaces RoleSets through the RollingUpdate path and Pooled mode updates its single RoleSet through the InPlaceUpdate path. The webhook rejects a declared InPlaceUpdate strategy combined with Replica mode. The reverse conflict (Pooled with RollingUpdate) cannot be rejected at admission because the CRD defaults spec.updateStrategy.type to RollingUpdate whenever the updateStrategy block is present, so a RollingUpdate value is indistinguishable from the default; the controller resolves that conflict in favor of the declared mode and logs the override at verbose level only, because it recurs on every reconcile.

When spec.mode is unset, the legacy updateStrategy.type selection is kept so existing manifests behave as before. ResolvedMode is intentionally not consulted for the inferred case: its replicas-based inference does not always match the declared strategy type (for example replicas: 1 with RollingUpdate infers Pooled but must keep rolling).

func IsRollingUpdate

func IsRollingUpdate(stormService *orchestrationv1alpha1.StormService) bool

IsRollingUpdate returns true if the effective strategy type is a rolling update.

It intentionally resolves the strategy through EffectiveUpdateStrategyType instead of reading spec.updateStrategy.type directly, so a declared spec.mode wins over the (possibly CRD-defaulted) strategy type. In Pooled mode this returns false, which makes MaxSurge, MaxUnavailable and MinAvailable evaluate to 0 and keeps scaling() from ever creating RoleSets beyond spec.replicas for a pooled StormService.

func MaxSurge

func MaxSurge(stormService *orchestrationv1alpha1.StormService) int32

MaxSurge returns the maximum surge roleSets a rolling stormService can take.

func MaxUnavailable

func MaxUnavailable(stormService orchestrationv1alpha1.StormService) int32

MaxUnavailable returns the maximum unavailable roleSets a rolling stormService can take.

func MinAvailable

func MinAvailable(stormService *orchestrationv1alpha1.StormService) int32

MinAvailable returns the minimum available roleSets of a given stormService

func RemoveStormServiceCondition

func RemoveStormServiceCondition(status *orchestrationv1alpha1.StormServiceStatus, condType orchestrationv1alpha1.ConditionType)

RemoveStormServiceCondition removes the stormService condition with the provided type.

func ResolveFenceposts

func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)

ResolveFenceposts resolves both maxSurge and maxUnavailable. This needs to happen in one step. For example:

2 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1), then old(-1), then new(+1) 1 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1) 2 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1) 2 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1)

func SetStormServiceCondition

func SetStormServiceCondition(status *orchestrationv1alpha1.StormServiceStatus, condition orchestrationv1alpha1.Condition)

SetStormServiceCondition updates the stormService to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.

Types

type StormServiceReconciler

type StormServiceReconciler struct {
	client.Client
	Scheme        *runtime.Scheme
	EventRecorder record.EventRecorder
}

StormServiceReconciler reconciles a StormService object

func (*StormServiceReconciler) Reconcile

func (r *StormServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Jump to

Keyboard shortcuts

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