Documentation
¶
Overview ¶
Package rolloutpolicy resolves a rolling deploy's max_surge, max_unavailable and min_available into replica counts, and tracks the live progress of each rollout for the API.
Index ¶
Constants ¶
const ( EnvMaxSurge = "APP_ROLLOUT_MAX_SURGE" EnvMinAvailable = "APP_ROLLOUT_MIN_AVAILABLE" )
Env names for the platform defaults an app's rollout: block overrides.
const ( PhaseRolling = "rolling" PhaseComplete = "complete" PhaseFailed = "failed" )
Rollout phases.
Variables ¶
This section is empty.
Functions ¶
func CheckDisruption ¶
CheckDisruption refuses taking removing replicas out of available ones when that would drop below minAvailable. Zero minAvailable never blocks.
func ParseValue ¶
ParseValue validates an int or percent value without resolving it.
Types ¶
type DisruptionError ¶
type DisruptionError struct {
App string
Action string
MinAvailable int
Available int
Remaining int
}
DisruptionError is returned when a voluntary operation would breach an app's min_available budget.
func (*DisruptionError) Error ¶
func (e *DisruptionError) Error() string
type Policy ¶
type Policy struct {
MaxSurge string `json:"max_surge,omitempty"`
MinAvailable string `json:"min_available,omitempty"`
}
Policy is an app's rollout settings as written: an int ("2") or a percent of replicas ("25%"). Empty inherits the env default.
type Progress ¶
type Progress struct {
Active bool `json:"active"`
Phase string `json:"phase"`
Wave int `json:"wave"`
Waves int `json:"waves"`
Desired int `json:"desired"`
Updated int `json:"updated"`
Ready int `json:"ready"`
Surge int `json:"surge"`
MaxSurge int `json:"max_surge"`
Message string `json:"message,omitempty"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Progress is one app's rolling deploy as the reconciler last saw it.