Documentation
¶
Index ¶
- Constants
- func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error
- func EffectiveUpdateStrategyType(stormService *orchestrationv1alpha1.StormService) (orchestrationv1alpha1.StormServiceUpdateStrategyType, error)
- func IsRollingUpdate(stormService *orchestrationv1alpha1.StormService) bool
- func MaxSurge(stormService *orchestrationv1alpha1.StormService) int32
- func MaxUnavailable(stormService orchestrationv1alpha1.StormService) int32
- func MinAvailable(stormService *orchestrationv1alpha1.StormService) int32
- func RemoveStormServiceCondition(status *orchestrationv1alpha1.StormServiceStatus, ...)
- func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
- func SetStormServiceCondition(status *orchestrationv1alpha1.StormServiceStatus, ...)
- type StormServiceReconciler
Constants ¶
const ( ProgressingReason = "Processing" ProgressDeadlineExceededReason = "ProgressDeadlineExceeded" PausedReason = "DeploymentPaused" ResumedReason = "DeploymentResumed" )
const ( ControllerName = "stormservice-controller" DefaultRequeueAfter = 15 * time.Second DefaultRevisionHistoryLimit = 10 StormServiceFinalizer = "orchestration.aibrix.ai/stormservice-finalizer" )
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
func EffectiveUpdateStrategyType(stormService *orchestrationv1alpha1.StormService) (orchestrationv1alpha1.StormServiceUpdateStrategyType, error)
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