Documentation
¶
Index ¶
- func BuildWorkload(deployment *models.Deployment, composeContent string, replicas int, ...) (orchestrator.Workload, error)
- func Reconcile(policy Policy, state State, input Input) (State, Decision)
- func ValidatePolicy(policy Policy) error
- type Action
- type ActionExecutor
- type Activation
- type Activator
- type ActiveStore
- type Compatibility
- type Decision
- type EventPublisher
- type Execution
- type Executor
- type Input
- type Policy
- type PolicyStore
- type ReconcileResult
- type Runner
- type RuntimeFactory
- type RuntimeSession
- type ServiceStopper
- type ServiceStopperFunc
- type State
- type Store
- func (s *Store) ActiveStates() (map[string]State, error)
- func (s *Store) Close() error
- func (s *Store) Policy(deployment string) (Policy, error)
- func (s *Store) SetPolicy(deployment string, policy Policy) error
- func (s *Store) SetState(deployment string, state State) error
- func (s *Store) State(deployment string) (State, error)
- type Supervisor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWorkload ¶
func BuildWorkload(deployment *models.Deployment, composeContent string, replicas int, proxyNetwork string) (orchestrator.Workload, error)
func ValidatePolicy ¶
Types ¶
type ActionExecutor ¶
type Activation ¶
type Activation struct {
Workload orchestrator.Status `json:"workload"`
Route routing.Route `json:"route"`
}
type Activator ¶
type Activator struct {
// contains filtered or unexported fields
}
func NewActivator ¶
func NewActivator(orchestratorProvider orchestrator.Provider, routingProvider routing.Provider, stopper ServiceStopper) *Activator
func (*Activator) Activate ¶
func (a *Activator) Activate(ctx context.Context, deployment, service string, workload orchestrator.Workload, route routing.Route) (Activation, error)
func (*Activator) ActivateDurably ¶
func (a *Activator) ActivateDurably(ctx context.Context, deployment, service string, workload orchestrator.Workload, route routing.Route, persist func(Activation) error) (Activation, error)
type ActiveStore ¶
type ActiveStore interface {
PolicyStore
ActiveStates() (map[string]State, error)
}
type Compatibility ¶
type Compatibility struct {
Compatible bool `json:"compatible"`
Service string `json:"service,omitempty"`
Image string `json:"image,omitempty"`
Blockers []string `json:"blockers"`
Warnings []string `json:"warnings"`
Services []string `json:"services"`
Workload *models.ScalingConfig `json:"workload,omitempty"`
}
func AssessCompatibility ¶
func AssessCompatibility(deployment *models.Deployment, composeContent string) Compatibility
type Decision ¶
type Decision struct {
Action Action `json:"action"`
Replicas int `json:"replicas,omitempty"`
Resources orchestrator.Resources `json:"resources,omitempty"`
Reason string `json:"reason"`
}
type EventPublisher ¶
type EventPublisher interface {
Publish(events.Event) (events.IngestResult, error)
}
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(orchestrator orchestrator.Provider, routing routing.Provider) *Executor
type Policy ¶
type Policy struct {
Enabled bool `json:"enabled"`
MinReplicas int `json:"min_replicas"`
MaxReplicas int `json:"max_replicas"`
ScaleUpPercent float64 `json:"scale_up_percent"`
ScaleDownPercent float64 `json:"scale_down_percent"`
ScaleUpWindows int `json:"scale_up_windows"`
ScaleDownWindows int `json:"scale_down_windows"`
Cooldown time.Duration `json:"cooldown"`
AllowFleetCapacity bool `json:"allow_fleet_capacity"`
}
func DefaultPolicy ¶
func DefaultPolicy() Policy
type PolicyStore ¶
type ReconcileResult ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(store PolicyStore, executor ActionExecutor, publisher EventPublisher, node string) *Runner
type RuntimeFactory ¶
type RuntimeSession ¶
type RuntimeSession struct {
Input Input
Executor ActionExecutor
Close func() error
}
type ServiceStopperFunc ¶
func (ServiceStopperFunc) StopService ¶
func (f ServiceStopperFunc) StopService(deployment, service string) (string, error)
type State ¶
type State struct {
HighWindows int `json:"high_windows"`
LowWindows int `json:"low_windows"`
LastAction time.Time `json:"last_action,omitempty"`
Active bool `json:"active"`
Provider orchestrator.ProviderID `json:"provider,omitempty"`
Service string `json:"service,omitempty"`
Replicas int `json:"replicas,omitempty"`
Route routing.Route `json:"route,omitempty"`
}
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor(store ActiveStore, factory RuntimeFactory, publisher EventPublisher, node string, interval time.Duration) *Supervisor
func (*Supervisor) Run ¶
func (s *Supervisor) Run(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.