step

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsStep

func AsStep(cs model.ClusterState) model.Step

AsStep creates a Step struct from a ClusterState In other words a Step will result in a ClusterState. This is a helper function to make life easier.

func CreateSteps

func CreateSteps(currentCluster model.ClusterState, targetCluster model.ClusterState, stepOptions ...StepOptions) []model.Step

CreateSteps will generate the Blue, Green steps to switch from a current ClusterState to a target ClusterState.

Starting point for rollback

Phase 1 (only applicable if new cluster is larger than current one) We want to build the extra machines we will need for the new cluster

Phase 2: We can now alternate between adding a node to the new cluster and removing one from the old one By the time we're done, we should have all nodes needed for the new cluster

Phase 3: Remove all remaining nodes from the old cluster

Types

type Generator

type Generator func(currentCluster model.ClusterState, targetCluster model.ClusterState, stepOptions ...StepOptions) []model.Step

Generator is a function that returns the Step(s) to build from a ClusterState to a target ClusterState.

type StepOptions

type StepOptions func(*options)

StepOptions represents options for creating building steps

func WithBatchSize

func WithBatchSize(size int) StepOptions

WithBatchSize configures how to build the steps for going from a current ClusterState to a goal ClusterState. Size MUST be greater than 0, the default value is 1. If >1 then each step will change by no more than the value set.

func WithSkipFirstN

func WithSkipFirstN(n int) StepOptions

WithSkipFirstN configures how to build the steps for going from a current ClusterState to a goal ClusterState. n MUST not be negative, the default value is 0. For example if set to 2, then the cluster will never have 2 or fewer servers in a Color Group.

Jump to

Keyboard shortcuts

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