Port upstream rolling updater enhancements
Port the upstream rolling updater enhancements to origin, and
deprecate the updatePercent rolling parameter.
@@ -2,6 +2,7 @@ package v1
import (
kapi "k8s.io/kubernetes/pkg/api/v1"
+ kutil "k8s.io/kubernetes/pkg/util"
)
// DeploymentPhase describes the possible states a deployment can be in.
@@ -115,9 +116,36 @@ type RollingDeploymentStrategyParams struct {
// TimeoutSeconds is the time to wait for updates before giving up. If the
// value is nil, a default will be used.
TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" description:"the time to wait for updates before giving up"`
+ // MaxUnavailable is the maximum number of pods that can be unavailable
+ // during the update. Value can be an absolute number (ex: 5) or a
+ // percentage of total pods at the start of update (ex: 10%). Absolute
+ // number is calculated from percentage by rounding up.
+ //
+ // This cannot be 0 if MaxSurge is 0. By default, 25% is used.
+ //
+ // Example: when this is set to 30%, the old RC can be scaled down by 30%
+ // immediately when the rolling update starts. Once new pods are ready, old
+ // RC can be scaled down further, followed by scaling up the new RC,
+ // ensuring that at least 70% of original number of pods are available at
+ // all times during the update.
+ MaxUnavailable *kutil.IntOrString `json:"maxUnavailable,omitempty" description:"max number of pods that can be unavailable during the update; value can be an absolute number or a percentage of total pods at start of update"`
+ // MaxSurge is the maximum number of pods that can be scheduled above the
+ // original number of pods. Value can be an absolute number (ex: 5) or a
+ // percentage of total pods at the start of the update (ex: 10%). Absolute
+ // number is calculated from percentage by rounding up.
+ //
+ // This cannot be 0 if MaxUnavailable is 0. By default, 25% is used.
+ //
+ // Example: when this is set to 30%, the new RC can be scaled up by 30%
+ // immediately when the rolling update starts. Once old pods have been
+ // killed, new RC can be scaled up further, ensuring that total number of
+ // pods running at any time during the update is atmost 130% of original
+ // pods.
+ MaxSurge *kutil.IntOrString `json:"maxSurge,omitempty" description:"max number of pods that can be scheduled above the original number of pods; value can be an absolute number or a percentage of total pods at start of update"`
// UpdatePercent is the percentage of replicas to scale up or down each
// interval. If nil, one replica will be scaled up and down each interval.
// If negative, the scale order will be down/up instead of up/down.
+ // DEPRECATED: Use MaxUnavailable/MaxSurge instead.
UpdatePercent *int `json:"updatePercent,omitempty" description:"the percentage of replicas to scale up or down each interval (negative value switches scale order to down/up instead of up/down)"`
// Pre is a lifecycle hook which is executed before the deployment process
// begins. All LifecycleHookFailurePolicy values are supported.
