Merge pull request #37968 from sjenning/qos-pod-status-field

Automatic merge from submit-queue (batch tested with PRs 38171, 37968)

add QoS pod status field

Right now, applications retrieving pod information must reimplement the QoS classification logic on the client side if they wish to know the QoS class of the pod.

The PR adds the QoS class to the pod status so it can be used directly by clients.

This is a step toward addressing #33255

@ConnorDoyle @derekwaynecarr @vishh
pull/6/head
Kubernetes Submit Queue 2016-12-13 11:51:35 -08:00 committed by GitHub
commit 702f545aab
13 changed files with 13932 additions and 13766 deletions

View File

@ -34450,6 +34450,10 @@
"description": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.",
"type": "string"
},
"qosClass": {
"description": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md",
"type": "string"
},
"reason": {
"description": "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'OutOfDisk'",
"type": "string"

View File

@ -19103,6 +19103,10 @@
"$ref": "v1.ContainerStatus"
},
"description": "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses"
},
"qosClass": {
"type": "string",
"description": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md"
}
}
},

View File

@ -4239,6 +4239,13 @@ The resulting set of endpoints can be viewed as:<br>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_containerstatus">v1.ContainerStatus</a> array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">qosClass</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md">https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@ -8620,7 +8627,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-12-08 13:46:52 UTC
Last updated 2016-12-13 02:20:43 UTC
</div>
</div>
</body>

View File

@ -1894,6 +1894,18 @@ type PodSecurityContext struct {
FSGroup *int64
}
// PodQOSClass defines the supported qos classes of Pods.
type PodQOSClass string
const (
// PodQOSGuaranteed is the Guaranteed qos class.
PodQOSGuaranteed PodQOSClass = "Guaranteed"
// PodQOSBurstable is the Burstable qos class.
PodQOSBurstable PodQOSClass = "Burstable"
// PodQOSBestEffort is the BestEffort qos class.
PodQOSBestEffort PodQOSClass = "BestEffort"
)
// PodStatus represents information about the status of a pod. Status may trail the actual
// state of a system.
type PodStatus struct {
@ -1917,6 +1929,8 @@ type PodStatus struct {
// This is before the Kubelet pulled the container image(s) for the pod.
// +optional
StartTime *metav1.Time
// +optional
QOSClass PodQOSClass `json:"qosClass,omitempty"`
// The list has one entry per init container in the manifest. The most recent successful
// init container will have ready = true, the most recently started container will have

File diff suppressed because it is too large Load Diff

View File

@ -2560,6 +2560,12 @@ message PodStatus {
// More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses
// +optional
repeated ContainerStatus containerStatuses = 8;
// The Quality of Service (QOS) classification assigned to the pod based on resource requirements
// See PodQOSClass type for available QOS classes
// More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md
// +optional
optional string qosClass = 9;
}
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded

File diff suppressed because it is too large Load Diff

View File

@ -2153,6 +2153,18 @@ type PodSecurityContext struct {
FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"`
}
// PodQOSClass defines the supported qos classes of Pods.
type PodQOSClass string
const (
// PodQOSGuaranteed is the Guaranteed qos class.
PodQOSGuaranteed PodQOSClass = "Guaranteed"
// PodQOSBurstable is the Burstable qos class.
PodQOSBurstable PodQOSClass = "Burstable"
// PodQOSBestEffort is the BestEffort qos class.
PodQOSBestEffort PodQOSClass = "BestEffort"
)
// PodStatus represents information about the status of a pod. Status may trail the actual
// state of a system.
type PodStatus struct {
@ -2196,6 +2208,11 @@ type PodStatus struct {
// More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses
// +optional
ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"`
// The Quality of Service (QOS) classification assigned to the pod based on resource requirements
// See PodQOSClass type for available QOS classes
// More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md
// +optional
QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"`
}
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded

View File

@ -1290,6 +1290,7 @@ var map_PodStatus = map[string]string{
"podIP": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.",
"startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.",
"containerStatuses": "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses",
"qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md",
}
func (PodStatus) SwaggerDoc() map[string]string {

View File

@ -3113,6 +3113,7 @@ func autoConvert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus
out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
out.InitContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses))
out.ContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses))
out.QOSClass = api.PodQOSClass(in.QOSClass)
return nil
}
@ -3128,6 +3129,7 @@ func autoConvert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus
out.HostIP = in.HostIP
out.PodIP = in.PodIP
out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
out.QOSClass = PodQOSClass(in.QOSClass)
out.InitContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses))
out.ContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses))
return nil

View File

@ -2713,6 +2713,7 @@ func DeepCopy_v1_PodStatus(in interface{}, out interface{}, c *conversion.Cloner
} else {
out.ContainerStatuses = nil
}
out.QOSClass = in.QOSClass
return nil
}
}

View File

@ -2730,6 +2730,7 @@ func DeepCopy_api_PodStatus(in interface{}, out interface{}, c *conversion.Clone
} else {
out.StartTime = nil
}
out.QOSClass = in.QOSClass
if in.InitContainerStatuses != nil {
in, out := &in.InitContainerStatuses, &out.InitContainerStatuses
*out = make([]ContainerStatus, len(*in))

View File

@ -5452,6 +5452,13 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
},
},
},
"qosClass": {
SchemaProps: spec.SchemaProps{
Description: "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md",
Type: []string{"string"},
Format: "",
},
},
},
},
},