strategies

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package strategies provides built-in deployment strategy implementations. Strategies control how application updates are rolled out to instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlueGreen

type BlueGreen struct{}

BlueGreen implements a blue-green deployment strategy that provisions a new environment and switches traffic once ready.

func NewBlueGreen

func NewBlueGreen() *BlueGreen

NewBlueGreen returns a new blue-green deployment strategy.

func (*BlueGreen) Execute

func (s *BlueGreen) Execute(ctx context.Context, params deploy.StrategyParams) error

Execute performs a blue-green deployment by spinning up a new environment and switching traffic to it. Per-service progress advances in lockstep — the cutover is atomic across all services.

func (*BlueGreen) Name

func (s *BlueGreen) Name() string

Name returns the strategy identifier.

type Canary

type Canary struct{}

Canary implements a canary deployment strategy that rolls services out one at a time, marking each as succeeded before moving to the next. If any service fails, the strategy aborts — services not yet rolled out stay pending; the deploy.Service marks the deployment itself Failed so callers can rollback the whole release.

Canary uses partial-deploy semantics: each Deploy call to the provider lists exactly one service. The provider patches that service's container/task in place without disturbing the rest.

func NewCanary

func NewCanary() *Canary

NewCanary returns a new canary deployment strategy.

func (*Canary) Execute

func (s *Canary) Execute(ctx context.Context, params deploy.StrategyParams) error

Execute rolls services out one at a time, advancing ServiceProgress as each completes.

func (*Canary) Name

func (s *Canary) Name() string

Name returns the strategy identifier.

type Recreate

type Recreate struct{}

Recreate implements a recreate deployment strategy that stops the current version before starting the new one, resulting in brief downtime.

func NewRecreate

func NewRecreate() *Recreate

NewRecreate returns a new recreate deployment strategy.

func (*Recreate) Execute

func (s *Recreate) Execute(ctx context.Context, params deploy.StrategyParams) error

Execute performs a recreate deployment by stopping the current version and starting the new one. Like Rolling, this advances every service through the same state in lockstep — the provider does the actual stop/start.

func (*Recreate) Name

func (s *Recreate) Name() string

Name returns the strategy identifier.

type Rolling

type Rolling struct{}

Rolling implements a rolling update strategy that gradually replaces instances with the new version.

func NewRolling

func NewRolling() *Rolling

NewRolling returns a new rolling update strategy.

func (*Rolling) Execute

func (s *Rolling) Execute(ctx context.Context, params deploy.StrategyParams) error

Execute performs a rolling deployment by handing the entire Services slice to the provider in one shot — the provider's runtime (k8s rollingUpdate, nomad update, docker recreate-per-service) does the per-replica gradient. ServiceProgress is updated in lockstep: every service goes pending → running → succeeded together.

func (*Rolling) Name

func (s *Rolling) Name() string

Name returns the strategy identifier.

Jump to

Keyboard shortcuts

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