Support burst in stateful set scale up and down

The alpha field podManagementPolicy defines how pods are created,
deleted, and replaced. The new `Parallel` policy will replace pods
as fast as possible, not waiting for the pod to be `Ready` or providing
an order. This allows for advanced clustered software to take advantage
of rapid changes in scale.
This commit is contained in:
Clayton Coleman
2017-04-25 00:39:32 -04:00
parent 95ce463e95
commit 2861ae5eb9
30 changed files with 889 additions and 416 deletions

View File

@@ -36,6 +36,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/certificates"
@@ -707,6 +708,18 @@ func rbacFuncs(t apitesting.TestingCommon) []interface{} {
}
}
func appsFuncs(t apitesting.TestingCommon) []interface{} {
return []interface{}{
func(s *apps.StatefulSet, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
// match defaulter
if len(s.Spec.PodManagementPolicy) == 0 {
s.Spec.PodManagementPolicy = apps.OrderedReadyPodManagement
}
},
}
}
func policyFuncs(t apitesting.TestingCommon) []interface{} {
return []interface{}{
func(s *policy.PodDisruptionBudgetStatus, c fuzz.Continue) {
@@ -731,6 +744,7 @@ func FuzzerFuncs(t apitesting.TestingCommon, codecs runtimeserializer.CodecFacto
overrideGenericFuncs(t, codecs),
coreFuncs(t),
extensionFuncs(t),
appsFuncs(t),
batchFuncs(t),
autoscalingFuncs(t),
rbacFuncs(t),