Documentation ¶
Index ¶
- type GlobalOrchestrator
- type ReplicatedOrchestrator
- type RestartSupervisor
- func (r *RestartSupervisor) Cancel(taskID string)
- func (r *RestartSupervisor) CancelAll()
- func (r *RestartSupervisor) ClearServiceHistory(serviceID string)
- func (r *RestartSupervisor) DelayStart(ctx context.Context, _ store.Tx, oldTask *api.Task, newTaskID string, ...) <-chan struct{}
- func (r *RestartSupervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, ...) error
- func (r *RestartSupervisor) StartNow(tx store.Tx, taskID string) error
- type TaskReaper
- type UpdateSupervisor
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalOrchestrator ¶
type GlobalOrchestrator struct {
// contains filtered or unexported fields
}
GlobalOrchestrator runs a reconciliation loop to create and destroy tasks as necessary for global services.
func NewGlobalOrchestrator ¶
func NewGlobalOrchestrator(store *store.MemoryStore) *GlobalOrchestrator
NewGlobalOrchestrator creates a new GlobalOrchestrator
func (*GlobalOrchestrator) Run ¶
func (g *GlobalOrchestrator) Run(ctx context.Context) error
Run contains the GlobalOrchestrator event loop
type ReplicatedOrchestrator ¶
type ReplicatedOrchestrator struct {
// contains filtered or unexported fields
}
A ReplicatedOrchestrator runs a reconciliation loop to create and destroy tasks as necessary for the replicated services.
func NewReplicatedOrchestrator ¶
func NewReplicatedOrchestrator(store *store.MemoryStore) *ReplicatedOrchestrator
NewReplicatedOrchestrator creates a new ReplicatedOrchestrator.
func (*ReplicatedOrchestrator) Run ¶
func (r *ReplicatedOrchestrator) Run(ctx context.Context) error
Run contains the orchestrator event loop. It runs until Stop is called.
func (*ReplicatedOrchestrator) Stop ¶
func (r *ReplicatedOrchestrator) Stop()
Stop stops the orchestrator.
type RestartSupervisor ¶
type RestartSupervisor struct {
// contains filtered or unexported fields
}
RestartSupervisor initiates and manages restarts. It's responsible for delaying restarts when applicable.
func NewRestartSupervisor ¶
func NewRestartSupervisor(store *store.MemoryStore) *RestartSupervisor
NewRestartSupervisor creates a new RestartSupervisor.
func (*RestartSupervisor) Cancel ¶
func (r *RestartSupervisor) Cancel(taskID string)
Cancel cancels a pending restart.
func (*RestartSupervisor) CancelAll ¶
func (r *RestartSupervisor) CancelAll()
CancelAll aborts all pending restarts and waits for any instances of StartNow that have already triggered to complete.
func (*RestartSupervisor) ClearServiceHistory ¶
func (r *RestartSupervisor) ClearServiceHistory(serviceID string)
ClearServiceHistory forgets restart history related to a given service ID.
func (*RestartSupervisor) DelayStart ¶
func (r *RestartSupervisor) DelayStart(ctx context.Context, _ store.Tx, oldTask *api.Task, newTaskID string, delay time.Duration, waitStop bool) <-chan struct{}
DelayStart starts a timer that moves the task from READY to RUNNING once: - The restart delay has elapsed (if applicable) - The old task that it's replacing has stopped running (or this times out) It must be called during an Update transaction to ensure that it does not miss events. The purpose of the store.Tx argument is to avoid accidental calls outside an Update transaction.
type TaskReaper ¶
type TaskReaper struct {
// contains filtered or unexported fields
}
A TaskReaper deletes old tasks when more than TaskHistoryRetentionLimit tasks exist for the same service/instance or service/nodeid combination.
func NewTaskReaper ¶
func NewTaskReaper(store *store.MemoryStore) *TaskReaper
NewTaskReaper creates a new TaskReaper.
func (*TaskReaper) Stop ¶
func (tr *TaskReaper) Stop()
Stop stops the TaskReaper and waits for the main loop to exit.
type UpdateSupervisor ¶
type UpdateSupervisor struct {
// contains filtered or unexported fields
}
UpdateSupervisor supervises a set of updates. It's responsible for keeping track of updates, shutting them down and replacing them.
func NewUpdateSupervisor ¶
func NewUpdateSupervisor(store *store.MemoryStore, restartSupervisor *RestartSupervisor) *UpdateSupervisor
NewUpdateSupervisor creates a new UpdateSupervisor.
func (*UpdateSupervisor) CancelAll ¶
func (u *UpdateSupervisor) CancelAll()
CancelAll cancels all current updates.
func (*UpdateSupervisor) Update ¶
func (u *UpdateSupervisor) Update(ctx context.Context, cluster *api.Cluster, service *api.Service, tasks []*api.Task)
Update starts an Update of `tasks` belonging to `service` in the background and returns immediately. If an update for that service was already in progress, it will be cancelled before the new one starts.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater updates a set of tasks to a new version.
func NewUpdater ¶
func NewUpdater(store *store.MemoryStore, restartSupervisor *RestartSupervisor, cluster *api.Cluster, newService *api.Service) *Updater
NewUpdater creates a new Updater.