diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 7b34976dc53..a0c97aebc8c 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -6514,7 +6514,7 @@ "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resizePolicy": { - "description": "Resources resize policy for the container.", + "description": "Resources resize policy for the container. This field cannot be set on ephemeral containers.", "items": { "$ref": "#/definitions/io.k8s.api.core.v1.ContainerResizePolicy" }, diff --git a/api/openapi-spec/v3/api__v1_openapi.json b/api/openapi-spec/v3/api__v1_openapi.json index 0934afc4c3d..df9962656d8 100644 --- a/api/openapi-spec/v3/api__v1_openapi.json +++ b/api/openapi-spec/v3/api__v1_openapi.json @@ -1230,7 +1230,7 @@ "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resizePolicy": { - "description": "Resources resize policy for the container.", + "description": "Resources resize policy for the container. This field cannot be set on ephemeral containers.", "items": { "allOf": [ { diff --git a/api/openapi-spec/v3/apis__apps__v1_openapi.json b/api/openapi-spec/v3/apis__apps__v1_openapi.json index 17b83a49649..39f1da59ada 100644 --- a/api/openapi-spec/v3/apis__apps__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apps__v1_openapi.json @@ -1868,7 +1868,7 @@ "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resizePolicy": { - "description": "Resources resize policy for the container.", + "description": "Resources resize policy for the container. This field cannot be set on ephemeral containers.", "items": { "allOf": [ { diff --git a/api/openapi-spec/v3/apis__batch__v1_openapi.json b/api/openapi-spec/v3/apis__batch__v1_openapi.json index 200e4372ee4..e5996b4bc81 100644 --- a/api/openapi-spec/v3/apis__batch__v1_openapi.json +++ b/api/openapi-spec/v3/apis__batch__v1_openapi.json @@ -1206,7 +1206,7 @@ "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resizePolicy": { - "description": "Resources resize policy for the container.", + "description": "Resources resize policy for the container. This field cannot be set on ephemeral containers.", "items": { "allOf": [ { diff --git a/pkg/apis/core/types.go b/pkg/apis/core/types.go index 24448a8dd58..6d59eef700c 100644 --- a/pkg/apis/core/types.go +++ b/pkg/apis/core/types.go @@ -2639,6 +2639,7 @@ type Container struct { // +optional Resources ResourceRequirements // Resources resize policy for the container. + // This field cannot be set on ephemeral containers. // +featureGate=InPlacePodVerticalScaling // +optional ResizePolicy []ContainerResizePolicy diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 1e44669b46e..7bf0825ec57 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -22368,7 +22368,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, SchemaProps: spec.SchemaProps{ - Description: "Resources resize policy for the container.", + Description: "Resources resize policy for the container. This field cannot be set on ephemeral containers.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ diff --git a/staging/src/k8s.io/api/core/v1/generated.proto b/staging/src/k8s.io/api/core/v1/generated.proto index c4325d930a8..2fd5c7effd5 100644 --- a/staging/src/k8s.io/api/core/v1/generated.proto +++ b/staging/src/k8s.io/api/core/v1/generated.proto @@ -762,6 +762,7 @@ message Container { optional ResourceRequirements resources = 8; // Resources resize policy for the container. + // This field cannot be set on ephemeral containers. // +featureGate=InPlacePodVerticalScaling // +optional // +listType=atomic diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index cc992af4e08..a5790c1b2e1 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -2958,6 +2958,7 @@ type Container struct { // +optional Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // Resources resize policy for the container. + // This field cannot be set on ephemeral containers. // +featureGate=InPlacePodVerticalScaling // +optional // +listType=atomic diff --git a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go index b912cf48aa8..25545f590cc 100644 --- a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -359,7 +359,7 @@ var map_Container = map[string]string{ "envFrom": "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "env": "List of environment variables to set in the container. Cannot be updated.", "resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", - "resizePolicy": "Resources resize policy for the container.", + "resizePolicy": "Resources resize policy for the container. This field cannot be set on ephemeral containers.", "restartPolicy": "RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", "restartPolicyRules": "Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy.", "volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.", diff --git a/staging/src/k8s.io/client-go/applyconfigurations/core/v1/container.go b/staging/src/k8s.io/client-go/applyconfigurations/core/v1/container.go index 2ab4fc1edfd..262ee48c075 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/core/v1/container.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/core/v1/container.go @@ -82,6 +82,7 @@ type ContainerApplyConfiguration struct { // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` // Resources resize policy for the container. + // This field cannot be set on ephemeral containers. ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` // RestartPolicy defines the restart behavior of individual containers in a pod. // This overrides the pod-level restart policy. When this field is not specified,