Merge pull request #115463 from SergeyKanzhelev/containerStatusDocs

update docs for ContainerStatus fields
This commit is contained in:
Kubernetes Prow Robot 2023-03-03 20:17:06 -08:00 committed by GitHub
commit d48b8167f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 145 additions and 68 deletions

View File

@ -4973,27 +4973,27 @@
"description": "ContainerStatus contains details for the current status of this container.",
"properties": {
"containerID": {
"description": "Container's ID in the format '<type>://<container_id>'.",
"description": "ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
"type": "string"
},
"image": {
"description": "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.",
"description": "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
"type": "string"
},
"imageID": {
"description": "ImageID of the container's image.",
"description": "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
"type": "string"
},
"lastState": {
"$ref": "#/definitions/io.k8s.api.core.v1.ContainerState",
"description": "Details about the container's last termination condition."
"description": "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0."
},
"name": {
"description": "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.",
"description": "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
"type": "string"
},
"ready": {
"description": "Specifies whether the container has passed its readiness probe.",
"description": "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
"type": "boolean"
},
"resources": {
@ -5008,17 +5008,17 @@
"type": "object"
},
"restartCount": {
"description": "The number of times the container has been restarted.",
"description": "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
"format": "int32",
"type": "integer"
},
"started": {
"description": "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.",
"description": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
"type": "boolean"
},
"state": {
"$ref": "#/definitions/io.k8s.api.core.v1.ContainerState",
"description": "Details about the container's current condition."
"description": "State holds details about the container's current condition."
}
},
"required": [

View File

@ -1438,17 +1438,17 @@
"description": "ContainerStatus contains details for the current status of this container.",
"properties": {
"containerID": {
"description": "Container's ID in the format '<type>://<container_id>'.",
"description": "ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
"type": "string"
},
"image": {
"default": "",
"description": "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.",
"description": "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
"type": "string"
},
"imageID": {
"default": "",
"description": "ImageID of the container's image.",
"description": "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
"type": "string"
},
"lastState": {
@ -1458,16 +1458,16 @@
}
],
"default": {},
"description": "Details about the container's last termination condition."
"description": "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0."
},
"name": {
"default": "",
"description": "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.",
"description": "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
"type": "string"
},
"ready": {
"default": false,
"description": "Specifies whether the container has passed its readiness probe.",
"description": "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
"type": "boolean"
},
"resources": {
@ -1492,12 +1492,12 @@
},
"restartCount": {
"default": 0,
"description": "The number of times the container has been restarted.",
"description": "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
"format": "int32",
"type": "integer"
},
"started": {
"description": "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.",
"description": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
"type": "boolean"
},
"state": {
@ -1507,7 +1507,7 @@
}
],
"default": {},
"description": "Details about the container's current condition."
"description": "State holds details about the container's current condition."
}
},
"required": [

View File

@ -2441,24 +2441,57 @@ type ContainerState struct {
Terminated *ContainerStateTerminated
}
// ContainerStatus represents the status of a container
// ContainerStatus contains details for the current status of this container.
type ContainerStatus struct {
// Each container in a pod must have a unique name.
// Name is a DNS_LABEL representing the unique name of the container.
// Each container in a pod must have a unique name across all container types.
// Cannot be updated.
Name string
// State holds details about the container's current condition.
// +optional
State ContainerState
// LastTerminationState holds the last termination state of the container to
// help debug container crashes and restarts. This field is not
// populated if the container is still running and RestartCount is 0.
// +optional
LastTerminationState ContainerState
// Ready specifies whether the container has passed its readiness check.
// Ready specifies whether the container is currently passing its readiness check.
// The value will change as readiness probes keep executing. If no readiness
// probes are specified, this field defaults to true once the container is
// fully started (see Started field).
//
// The value is typically used to determine whether a container is ready to
// accept traffic.
Ready bool
// Note that this is calculated from dead containers. But those containers are subject to
// garbage collection. This value will get capped at 5 by GC.
// RestartCount holds the number of times the container has been restarted.
// Kubelet makes an effort to always increment the value, but there
// are cases when the state may be lost due to node restarts and then the value
// may be reset to 0. The value is never negative.
RestartCount int32
Image string
ImageID string
// Image is the name of container image that the container is running.
// The container image may not match the image used in the PodSpec,
// as it may have been resolved by the runtime.
// More info: https://kubernetes.io/docs/concepts/containers/images.
Image string
// ImageID is the image ID of the container's image. The image ID may not
// match the image ID of the image used in the PodSpec, as it may have been
// resolved by the runtime.
ImageID string
// ContainerID is the ID of the container in the format '<type>://<container_id>'.
// Where type is a container runtime identifier, returned from Version call of CRI API
// (for example "containerd").
// +optional
ContainerID string
Started *bool
// Started indicates whether the container has finished its postStart lifecycle hook
// and passed its startup probe.
// Initialized as false, becomes true after startupProbe is considered
// successful. Resets to false when the container is restarted, or if kubelet
// loses state temporarily. In both cases, startup probes will run again.
// Is always true when no startupProbe is defined and container is running and
// has passed the postStart lifecycle hook. The null value must be treated the
// same as false.
// +optional
Started *bool
// ResourcesAllocated represents the compute resources allocated for this container by the
// node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission
// and after successfully admitting desired pod resize.

View File

@ -17447,7 +17447,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Description: "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.",
Description: "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
Default: "",
Type: []string{"string"},
Format: "",
@ -17455,21 +17455,21 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
},
"state": {
SchemaProps: spec.SchemaProps{
Description: "Details about the container's current condition.",
Description: "State holds details about the container's current condition.",
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/core/v1.ContainerState"),
},
},
"lastState": {
SchemaProps: spec.SchemaProps{
Description: "Details about the container's last termination condition.",
Description: "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.",
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/core/v1.ContainerState"),
},
},
"ready": {
SchemaProps: spec.SchemaProps{
Description: "Specifies whether the container has passed its readiness probe.",
Description: "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
Default: false,
Type: []string{"boolean"},
Format: "",
@ -17477,7 +17477,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
},
"restartCount": {
SchemaProps: spec.SchemaProps{
Description: "The number of times the container has been restarted.",
Description: "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
Default: 0,
Type: []string{"integer"},
Format: "int32",
@ -17485,7 +17485,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
},
"image": {
SchemaProps: spec.SchemaProps{
Description: "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.",
Description: "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
Default: "",
Type: []string{"string"},
Format: "",
@ -17493,7 +17493,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
},
"imageID": {
SchemaProps: spec.SchemaProps{
Description: "ImageID of the container's image.",
Description: "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
Default: "",
Type: []string{"string"},
Format: "",
@ -17501,14 +17501,14 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm
},
"containerID": {
SchemaProps: spec.SchemaProps{
Description: "Container's ID in the format '<type>://<container_id>'.",
Description: "ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
Type: []string{"string"},
Format: "",
},
},
"started": {
SchemaProps: spec.SchemaProps{
Description: "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.",
Description: "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
Type: []string{"boolean"},
Format: "",
},

View File

@ -946,39 +946,61 @@ message ContainerStateWaiting {
// ContainerStatus contains details for the current status of this container.
message ContainerStatus {
// This must be a DNS_LABEL. Each container in a pod must have a unique name.
// Name is a DNS_LABEL representing the unique name of the container.
// Each container in a pod must have a unique name across all container types.
// Cannot be updated.
optional string name = 1;
// Details about the container's current condition.
// State holds details about the container's current condition.
// +optional
optional ContainerState state = 2;
// Details about the container's last termination condition.
// LastTerminationState holds the last termination state of the container to
// help debug container crashes and restarts. This field is not
// populated if the container is still running and RestartCount is 0.
// +optional
optional ContainerState lastState = 3;
// Specifies whether the container has passed its readiness probe.
// Ready specifies whether the container is currently passing its readiness check.
// The value will change as readiness probes keep executing. If no readiness
// probes are specified, this field defaults to true once the container is
// fully started (see Started field).
//
// The value is typically used to determine whether a container is ready to
// accept traffic.
optional bool ready = 4;
// The number of times the container has been restarted.
// RestartCount holds the number of times the container has been restarted.
// Kubelet makes an effort to always increment the value, but there
// are cases when the state may be lost due to node restarts and then the value
// may be reset to 0. The value is never negative.
optional int32 restartCount = 5;
// The image the container is running.
// Image is the name of container image that the container is running.
// The container image may not match the image used in the PodSpec,
// as it may have been resolved by the runtime.
// More info: https://kubernetes.io/docs/concepts/containers/images.
optional string image = 6;
// ImageID of the container's image.
// ImageID is the image ID of the container's image. The image ID may not
// match the image ID of the image used in the PodSpec, as it may have been
// resolved by the runtime.
optional string imageID = 7;
// Container's ID in the format '<type>://<container_id>'.
// ContainerID is the ID of the container in the format '<type>://<container_id>'.
// Where type is a container runtime identifier, returned from Version call of CRI API
// (for example "containerd").
// +optional
optional string containerID = 8;
// Specifies whether the container has passed its startup probe.
// Initialized as false, becomes true after startupProbe is considered successful.
// Resets to false when the container is restarted, or if kubelet loses state temporarily.
// Is always true when no startupProbe is defined.
// Started indicates whether the container has finished its postStart lifecycle hook
// and passed its startup probe.
// Initialized as false, becomes true after startupProbe is considered
// successful. Resets to false when the container is restarted, or if kubelet
// loses state temporarily. In both cases, startup probes will run again.
// Is always true when no startupProbe is defined and container is running and
// has passed the postStart lifecycle hook. The null value must be treated the
// same as false.
// +optional
optional bool started = 9;

View File

@ -2661,31 +2661,53 @@ type ContainerState struct {
// ContainerStatus contains details for the current status of this container.
type ContainerStatus struct {
// This must be a DNS_LABEL. Each container in a pod must have a unique name.
// Name is a DNS_LABEL representing the unique name of the container.
// Each container in a pod must have a unique name across all container types.
// Cannot be updated.
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
// Details about the container's current condition.
// State holds details about the container's current condition.
// +optional
State ContainerState `json:"state,omitempty" protobuf:"bytes,2,opt,name=state"`
// Details about the container's last termination condition.
// LastTerminationState holds the last termination state of the container to
// help debug container crashes and restarts. This field is not
// populated if the container is still running and RestartCount is 0.
// +optional
LastTerminationState ContainerState `json:"lastState,omitempty" protobuf:"bytes,3,opt,name=lastState"`
// Specifies whether the container has passed its readiness probe.
// Ready specifies whether the container is currently passing its readiness check.
// The value will change as readiness probes keep executing. If no readiness
// probes are specified, this field defaults to true once the container is
// fully started (see Started field).
//
// The value is typically used to determine whether a container is ready to
// accept traffic.
Ready bool `json:"ready" protobuf:"varint,4,opt,name=ready"`
// The number of times the container has been restarted.
// RestartCount holds the number of times the container has been restarted.
// Kubelet makes an effort to always increment the value, but there
// are cases when the state may be lost due to node restarts and then the value
// may be reset to 0. The value is never negative.
RestartCount int32 `json:"restartCount" protobuf:"varint,5,opt,name=restartCount"`
// The image the container is running.
// Image is the name of container image that the container is running.
// The container image may not match the image used in the PodSpec,
// as it may have been resolved by the runtime.
// More info: https://kubernetes.io/docs/concepts/containers/images.
Image string `json:"image" protobuf:"bytes,6,opt,name=image"`
// ImageID of the container's image.
// ImageID is the image ID of the container's image. The image ID may not
// match the image ID of the image used in the PodSpec, as it may have been
// resolved by the runtime.
ImageID string `json:"imageID" protobuf:"bytes,7,opt,name=imageID"`
// Container's ID in the format '<type>://<container_id>'.
// ContainerID is the ID of the container in the format '<type>://<container_id>'.
// Where type is a container runtime identifier, returned from Version call of CRI API
// (for example "containerd").
// +optional
ContainerID string `json:"containerID,omitempty" protobuf:"bytes,8,opt,name=containerID"`
// Specifies whether the container has passed its startup probe.
// Initialized as false, becomes true after startupProbe is considered successful.
// Resets to false when the container is restarted, or if kubelet loses state temporarily.
// Is always true when no startupProbe is defined.
// Started indicates whether the container has finished its postStart lifecycle hook
// and passed its startup probe.
// Initialized as false, becomes true after startupProbe is considered
// successful. Resets to false when the container is restarted, or if kubelet
// loses state temporarily. In both cases, startup probes will run again.
// Is always true when no startupProbe is defined and container is running and
// has passed the postStart lifecycle hook. The null value must be treated the
// same as false.
// +optional
Started *bool `json:"started,omitempty" protobuf:"varint,9,opt,name=started"`
// ResourcesAllocated represents the compute resources allocated for this container by the

View File

@ -446,15 +446,15 @@ func (ContainerStateWaiting) SwaggerDoc() map[string]string {
var map_ContainerStatus = map[string]string{
"": "ContainerStatus contains details for the current status of this container.",
"name": "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.",
"state": "Details about the container's current condition.",
"lastState": "Details about the container's last termination condition.",
"ready": "Specifies whether the container has passed its readiness probe.",
"restartCount": "The number of times the container has been restarted.",
"image": "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.",
"imageID": "ImageID of the container's image.",
"containerID": "Container's ID in the format '<type>://<container_id>'.",
"started": "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.",
"name": "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
"state": "State holds details about the container's current condition.",
"lastState": "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.",
"ready": "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
"restartCount": "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
"image": "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
"imageID": "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
"containerID": "ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
"started": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
"resourcesAllocated": "ResourcesAllocated represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.",
"resources": "Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.",
}