Rolling updater enhancements
Add an UpdateAcceptor interface to the rolling updater which supports injecting code to validate the first replica during scale-up. If the replica is not accepted, the deployment fails. This facilitates canary checking so that many broken replicas aren't rolled out during an update. Make the rolling update scale amount configurable as a percent of the replica count; a negative value changes the scale direction to down/up to support in-place deployments.
This commit is contained in:
@@ -258,13 +258,14 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
|
||||
updateCleanupPolicy = kubectl.RenameRollingUpdateCleanupPolicy
|
||||
}
|
||||
config := &kubectl.RollingUpdaterConfig{
|
||||
Out: out,
|
||||
OldRc: oldRc,
|
||||
NewRc: newRc,
|
||||
UpdatePeriod: period,
|
||||
Interval: interval,
|
||||
Timeout: timeout,
|
||||
CleanupPolicy: updateCleanupPolicy,
|
||||
Out: out,
|
||||
OldRc: oldRc,
|
||||
NewRc: newRc,
|
||||
UpdatePeriod: period,
|
||||
Interval: interval,
|
||||
Timeout: timeout,
|
||||
CleanupPolicy: updateCleanupPolicy,
|
||||
UpdateAcceptor: kubectl.DefaultUpdateAcceptor,
|
||||
}
|
||||
if cmdutil.GetFlagBool(cmd, "rollback") {
|
||||
kubectl.AbortRollingUpdate(config)
|
||||
|
Reference in New Issue
Block a user