mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +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:
parent
8b8de03168
commit
5aa53f885c
@ -118,11 +118,13 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||||||
rollingUpdate := apps.RollingUpdateDaemonSet{}
|
rollingUpdate := apps.RollingUpdateDaemonSet{}
|
||||||
if c.RandBool() {
|
if c.RandBool() {
|
||||||
if c.RandBool() {
|
if c.RandBool() {
|
||||||
rollingUpdate.MaxUnavailable = intstr.FromInt(1 + int(c.Rand.Int31()))
|
rollingUpdate.MaxUnavailable = intstr.FromInt(int(c.Rand.Int31()))
|
||||||
|
rollingUpdate.MaxSurge = intstr.FromInt(int(c.Rand.Int31()))
|
||||||
} else {
|
} else {
|
||||||
rollingUpdate.MaxUnavailable = intstr.FromString(fmt.Sprintf("%d%%", 1+c.Rand.Int31()))
|
rollingUpdate.MaxSurge = intstr.FromString(fmt.Sprintf("%d%%", c.Rand.Int31()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
j.RollingUpdate = &rollingUpdate
|
j.RollingUpdate = &rollingUpdate
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -532,19 +532,41 @@ type RollingUpdateDaemonSet struct {
|
|||||||
// The maximum number of DaemonSet pods that can be unavailable during the
|
// The maximum number of DaemonSet pods that can be unavailable during the
|
||||||
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
||||||
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
||||||
// number is calculated from percentage by rounding up.
|
// number is calculated from percentage by rounding down to a minimum of one.
|
||||||
// This cannot be 0.
|
// This cannot be 0 if MaxSurge is 0
|
||||||
// Default value is 1.
|
// Default value is 1.
|
||||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
// can have their pods stopped for an update at any given
|
// can have their pods stopped for an update at any given time. The update
|
||||||
// time. The update starts by stopping at most 30% of those DaemonSet pods
|
// starts by stopping at most 30% of those DaemonSet pods and then brings
|
||||||
// and then brings up new DaemonSet pods in their place. Once the new pods
|
// up new DaemonSet pods in their place. Once the new pods are available,
|
||||||
// are available, it then proceeds onto other DaemonSet pods, thus ensuring
|
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
|
||||||
// that at least 70% of original number of DaemonSet pods are available at
|
// 70% of original number of DaemonSet pods are available at all times during
|
||||||
// all times during the update.
|
// the update.
|
||||||
// +optional
|
// +optional
|
||||||
MaxUnavailable intstr.IntOrString
|
MaxUnavailable intstr.IntOrString
|
||||||
|
|
||||||
|
// The maximum number of nodes with an existing available DaemonSet pod that
|
||||||
|
// can have an updated DaemonSet pod during during an update.
|
||||||
|
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||||
|
// This can not be 0 if MaxUnavailable is 0.
|
||||||
|
// Absolute number is calculated from percentage by rounding up to a minimum of 1.
|
||||||
|
// Default value is 0.
|
||||||
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
|
// can have their a new pod created before the old pod is marked as deleted.
|
||||||
|
// The update starts by launching new pods on 30% of nodes. Once an updated
|
||||||
|
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||||
|
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||||
|
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||||
|
// pod is immediatedly created on that node without considering surge limits.
|
||||||
|
// Allowing surge implies the possibility that the resources consumed by the
|
||||||
|
// daemonset on any given node can double if the readiness check fails, and
|
||||||
|
// so resource intensive daemonsets should take into account that they may
|
||||||
|
// cause evictions during disruption.
|
||||||
|
// This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.
|
||||||
|
// +optional
|
||||||
|
MaxSurge intstr.IntOrString
|
||||||
}
|
}
|
||||||
|
|
||||||
// DaemonSetSpec is the specification of a daemon set.
|
// DaemonSetSpec is the specification of a daemon set.
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
@ -226,13 +226,14 @@ func TestV1StatefulSetUpdateStrategyConversion(t *testing.T) {
|
|||||||
|
|
||||||
func TestV1RollingUpdateDaemonSetConversion(t *testing.T) {
|
func TestV1RollingUpdateDaemonSetConversion(t *testing.T) {
|
||||||
intorstr := intstr.FromInt(1)
|
intorstr := intstr.FromInt(1)
|
||||||
|
maxSurge := intstr.FromInt(0)
|
||||||
testcases := map[string]struct {
|
testcases := map[string]struct {
|
||||||
rollingUpdateDs1 *apps.RollingUpdateDaemonSet
|
rollingUpdateDs1 *apps.RollingUpdateDaemonSet
|
||||||
rollingUpdateDs2 *appsv1.RollingUpdateDaemonSet
|
rollingUpdateDs2 *appsv1.RollingUpdateDaemonSet
|
||||||
}{
|
}{
|
||||||
"RollingUpdateDaemonSet Conversion 2": {
|
"RollingUpdateDaemonSet Conversion 2": {
|
||||||
rollingUpdateDs1: &apps.RollingUpdateDaemonSet{MaxUnavailable: intorstr},
|
rollingUpdateDs1: &apps.RollingUpdateDaemonSet{MaxUnavailable: intorstr, MaxSurge: maxSurge},
|
||||||
rollingUpdateDs2: &appsv1.RollingUpdateDaemonSet{MaxUnavailable: &intorstr},
|
rollingUpdateDs2: &appsv1.RollingUpdateDaemonSet{MaxUnavailable: &intorstr, MaxSurge: &maxSurge},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +84,11 @@ func SetDefaults_DaemonSet(obj *appsv1.DaemonSet) {
|
|||||||
maxUnavailable := intstr.FromInt(1)
|
maxUnavailable := intstr.FromInt(1)
|
||||||
updateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
|
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 {
|
if obj.Spec.RevisionHistoryLimit == nil {
|
||||||
obj.Spec.RevisionHistoryLimit = new(int32)
|
obj.Spec.RevisionHistoryLimit = new(int32)
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -38,6 +38,7 @@ import (
|
|||||||
func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
||||||
defaultLabels := map[string]string{"foo": "bar"}
|
defaultLabels := map[string]string{"foo": "bar"}
|
||||||
maxUnavailable := intstr.FromInt(1)
|
maxUnavailable := intstr.FromInt(1)
|
||||||
|
maxSurge := intstr.FromInt(0)
|
||||||
period := int64(v1.DefaultTerminationGracePeriodSeconds)
|
period := int64(v1.DefaultTerminationGracePeriodSeconds)
|
||||||
defaultTemplate := v1.PodTemplateSpec{
|
defaultTemplate := v1.PodTemplateSpec{
|
||||||
Spec: v1.PodSpec{
|
Spec: v1.PodSpec{
|
||||||
@ -80,6 +81,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
||||||
@ -110,6 +112,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
|
||||||
@ -146,6 +149,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/api/apps/v1beta2"
|
"k8s.io/api/apps/v1beta2"
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
"k8s.io/kubernetes/pkg/apis/apps"
|
"k8s.io/kubernetes/pkg/apis/apps"
|
||||||
@ -153,13 +153,14 @@ func TestV1beta2StatefulSetUpdateStrategyConversion(t *testing.T) {
|
|||||||
|
|
||||||
func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) {
|
func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) {
|
||||||
intorstr := intstr.FromInt(1)
|
intorstr := intstr.FromInt(1)
|
||||||
|
maxSurge := intstr.FromInt(0)
|
||||||
testcases := map[string]struct {
|
testcases := map[string]struct {
|
||||||
rollingUpdateDs1 *apps.RollingUpdateDaemonSet
|
rollingUpdateDs1 *apps.RollingUpdateDaemonSet
|
||||||
rollingUpdateDs2 *v1beta2.RollingUpdateDaemonSet
|
rollingUpdateDs2 *v1beta2.RollingUpdateDaemonSet
|
||||||
}{
|
}{
|
||||||
"RollingUpdateDaemonSet Conversion 2": {
|
"RollingUpdateDaemonSet Conversion 2": {
|
||||||
rollingUpdateDs1: &apps.RollingUpdateDaemonSet{MaxUnavailable: intorstr},
|
rollingUpdateDs1: &apps.RollingUpdateDaemonSet{MaxUnavailable: intorstr, MaxSurge: maxSurge},
|
||||||
rollingUpdateDs2: &v1beta2.RollingUpdateDaemonSet{MaxUnavailable: &intorstr},
|
rollingUpdateDs2: &v1beta2.RollingUpdateDaemonSet{MaxUnavailable: &intorstr, MaxSurge: &maxSurge},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,11 @@ func SetDefaults_DaemonSet(obj *appsv1beta2.DaemonSet) {
|
|||||||
maxUnavailable := intstr.FromInt(1)
|
maxUnavailable := intstr.FromInt(1)
|
||||||
updateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
|
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 {
|
if obj.Spec.RevisionHistoryLimit == nil {
|
||||||
obj.Spec.RevisionHistoryLimit = new(int32)
|
obj.Spec.RevisionHistoryLimit = new(int32)
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
appsv1beta2 "k8s.io/api/apps/v1beta2"
|
appsv1beta2 "k8s.io/api/apps/v1beta2"
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -38,6 +38,7 @@ import (
|
|||||||
func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
||||||
defaultLabels := map[string]string{"foo": "bar"}
|
defaultLabels := map[string]string{"foo": "bar"}
|
||||||
maxUnavailable := intstr.FromInt(1)
|
maxUnavailable := intstr.FromInt(1)
|
||||||
|
maxSurge := intstr.FromInt(0)
|
||||||
period := int64(v1.DefaultTerminationGracePeriodSeconds)
|
period := int64(v1.DefaultTerminationGracePeriodSeconds)
|
||||||
defaultTemplate := v1.PodTemplateSpec{
|
defaultTemplate := v1.PodTemplateSpec{
|
||||||
Spec: v1.PodSpec{
|
Spec: v1.PodSpec{
|
||||||
@ -80,6 +81,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
||||||
@ -110,6 +112,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
|
||||||
@ -146,6 +149,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
|
|||||||
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
Type: appsv1beta2.RollingUpdateDaemonSetStrategyType,
|
||||||
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
RollingUpdate: &appsv1beta2.RollingUpdateDaemonSet{
|
||||||
MaxUnavailable: &maxUnavailable,
|
MaxUnavailable: &maxUnavailable,
|
||||||
|
MaxSurge: &maxSurge,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
|
||||||
|
@ -19,7 +19,7 @@ package v1beta1
|
|||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -58,6 +58,11 @@ func SetDefaults_DaemonSet(obj *extensionsv1beta1.DaemonSet) {
|
|||||||
maxUnavailable := intstr.FromInt(1)
|
maxUnavailable := intstr.FromInt(1)
|
||||||
updateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
|
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 {
|
if obj.Spec.RevisionHistoryLimit == nil {
|
||||||
obj.Spec.RevisionHistoryLimit = new(int32)
|
obj.Spec.RevisionHistoryLimit = new(int32)
|
||||||
|
@ -488,19 +488,41 @@ type RollingUpdateDaemonSet struct {
|
|||||||
// The maximum number of DaemonSet pods that can be unavailable during the
|
// The maximum number of DaemonSet pods that can be unavailable during the
|
||||||
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
||||||
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
||||||
// number is calculated from percentage by rounding up.
|
// number is calculated from percentage by rounding down to a minimum of one.
|
||||||
// This cannot be 0.
|
// This cannot be 0 if MaxSurge is 0
|
||||||
// Default value is 1.
|
// Default value is 1.
|
||||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
// can have their pods stopped for an update at any given
|
// can have their pods stopped for an update at any given time. The update
|
||||||
// time. The update starts by stopping at most 30% of those DaemonSet pods
|
// starts by stopping at most 30% of those DaemonSet pods and then brings
|
||||||
// and then brings up new DaemonSet pods in their place. Once the new pods
|
// up new DaemonSet pods in their place. Once the new pods are available,
|
||||||
// are available, it then proceeds onto other DaemonSet pods, thus ensuring
|
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
|
||||||
// that at least 70% of original number of DaemonSet pods are available at
|
// 70% of original number of DaemonSet pods are available at all times during
|
||||||
// all times during the update.
|
// the update.
|
||||||
// +optional
|
// +optional
|
||||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
||||||
|
|
||||||
|
// The maximum number of nodes with an existing available DaemonSet pod that
|
||||||
|
// can have an updated DaemonSet pod during during an update.
|
||||||
|
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||||
|
// This can not be 0 if MaxUnavailable is 0.
|
||||||
|
// Absolute number is calculated from percentage by rounding up to a minimum of 1.
|
||||||
|
// Default value is 0.
|
||||||
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
|
// can have their a new pod created before the old pod is marked as deleted.
|
||||||
|
// The update starts by launching new pods on 30% of nodes. Once an updated
|
||||||
|
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||||
|
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||||
|
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||||
|
// pod is immediatedly created on that node without considering surge limits.
|
||||||
|
// Allowing surge implies the possibility that the resources consumed by the
|
||||||
|
// daemonset on any given node can double if the readiness check fails, and
|
||||||
|
// so resource intensive daemonsets should take into account that they may
|
||||||
|
// cause evictions during disruption.
|
||||||
|
// This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.
|
||||||
|
// +optional
|
||||||
|
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DaemonSetSpec is the specification of a daemon set.
|
// DaemonSetSpec is the specification of a daemon set.
|
||||||
|
@ -554,19 +554,41 @@ type RollingUpdateDaemonSet struct {
|
|||||||
// The maximum number of DaemonSet pods that can be unavailable during the
|
// The maximum number of DaemonSet pods that can be unavailable during the
|
||||||
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
||||||
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
||||||
// number is calculated from percentage by rounding up.
|
// number is calculated from percentage by rounding down to a minimum of one.
|
||||||
// This cannot be 0.
|
// This cannot be 0 if MaxSurge is 0
|
||||||
// Default value is 1.
|
// Default value is 1.
|
||||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
// can have their pods stopped for an update at any given
|
// can have their pods stopped for an update at any given time. The update
|
||||||
// time. The update starts by stopping at most 30% of those DaemonSet pods
|
// starts by stopping at most 30% of those DaemonSet pods and then brings
|
||||||
// and then brings up new DaemonSet pods in their place. Once the new pods
|
// up new DaemonSet pods in their place. Once the new pods are available,
|
||||||
// are available, it then proceeds onto other DaemonSet pods, thus ensuring
|
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
|
||||||
// that at least 70% of original number of DaemonSet pods are available at
|
// 70% of original number of DaemonSet pods are available at all times during
|
||||||
// all times during the update.
|
// the update.
|
||||||
// +optional
|
// +optional
|
||||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
||||||
|
|
||||||
|
// The maximum number of nodes with an existing available DaemonSet pod that
|
||||||
|
// can have an updated DaemonSet pod during during an update.
|
||||||
|
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||||
|
// This can not be 0 if MaxUnavailable is 0.
|
||||||
|
// Absolute number is calculated from percentage by rounding up to a minimum of 1.
|
||||||
|
// Default value is 0.
|
||||||
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
|
// can have their a new pod created before the old pod is marked as deleted.
|
||||||
|
// The update starts by launching new pods on 30% of nodes. Once an updated
|
||||||
|
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||||
|
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||||
|
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||||
|
// pod is immediatedly created on that node without considering surge limits.
|
||||||
|
// Allowing surge implies the possibility that the resources consumed by the
|
||||||
|
// daemonset on any given node can double if the readiness check fails, and
|
||||||
|
// so resource intensive daemonsets should take into account that they may
|
||||||
|
// cause evictions during disruption.
|
||||||
|
// This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.
|
||||||
|
// +optional
|
||||||
|
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DaemonSetSpec is the specification of a daemon set.
|
// DaemonSetSpec is the specification of a daemon set.
|
||||||
|
@ -357,19 +357,41 @@ type RollingUpdateDaemonSet struct {
|
|||||||
// The maximum number of DaemonSet pods that can be unavailable during the
|
// The maximum number of DaemonSet pods that can be unavailable during the
|
||||||
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
// update. Value can be an absolute number (ex: 5) or a percentage of total
|
||||||
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
|
||||||
// number is calculated from percentage by rounding up.
|
// number is calculated from percentage by rounding down to a minimum of one.
|
||||||
// This cannot be 0.
|
// This cannot be 0 if MaxSurge is 0
|
||||||
// Default value is 1.
|
// Default value is 1.
|
||||||
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
// can have their pods stopped for an update at any given
|
// can have their pods stopped for an update at any given time. The update
|
||||||
// time. The update starts by stopping at most 30% of those DaemonSet pods
|
// starts by stopping at most 30% of those DaemonSet pods and then brings
|
||||||
// and then brings up new DaemonSet pods in their place. Once the new pods
|
// up new DaemonSet pods in their place. Once the new pods are available,
|
||||||
// are available, it then proceeds onto other DaemonSet pods, thus ensuring
|
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
|
||||||
// that at least 70% of original number of DaemonSet pods are available at
|
// 70% of original number of DaemonSet pods are available at all times during
|
||||||
// all times during the update.
|
// the update.
|
||||||
// +optional
|
// +optional
|
||||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
|
||||||
|
|
||||||
|
// The maximum number of nodes with an existing available DaemonSet pod that
|
||||||
|
// can have an updated DaemonSet pod during during an update.
|
||||||
|
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||||
|
// This can not be 0 if MaxUnavailable is 0.
|
||||||
|
// Absolute number is calculated from percentage by rounding up to a minimum of 1.
|
||||||
|
// Default value is 0.
|
||||||
|
// Example: when this is set to 30%, at most 30% of the total number of nodes
|
||||||
|
// that should be running the daemon pod (i.e. status.desiredNumberScheduled)
|
||||||
|
// can have their a new pod created before the old pod is marked as deleted.
|
||||||
|
// The update starts by launching new pods on 30% of nodes. Once an updated
|
||||||
|
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||||
|
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||||
|
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||||
|
// pod is immediatedly created on that node without considering surge limits.
|
||||||
|
// Allowing surge implies the possibility that the resources consumed by the
|
||||||
|
// daemonset on any given node can double if the readiness check fails, and
|
||||||
|
// so resource intensive daemonsets should take into account that they may
|
||||||
|
// cause evictions during disruption.
|
||||||
|
// This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.
|
||||||
|
// +optional
|
||||||
|
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DaemonSetSpec is the specification of a daemon set.
|
// DaemonSetSpec is the specification of a daemon set.
|
||||||
|
Loading…
Reference in New Issue
Block a user