Merge pull request #116119 from vinaykul/restart-free-pod-vertical-scaling-fixes

Restructure resize policy naming and set default resize policy values
This commit is contained in:
Kubernetes Prow Robot 2023-03-14 19:26:42 -07:00 committed by GitHub
commit 9053b5dc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
78 changed files with 1253 additions and 1228 deletions

View File

@ -5007,20 +5007,20 @@
"type": "object" "type": "object"
}, },
"io.k8s.api.core.v1.ContainerResizePolicy": { "io.k8s.api.core.v1.ContainerResizePolicy": {
"description": "ContainerResizePolicy represents resource resize policy for a single container.", "description": "ContainerResizePolicy represents resource resize policy for the container.",
"properties": { "properties": {
"policy": { "resourceName": {
"description": "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.", "description": "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
"type": "string" "type": "string"
}, },
"resourceName": { "restartPolicy": {
"description": "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", "description": "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
"type": "string" "type": "string"
} }
}, },
"required": [ "required": [
"resourceName", "resourceName",
"policy" "restartPolicy"
], ],
"type": "object" "type": "object"
}, },

View File

@ -1306,22 +1306,22 @@
"type": "object" "type": "object"
}, },
"io.k8s.api.core.v1.ContainerResizePolicy": { "io.k8s.api.core.v1.ContainerResizePolicy": {
"description": "ContainerResizePolicy represents resource resize policy for a single container.", "description": "ContainerResizePolicy represents resource resize policy for the container.",
"properties": { "properties": {
"policy": {
"default": "",
"description": "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.",
"type": "string"
},
"resourceName": { "resourceName": {
"default": "", "default": "",
"description": "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", "description": "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
"type": "string"
},
"restartPolicy": {
"default": "",
"description": "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
"type": "string" "type": "string"
} }
}, },
"required": [ "required": [
"resourceName", "resourceName",
"policy" "restartPolicy"
], ],
"type": "object" "type": "object"
}, },

View File

@ -1910,22 +1910,22 @@
"type": "object" "type": "object"
}, },
"io.k8s.api.core.v1.ContainerResizePolicy": { "io.k8s.api.core.v1.ContainerResizePolicy": {
"description": "ContainerResizePolicy represents resource resize policy for a single container.", "description": "ContainerResizePolicy represents resource resize policy for the container.",
"properties": { "properties": {
"policy": {
"default": "",
"description": "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.",
"type": "string"
},
"resourceName": { "resourceName": {
"default": "", "default": "",
"description": "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", "description": "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
"type": "string"
},
"restartPolicy": {
"default": "",
"description": "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
"type": "string" "type": "string"
} }
}, },
"required": [ "required": [
"resourceName", "resourceName",
"policy" "restartPolicy"
], ],
"type": "object" "type": "object"
}, },

View File

@ -1201,22 +1201,22 @@
"type": "object" "type": "object"
}, },
"io.k8s.api.core.v1.ContainerResizePolicy": { "io.k8s.api.core.v1.ContainerResizePolicy": {
"description": "ContainerResizePolicy represents resource resize policy for a single container.", "description": "ContainerResizePolicy represents resource resize policy for the container.",
"properties": { "properties": {
"policy": {
"default": "",
"description": "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.",
"type": "string"
},
"resourceName": { "resourceName": {
"default": "", "default": "",
"description": "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", "description": "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
"type": "string"
},
"restartPolicy": {
"default": "",
"description": "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
"type": "string" "type": "string"
} }
}, },
"required": [ "required": [
"resourceName", "resourceName",
"policy" "restartPolicy"
], ],
"type": "object" "type": "object"
}, },

View File

@ -2290,8 +2290,8 @@ func TestDropInPlacePodVerticalScaling(t *testing.T) {
Limits: api.ResourceList{api.ResourceCPU: resource.MustParse("200m")}, Limits: api.ResourceList{api.ResourceCPU: resource.MustParse("200m")},
}, },
ResizePolicy: []api.ContainerResizePolicy{ ResizePolicy: []api.ContainerResizePolicy{
{ResourceName: api.ResourceCPU, Policy: api.RestartNotRequired}, {ResourceName: api.ResourceCPU, RestartPolicy: api.NotRequired},
{ResourceName: api.ResourceMemory, Policy: api.RestartRequired}, {ResourceName: api.ResourceMemory, RestartPolicy: api.RestartContainer},
}, },
}, },
}, },

View File

@ -2139,31 +2139,31 @@ const (
PullIfNotPresent PullPolicy = "IfNotPresent" PullIfNotPresent PullPolicy = "IfNotPresent"
) )
// ResourceResizePolicy specifies how Kubernetes should handle resource resize. // ResourceResizeRestartPolicy specifies how to handle container resource resize.
type ResourceResizePolicy string type ResourceResizeRestartPolicy string
// These are the valid resource resize policy values: // These are the valid resource resize restart policy values:
const ( const (
// RestartNotRequired tells Kubernetes to resize the container in-place // 'NotRequired' means Kubernetes will try to resize the container
// without restarting it, if possible. Kubernetes may however choose to // without restarting it, if possible. Kubernetes may however choose to
// restart the container if it is unable to actuate resize without a // restart the container if it is unable to actuate resize without a
// restart. For e.g. the runtime doesn't support restart-free resizing. // restart. For e.g. the runtime doesn't support restart-free resizing.
RestartNotRequired ResourceResizePolicy = "RestartNotRequired" NotRequired ResourceResizeRestartPolicy = "NotRequired"
// 'RestartRequired' tells Kubernetes to resize the container in-place // 'RestartContainer' means Kubernetes will resize the container in-place
// by stopping and starting the container when new resources are applied. // by stopping and starting the container when new resources are applied.
// This is needed for legacy applications. For e.g. java apps using the // This is needed for legacy applications. For e.g. java apps using the
// -xmxN flag which are unable to use resized memory without restarting. // -xmxN flag which are unable to use resized memory without restarting.
RestartRequired ResourceResizePolicy = "RestartRequired" RestartContainer ResourceResizeRestartPolicy = "RestartContainer"
) )
// ContainerResizePolicy represents resource resize policy for a single container. // ContainerResizePolicy represents resource resize policy for the container.
type ContainerResizePolicy struct { type ContainerResizePolicy struct {
// Name of the resource type to which this resource resize policy applies. // Name of the resource to which this resource resize policy applies.
// Supported values: cpu, memory. // Supported values: cpu, memory.
ResourceName ResourceName ResourceName ResourceName
// Resource resize policy applicable to the specified resource name. // Restart policy to apply when specified resource is resized.
// If not specified, it defaults to RestartNotRequired. // If not specified, it defaults to NotRequired.
Policy ResourceResizePolicy RestartPolicy ResourceResizeRestartPolicy
} }
// PreemptionPolicy describes a policy for if/when to preempt a pod. // PreemptionPolicy describes a policy for if/when to preempt a pod.

View File

@ -22,6 +22,8 @@ import (
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/util/parsers" "k8s.io/kubernetes/pkg/util/parsers"
"k8s.io/utils/pointer" "k8s.io/utils/pointer"
) )
@ -157,6 +159,29 @@ func SetDefaults_Pod(obj *v1.Pod) {
} }
} }
} }
if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) &&
obj.Spec.Containers[i].Resources.Requests != nil {
// For normal containers, set resize restart policy to default value (NotRequired), if not specified.
resizePolicySpecified := make(map[v1.ResourceName]bool)
for _, p := range obj.Spec.Containers[i].ResizePolicy {
resizePolicySpecified[p.ResourceName] = true
}
setDefaultResizePolicy := func(resourceName v1.ResourceName) {
if _, found := resizePolicySpecified[resourceName]; !found {
obj.Spec.Containers[i].ResizePolicy = append(obj.Spec.Containers[i].ResizePolicy,
v1.ContainerResizePolicy{
ResourceName: resourceName,
RestartPolicy: v1.NotRequired,
})
}
}
if _, exists := obj.Spec.Containers[i].Resources.Requests[v1.ResourceCPU]; exists {
setDefaultResizePolicy(v1.ResourceCPU)
}
if _, exists := obj.Spec.Containers[i].Resources.Requests[v1.ResourceMemory]; exists {
setDefaultResizePolicy(v1.ResourceMemory)
}
}
} }
for i := range obj.Spec.InitContainers { for i := range obj.Spec.InitContainers {
if obj.Spec.InitContainers[i].Resources.Limits != nil { if obj.Spec.InitContainers[i].Resources.Limits != nil {

View File

@ -3093,7 +3093,7 @@ func Convert_core_ContainerPort_To_v1_ContainerPort(in *core.ContainerPort, out
func autoConvert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in *v1.ContainerResizePolicy, out *core.ContainerResizePolicy, s conversion.Scope) error { func autoConvert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in *v1.ContainerResizePolicy, out *core.ContainerResizePolicy, s conversion.Scope) error {
out.ResourceName = core.ResourceName(in.ResourceName) out.ResourceName = core.ResourceName(in.ResourceName)
out.Policy = core.ResourceResizePolicy(in.Policy) out.RestartPolicy = core.ResourceResizeRestartPolicy(in.RestartPolicy)
return nil return nil
} }
@ -3104,7 +3104,7 @@ func Convert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in *v1.Conta
func autoConvert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(in *core.ContainerResizePolicy, out *v1.ContainerResizePolicy, s conversion.Scope) error { func autoConvert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(in *core.ContainerResizePolicy, out *v1.ContainerResizePolicy, s conversion.Scope) error {
out.ResourceName = v1.ResourceName(in.ResourceName) out.ResourceName = v1.ResourceName(in.ResourceName)
out.Policy = v1.ResourceResizePolicy(in.Policy) out.RestartPolicy = v1.ResourceResizeRestartPolicy(in.RestartPolicy)
return nil return nil
} }

View File

@ -3042,7 +3042,7 @@ func validatePullPolicy(policy core.PullPolicy, fldPath *field.Path) field.Error
} }
var supportedResizeResources = sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory)) var supportedResizeResources = sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory))
var supportedResizePolicies = sets.NewString(string(core.RestartNotRequired), string(core.RestartRequired)) var supportedResizePolicies = sets.NewString(string(core.NotRequired), string(core.RestartContainer))
func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *field.Path) field.ErrorList { func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *field.Path) field.ErrorList {
allErrors := field.ErrorList{} allErrors := field.ErrorList{}
@ -3061,12 +3061,12 @@ func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *fiel
default: default:
allErrors = append(allErrors, field.NotSupported(fldPath, p.ResourceName, supportedResizeResources.List())) allErrors = append(allErrors, field.NotSupported(fldPath, p.ResourceName, supportedResizeResources.List()))
} }
switch p.Policy { switch p.RestartPolicy {
case core.RestartNotRequired, core.RestartRequired: case core.NotRequired, core.RestartContainer:
case "": case "":
allErrors = append(allErrors, field.Required(fldPath, "")) allErrors = append(allErrors, field.Required(fldPath, ""))
default: default:
allErrors = append(allErrors, field.NotSupported(fldPath, p.Policy, supportedResizePolicies.List())) allErrors = append(allErrors, field.NotSupported(fldPath, p.RestartPolicy, supportedResizePolicies.List()))
} }
} }
return allErrors return allErrors

View File

@ -7009,7 +7009,7 @@ func TestValidatePullPolicy(t *testing.T) {
func TestValidateResizePolicy(t *testing.T) { func TestValidateResizePolicy(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.InPlacePodVerticalScaling, true)() defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.InPlacePodVerticalScaling, true)()
tSupportedResizeResources := sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory)) tSupportedResizeResources := sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory))
tSupportedResizePolicies := sets.NewString(string(core.RestartNotRequired), string(core.RestartRequired)) tSupportedResizePolicies := sets.NewString(string(core.NotRequired), string(core.RestartContainer))
type T struct { type T struct {
PolicyList []core.ContainerResizePolicy PolicyList []core.ContainerResizePolicy
ExpectError bool ExpectError bool
@ -7018,22 +7018,22 @@ func TestValidateResizePolicy(t *testing.T) {
testCases := map[string]T{ testCases := map[string]T{
"ValidCPUandMemoryPolicies": { "ValidCPUandMemoryPolicies": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
{ResourceName: "memory", Policy: "RestartRequired"}, {ResourceName: "memory", RestartPolicy: "RestartContainer"},
}, },
false, false,
nil, nil,
}, },
"ValidCPUPolicy": { "ValidCPUPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartRequired"}, {ResourceName: "cpu", RestartPolicy: "RestartContainer"},
}, },
false, false,
nil, nil,
}, },
"ValidMemoryPolicy": { "ValidMemoryPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "memory", Policy: "RestartNotRequired"}, {ResourceName: "memory", RestartPolicy: "NotRequired"},
}, },
false, false,
nil, nil,
@ -7045,39 +7045,39 @@ func TestValidateResizePolicy(t *testing.T) {
}, },
"ValidCPUandInvalidMemoryPolicy": { "ValidCPUandInvalidMemoryPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
{ResourceName: "memory", Policy: "Restarrrt"}, {ResourceName: "memory", RestartPolicy: "Restarrrt"},
}, },
true, true,
field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceResizePolicy("Restarrrt"), tSupportedResizePolicies.List())}, field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceResizeRestartPolicy("Restarrrt"), tSupportedResizePolicies.List())},
}, },
"ValidMemoryandInvalidCPUPolicy": { "ValidMemoryandInvalidCPUPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequirrred"}, {ResourceName: "cpu", RestartPolicy: "RestartNotRequirrred"},
{ResourceName: "memory", Policy: "RestartRequired"}, {ResourceName: "memory", RestartPolicy: "RestartContainer"},
}, },
true, true,
field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceResizePolicy("RestartNotRequirrred"), tSupportedResizePolicies.List())}, field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceResizeRestartPolicy("RestartNotRequirrred"), tSupportedResizePolicies.List())},
}, },
"InvalidResourceNameValidPolicy": { "InvalidResourceNameValidPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpuuu", Policy: "RestartNotRequired"}, {ResourceName: "cpuuu", RestartPolicy: "NotRequired"},
}, },
true, true,
field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceName("cpuuu"), tSupportedResizeResources.List())}, field.ErrorList{field.NotSupported(field.NewPath("field"), core.ResourceName("cpuuu"), tSupportedResizeResources.List())},
}, },
"ValidResourceNameMissingPolicy": { "ValidResourceNameMissingPolicy": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "memory", Policy: ""}, {ResourceName: "memory", RestartPolicy: ""},
}, },
true, true,
field.ErrorList{field.Required(field.NewPath("field"), "")}, field.ErrorList{field.Required(field.NewPath("field"), "")},
}, },
"RepeatedPolicies": { "RepeatedPolicies": {
[]core.ContainerResizePolicy{ []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
{ResourceName: "memory", Policy: "RestartRequired"}, {ResourceName: "memory", RestartPolicy: "RestartContainer"},
{ResourceName: "cpu", Policy: "RestartRequired"}, {ResourceName: "cpu", RestartPolicy: "RestartContainer"},
}, },
true, true,
field.ErrorList{field.Duplicate(field.NewPath("field").Index(2), core.ResourceCPU)}, field.ErrorList{field.Duplicate(field.NewPath("field").Index(2), core.ResourceCPU)},
@ -7475,7 +7475,7 @@ func TestValidateEphemeralContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent", ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File", TerminationMessagePolicy: "File",
ResizePolicy: []core.ContainerResizePolicy{ ResizePolicy: []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
}, },
}, },
}, },
@ -7702,8 +7702,8 @@ func TestValidateContainers(t *testing.T) {
Name: "resources-resize-policy", Name: "resources-resize-policy",
Image: "image", Image: "image",
ResizePolicy: []core.ContainerResizePolicy{ ResizePolicy: []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
{ResourceName: "memory", Policy: "RestartRequired"}, {ResourceName: "memory", RestartPolicy: "RestartContainer"},
}, },
ImagePullPolicy: "IfNotPresent", ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File", TerminationMessagePolicy: "File",
@ -9477,7 +9477,7 @@ func TestValidatePodSpec(t *testing.T) {
Name: "initctr", Name: "initctr",
Image: "initimage", Image: "initimage",
ResizePolicy: []core.ContainerResizePolicy{ ResizePolicy: []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
}, },
ImagePullPolicy: "IfNotPresent", ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File", TerminationMessagePolicy: "File",
@ -9488,7 +9488,7 @@ func TestValidatePodSpec(t *testing.T) {
Name: "ctr", Name: "ctr",
Image: "image", Image: "image",
ResizePolicy: []core.ContainerResizePolicy{ ResizePolicy: []core.ContainerResizePolicy{
{ResourceName: "cpu", Policy: "RestartNotRequired"}, {ResourceName: "cpu", RestartPolicy: "NotRequired"},
}, },
ImagePullPolicy: "IfNotPresent", ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File", TerminationMessagePolicy: "File",
@ -20473,7 +20473,7 @@ func TestValidateOSFields(t *testing.T) {
"Containers[*].Ports", "Containers[*].Ports",
"Containers[*].ReadinessProbe", "Containers[*].ReadinessProbe",
"Containers[*].Resources", "Containers[*].Resources",
"Containers[*].ResizePolicy[*].Policy", "Containers[*].ResizePolicy[*].RestartPolicy",
"Containers[*].ResizePolicy[*].ResourceName", "Containers[*].ResizePolicy[*].ResourceName",
"Containers[*].SecurityContext.RunAsNonRoot", "Containers[*].SecurityContext.RunAsNonRoot",
"Containers[*].Stdin", "Containers[*].Stdin",
@ -20499,7 +20499,7 @@ func TestValidateOSFields(t *testing.T) {
"EphemeralContainers[*].EphemeralContainerCommon.Ports", "EphemeralContainers[*].EphemeralContainerCommon.Ports",
"EphemeralContainers[*].EphemeralContainerCommon.ReadinessProbe", "EphemeralContainers[*].EphemeralContainerCommon.ReadinessProbe",
"EphemeralContainers[*].EphemeralContainerCommon.Resources", "EphemeralContainers[*].EphemeralContainerCommon.Resources",
"EphemeralContainers[*].EphemeralContainerCommon.ResizePolicy[*].Policy", "EphemeralContainers[*].EphemeralContainerCommon.ResizePolicy[*].RestartPolicy",
"EphemeralContainers[*].EphemeralContainerCommon.ResizePolicy[*].ResourceName", "EphemeralContainers[*].EphemeralContainerCommon.ResizePolicy[*].ResourceName",
"EphemeralContainers[*].EphemeralContainerCommon.Stdin", "EphemeralContainers[*].EphemeralContainerCommon.Stdin",
"EphemeralContainers[*].EphemeralContainerCommon.StdinOnce", "EphemeralContainers[*].EphemeralContainerCommon.StdinOnce",
@ -20527,7 +20527,7 @@ func TestValidateOSFields(t *testing.T) {
"InitContainers[*].Ports", "InitContainers[*].Ports",
"InitContainers[*].ReadinessProbe", "InitContainers[*].ReadinessProbe",
"InitContainers[*].Resources", "InitContainers[*].Resources",
"InitContainers[*].ResizePolicy[*].Policy", "InitContainers[*].ResizePolicy[*].RestartPolicy",
"InitContainers[*].ResizePolicy[*].ResourceName", "InitContainers[*].ResizePolicy[*].ResourceName",
"InitContainers[*].Stdin", "InitContainers[*].Stdin",
"InitContainers[*].StdinOnce", "InitContainers[*].StdinOnce",

View File

@ -17535,27 +17535,27 @@ func schema_k8sio_api_core_v1_ContainerResizePolicy(ref common.ReferenceCallback
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "ContainerResizePolicy represents resource resize policy for a single container.", Description: "ContainerResizePolicy represents resource resize policy for the container.",
Type: []string{"object"}, Type: []string{"object"},
Properties: map[string]spec.Schema{ Properties: map[string]spec.Schema{
"resourceName": { "resourceName": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", Description: "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
Default: "", Default: "",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },
}, },
"policy": { "restartPolicy": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.", Description: "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
Default: "", Default: "",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },
}, },
}, },
Required: []string{"resourceName", "policy"}, Required: []string{"resourceName", "restartPolicy"},
}, },
}, },
} }

View File

@ -915,10 +915,10 @@ func TestHashContainerWithoutResources(t *testing.T) {
cpu200m := resource.MustParse("200m") cpu200m := resource.MustParse("200m")
mem100M := resource.MustParse("100Mi") mem100M := resource.MustParse("100Mi")
mem200M := resource.MustParse("200Mi") mem200M := resource.MustParse("200Mi")
cpuPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, Policy: v1.RestartNotRequired} cpuPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, RestartPolicy: v1.NotRequired}
memPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, Policy: v1.RestartNotRequired} memPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, RestartPolicy: v1.NotRequired}
cpuPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, Policy: v1.RestartRequired} cpuPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, RestartPolicy: v1.RestartContainer}
memPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, Policy: v1.RestartRequired} memPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, RestartPolicy: v1.RestartContainer}
type testCase struct { type testCase struct {
name string name string
@ -938,7 +938,7 @@ func TestHashContainerWithoutResources(t *testing.T) {
}, },
ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartRequired, memPolicyRestartNotRequired}, ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartRequired, memPolicyRestartNotRequired},
}, },
0x86a4393c, 0x5f62cb4c,
}, },
{ {
"Burstable pod with memory policy restart required", "Burstable pod with memory policy restart required",
@ -951,7 +951,7 @@ func TestHashContainerWithoutResources(t *testing.T) {
}, },
ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartNotRequired, memPolicyRestartRequired}, ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartNotRequired, memPolicyRestartRequired},
}, },
0x73a18cce, 0xcdab9e00,
}, },
{ {
"Guaranteed pod with CPU policy restart required", "Guaranteed pod with CPU policy restart required",
@ -964,7 +964,7 @@ func TestHashContainerWithoutResources(t *testing.T) {
}, },
ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartRequired, memPolicyRestartNotRequired}, ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartRequired, memPolicyRestartNotRequired},
}, },
0x86a4393c, 0x5f62cb4c,
}, },
{ {
"Guaranteed pod with memory policy restart required", "Guaranteed pod with memory policy restart required",
@ -977,7 +977,7 @@ func TestHashContainerWithoutResources(t *testing.T) {
}, },
ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartNotRequired, memPolicyRestartRequired}, ResizePolicy: []v1.ContainerResizePolicy{cpuPolicyRestartNotRequired, memPolicyRestartRequired},
}, },
0x73a18cce, 0xcdab9e00,
}, },
} }
for _, tc := range tests { for _, tc := range tests {

View File

@ -585,15 +585,15 @@ func (m *kubeGenericRuntimeManager) computePodResizeAction(pod *v1.Pod, containe
cpuRequest: currentCPURequest, cpuRequest: currentCPURequest,
} }
resizePolicy := make(map[v1.ResourceName]v1.ResourceResizePolicy) resizePolicy := make(map[v1.ResourceName]v1.ResourceResizeRestartPolicy)
for _, pol := range container.ResizePolicy { for _, pol := range container.ResizePolicy {
resizePolicy[pol.ResourceName] = pol.Policy resizePolicy[pol.ResourceName] = pol.RestartPolicy
} }
determineContainerResize := func(rName v1.ResourceName, specValue, statusValue int64) (resize, restart bool) { determineContainerResize := func(rName v1.ResourceName, specValue, statusValue int64) (resize, restart bool) {
if specValue == statusValue { if specValue == statusValue {
return false, false return false, false
} }
if resizePolicy[rName] == v1.RestartRequired { if resizePolicy[rName] == v1.RestartContainer {
return true, true return true, true
} }
return true, false return true, false

View File

@ -1655,10 +1655,10 @@ func TestComputePodActionsForPodResize(t *testing.T) {
cpu200m := resource.MustParse("200m") cpu200m := resource.MustParse("200m")
mem100M := resource.MustParse("100Mi") mem100M := resource.MustParse("100Mi")
mem200M := resource.MustParse("200Mi") mem200M := resource.MustParse("200Mi")
cpuPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, Policy: v1.RestartNotRequired} cpuPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, RestartPolicy: v1.NotRequired}
memPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, Policy: v1.RestartNotRequired} memPolicyRestartNotRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, RestartPolicy: v1.NotRequired}
cpuPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, Policy: v1.RestartRequired} cpuPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, RestartPolicy: v1.RestartContainer}
memPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, Policy: v1.RestartRequired} memPolicyRestartRequired := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, RestartPolicy: v1.RestartContainer}
for desc, test := range map[string]struct { for desc, test := range map[string]struct {
podResizePolicyFn func(*v1.Pod) podResizePolicyFn func(*v1.Pod)

File diff suppressed because it is too large Load Diff

View File

@ -869,15 +869,15 @@ message ContainerPort {
optional string hostIP = 5; optional string hostIP = 5;
} }
// ContainerResizePolicy represents resource resize policy for a single container. // ContainerResizePolicy represents resource resize policy for the container.
message ContainerResizePolicy { message ContainerResizePolicy {
// Name of the resource type to which this resource resize policy applies. // Name of the resource to which this resource resize policy applies.
// Supported values: cpu, memory. // Supported values: cpu, memory.
optional string resourceName = 1; optional string resourceName = 1;
// Resource resize policy applicable to the specified resource name. // Restart policy to apply when specified resource is resized.
// If not specified, it defaults to RestartNotRequired. // If not specified, it defaults to NotRequired.
optional string policy = 2; optional string restartPolicy = 2;
} }
// ContainerState holds a possible state of container. // ContainerState holds a possible state of container.

View File

@ -2264,31 +2264,31 @@ const (
PullIfNotPresent PullPolicy = "IfNotPresent" PullIfNotPresent PullPolicy = "IfNotPresent"
) )
// ResourceResizePolicy specifies how Kubernetes should handle resource resize. // ResourceResizeRestartPolicy specifies how to handle container resource resize.
type ResourceResizePolicy string type ResourceResizeRestartPolicy string
// These are the valid resource resize policy values: // These are the valid resource resize restart policy values:
const ( const (
// RestartNotRequired tells Kubernetes to resize the container in-place // 'NotRequired' means Kubernetes will try to resize the container
// without restarting it, if possible. Kubernetes may however choose to // without restarting it, if possible. Kubernetes may however choose to
// restart the container if it is unable to actuate resize without a // restart the container if it is unable to actuate resize without a
// restart. For e.g. the runtime doesn't support restart-free resizing. // restart. For e.g. the runtime doesn't support restart-free resizing.
RestartNotRequired ResourceResizePolicy = "RestartNotRequired" NotRequired ResourceResizeRestartPolicy = "NotRequired"
// 'RestartRequired' tells Kubernetes to resize the container in-place // 'RestartContainer' means Kubernetes will resize the container in-place
// by stopping and starting the container when new resources are applied. // by stopping and starting the container when new resources are applied.
// This is needed for legacy applications. For e.g. java apps using the // This is needed for legacy applications. For e.g. java apps using the
// -xmxN flag which are unable to use resized memory without restarting. // -xmxN flag which are unable to use resized memory without restarting.
RestartRequired ResourceResizePolicy = "RestartRequired" RestartContainer ResourceResizeRestartPolicy = "RestartContainer"
) )
// ContainerResizePolicy represents resource resize policy for a single container. // ContainerResizePolicy represents resource resize policy for the container.
type ContainerResizePolicy struct { type ContainerResizePolicy struct {
// Name of the resource type to which this resource resize policy applies. // Name of the resource to which this resource resize policy applies.
// Supported values: cpu, memory. // Supported values: cpu, memory.
ResourceName ResourceName `json:"resourceName" protobuf:"bytes,1,opt,name=resourceName,casttype=ResourceName"` ResourceName ResourceName `json:"resourceName" protobuf:"bytes,1,opt,name=resourceName,casttype=ResourceName"`
// Resource resize policy applicable to the specified resource name. // Restart policy to apply when specified resource is resized.
// If not specified, it defaults to RestartNotRequired. // If not specified, it defaults to NotRequired.
Policy ResourceResizePolicy `json:"policy" protobuf:"bytes,2,opt,name=policy,casttype=ResourceResizePolicy"` RestartPolicy ResourceResizeRestartPolicy `json:"restartPolicy" protobuf:"bytes,2,opt,name=restartPolicy,casttype=ResourceResizeRestartPolicy"`
} }
// PreemptionPolicy describes a policy for if/when to preempt a pod. // PreemptionPolicy describes a policy for if/when to preempt a pod.

View File

@ -390,9 +390,9 @@ func (ContainerPort) SwaggerDoc() map[string]string {
} }
var map_ContainerResizePolicy = map[string]string{ var map_ContainerResizePolicy = map[string]string{
"": "ContainerResizePolicy represents resource resize policy for a single container.", "": "ContainerResizePolicy represents resource resize policy for the container.",
"resourceName": "Name of the resource type to which this resource resize policy applies. Supported values: cpu, memory.", "resourceName": "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.",
"policy": "Resource resize policy applicable to the specified resource name. If not specified, it defaults to RestartNotRequired.", "restartPolicy": "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.",
} }
func (ContainerResizePolicy) SwaggerDoc() map[string]string { func (ContainerResizePolicy) SwaggerDoc() map[string]string {

View File

@ -554,7 +554,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -837,7 +837,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1120,7 +1120,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -321,8 +321,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -527,8 +527,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -735,8 +735,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -556,7 +556,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -839,7 +839,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1122,7 +1122,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -321,8 +321,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -527,8 +527,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -735,8 +735,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -323,8 +323,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -529,8 +529,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -737,8 +737,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -321,8 +321,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -527,8 +527,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -735,8 +735,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -554,7 +554,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -837,7 +837,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1120,7 +1120,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -321,8 +321,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -527,8 +527,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -735,8 +735,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -556,7 +556,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -839,7 +839,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1122,7 +1122,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -321,8 +321,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -527,8 +527,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -735,8 +735,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -628,7 +628,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -911,7 +911,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1194,7 +1194,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -365,8 +365,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -571,8 +571,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -779,8 +779,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -579,7 +579,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -862,7 +862,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1145,7 +1145,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -329,8 +329,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -535,8 +535,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -743,8 +743,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -628,7 +628,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -911,7 +911,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1194,7 +1194,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -365,8 +365,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -571,8 +571,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -779,8 +779,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -496,7 +496,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -779,7 +779,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1062,7 +1062,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -269,8 +269,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -475,8 +475,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -683,8 +683,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -539,7 +539,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -822,7 +822,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1105,7 +1105,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -302,8 +302,8 @@ template:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -508,8 +508,8 @@ template:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -716,8 +716,8 @@ template:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -545,7 +545,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -828,7 +828,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1111,7 +1111,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -307,8 +307,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -513,8 +513,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -721,8 +721,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -554,7 +554,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -837,7 +837,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1120,7 +1120,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -555,7 +555,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -838,7 +838,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1121,7 +1121,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -323,8 +323,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -529,8 +529,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -737,8 +737,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -556,7 +556,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -839,7 +839,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [
@ -1122,7 +1122,7 @@
"resizePolicy": [ "resizePolicy": [
{ {
"resourceName": "resourceNameValue", "resourceName": "resourceNameValue",
"policy": "policyValue" "restartPolicy": "restartPolicyValue"
} }
], ],
"volumeMounts": [ "volumeMounts": [

View File

@ -313,8 +313,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -519,8 +519,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue
@ -727,8 +727,8 @@ spec:
terminationGracePeriodSeconds: 7 terminationGracePeriodSeconds: 7
timeoutSeconds: 3 timeoutSeconds: 3
resizePolicy: resizePolicy:
- policy: policyValue - resourceName: resourceNameValue
resourceName: resourceNameValue restartPolicy: restartPolicyValue
resources: resources:
claims: claims:
- name: nameValue - name: nameValue

View File

@ -25,8 +25,8 @@ import (
// ContainerResizePolicyApplyConfiguration represents an declarative configuration of the ContainerResizePolicy type for use // ContainerResizePolicyApplyConfiguration represents an declarative configuration of the ContainerResizePolicy type for use
// with apply. // with apply.
type ContainerResizePolicyApplyConfiguration struct { type ContainerResizePolicyApplyConfiguration struct {
ResourceName *v1.ResourceName `json:"resourceName,omitempty"` ResourceName *v1.ResourceName `json:"resourceName,omitempty"`
Policy *v1.ResourceResizePolicy `json:"policy,omitempty"` RestartPolicy *v1.ResourceResizeRestartPolicy `json:"restartPolicy,omitempty"`
} }
// ContainerResizePolicyApplyConfiguration constructs an declarative configuration of the ContainerResizePolicy type for use with // ContainerResizePolicyApplyConfiguration constructs an declarative configuration of the ContainerResizePolicy type for use with
@ -43,10 +43,10 @@ func (b *ContainerResizePolicyApplyConfiguration) WithResourceName(value v1.Reso
return b return b
} }
// WithPolicy sets the Policy field in the declarative configuration to the given value // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Policy field is set to the value of the last call. // If called multiple times, the RestartPolicy field is set to the value of the last call.
func (b *ContainerResizePolicyApplyConfiguration) WithPolicy(value v1.ResourceResizePolicy) *ContainerResizePolicyApplyConfiguration { func (b *ContainerResizePolicyApplyConfiguration) WithRestartPolicy(value v1.ResourceResizeRestartPolicy) *ContainerResizePolicyApplyConfiguration {
b.Policy = &value b.RestartPolicy = &value
return b return b
} }

View File

@ -4281,11 +4281,11 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.core.v1.ContainerResizePolicy - name: io.k8s.api.core.v1.ContainerResizePolicy
map: map:
fields: fields:
- name: policy - name: resourceName
type: type:
scalar: string scalar: string
default: "" default: ""
- name: resourceName - name: restartPolicy
type: type:
scalar: string scalar: string
default: "" default: ""

View File

@ -74,8 +74,8 @@ type TestContainerInfo struct {
Name string Name string
Resources *ContainerResources Resources *ContainerResources
Allocations *ContainerAllocations Allocations *ContainerAllocations
CPUPolicy *v1.ResourceResizePolicy CPUPolicy *v1.ResourceResizeRestartPolicy
MemPolicy *v1.ResourceResizePolicy MemPolicy *v1.ResourceResizeRestartPolicy
RestartCount int32 RestartCount int32
} }
@ -146,18 +146,18 @@ func getTestResourceInfo(tcInfo TestContainerInfo) (v1.ResourceRequirements, v1.
} }
if tcInfo.CPUPolicy != nil { if tcInfo.CPUPolicy != nil {
cpuPol := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, Policy: *tcInfo.CPUPolicy} cpuPol := v1.ContainerResizePolicy{ResourceName: v1.ResourceCPU, RestartPolicy: *tcInfo.CPUPolicy}
resizePol = append(resizePol, cpuPol) resizePol = append(resizePol, cpuPol)
} }
if tcInfo.MemPolicy != nil { if tcInfo.MemPolicy != nil {
memPol := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, Policy: *tcInfo.MemPolicy} memPol := v1.ContainerResizePolicy{ResourceName: v1.ResourceMemory, RestartPolicy: *tcInfo.MemPolicy}
resizePol = append(resizePol, memPol) resizePol = append(resizePol, memPol)
} }
return res, alloc, resizePol return res, alloc, resizePol
} }
func initDefaultResizePolicy(containers []TestContainerInfo) { func initDefaultResizePolicy(containers []TestContainerInfo) {
noRestart := v1.RestartNotRequired noRestart := v1.NotRequired
setDefaultPolicy := func(ci *TestContainerInfo) { setDefaultPolicy := func(ci *TestContainerInfo) {
if ci.CPUPolicy == nil { if ci.CPUPolicy == nil {
ci.CPUPolicy = &noRestart ci.CPUPolicy = &noRestart
@ -500,8 +500,8 @@ func doPodResizeTests() {
expected []TestContainerInfo expected []TestContainerInfo
} }
noRestart := v1.RestartNotRequired noRestart := v1.NotRequired
doRestart := v1.RestartRequired doRestart := v1.RestartContainer
tests := []testCase{ tests := []testCase{
{ {
name: "Guaranteed QoS pod, one container - increase CPU & memory", name: "Guaranteed QoS pod, one container - increase CPU & memory",
@ -1010,7 +1010,7 @@ func doPodResizeTests() {
}, },
}, },
{ {
name: "Guaranteed QoS pod, one container - increase CPU (RestartNotRequired) & memory (RestartRequired)", name: "Guaranteed QoS pod, one container - increase CPU (NotRequired) & memory (RestartContainer)",
containers: []TestContainerInfo{ containers: []TestContainerInfo{
{ {
Name: "c1", Name: "c1",
@ -1033,7 +1033,7 @@ func doPodResizeTests() {
}, },
}, },
{ {
name: "Burstable QoS pod, one container - decrease CPU (RestartRequired) & memory (RestartNotRequired)", name: "Burstable QoS pod, one container - decrease CPU (RestartContainer) & memory (NotRequired)",
containers: []TestContainerInfo{ containers: []TestContainerInfo{
{ {
Name: "c1", Name: "c1",