mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-19 17:16:12 +00:00
api: Add DaemonSet MaxSurge
The MaxSurge field on DaemonSet rolling updates allows a daemonset workload to have two pods running simultaneously on a node during an update in order to perform zero-disruption handoffs of client traffic.
This commit is contained in:
@@ -19,7 +19,7 @@ package v1beta1
|
||||
import (
|
||||
"math"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -58,6 +58,11 @@ func SetDefaults_DaemonSet(obj *extensionsv1beta1.DaemonSet) {
|
||||
maxUnavailable := intstr.FromInt(1)
|
||||
updateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
|
||||
}
|
||||
if updateStrategy.RollingUpdate.MaxSurge == nil {
|
||||
// Set default MaxSurge as 0 by default.
|
||||
maxSurge := intstr.FromInt(0)
|
||||
updateStrategy.RollingUpdate.MaxSurge = &maxSurge
|
||||
}
|
||||
}
|
||||
if obj.Spec.RevisionHistoryLimit == nil {
|
||||
obj.Spec.RevisionHistoryLimit = new(int32)
|
||||
|
Reference in New Issue
Block a user