Skip to content

Commit c95cc30

Browse files
remove total resouyrce calculation proposal from the sidecar KEP
1 parent 534b814 commit c95cc30

File tree

1 file changed

+4
-73
lines changed
  • keps/sig-node/753-sidecar-containers

1 file changed

+4
-73
lines changed

keps/sig-node/753-sidecar-containers/README.md

Lines changed: 4 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ tags, and then generate with `hack/update-toc.sh`.
107107
- [With sidecar container feature](#with-sidecar-container-feature)
108108
- [Resources calculation for scheduling and pod admission](#resources-calculation-for-scheduling-and-pod-admission)
109109
- [Exposing Pod Resource requirements](#exposing-pod-resource-requirements)
110-
- [Goals of exposing the Pod.TotalResourcesRequested field](#goals-of-exposing-the-podtotalresourcesrequested-field)
111-
- [Implementation details](#implementation-details)
112-
- [Notes for implementation](#notes-for-implementation)
113110
- [Resources calculation and Pod QoS evaluation](#resources-calculation-and-pod-qos-evaluation)
114111
- [Resource calculation and version skew](#resource-calculation-and-version-skew)
115112
- [Topology and CPU managers](#topology-and-cpu-managers)
@@ -864,76 +861,10 @@ It is too much to ask of users to perform this even more complex calculation
864861
simply to know the amount of free capacity they need for a given resource to
865862
allow a pod to schedule.
866863

867-
#### Goals of exposing the Pod.TotalResourcesRequested field
868-
869-
- Allow Kubernetes users to quickly identify the effective resource requirements
870-
for a pending or scheduled pod directly via observing the pod status.
871-
- Ability to cluster autoscaler, karpenter etc to collect a bunch of resource
872-
unavailable/unschedulable pods and easily sum up their
873-
`TotalResourcesRequested` to add nodes
874-
- Allow consuming the Pod Requested Resources via metrics:
875-
- Make sure kube_pod_resource_requests formula is up to date
876-
- Consider exposing Pod Requirements as a Pod state metric via
877-
https://github.com/kubernetes/kube-state-metrics/blob/main/docs/pod-metrics.md
878-
- Provide a well documented, reusable, exported function to be used to calculate
879-
the effective resource requirements for a v1.Pod struct.
880-
- Eliminate duplication of the pod resource requirement calculation within
881-
`kubelet` and `kube-scheduler`.
882-
883-
Note: in order to support the [Downgrade strategy](#downgrade-strategy), scheduler
884-
will ignore the presence of the feature gate when calculating resources. This will
885-
prevent overbooking of nodes when scheduler ignored sidecar when calculating resources
886-
and scheduled too many Pods on the Node that had the feature gate enabled.
887-
888-
#### Implementation details
889-
890-
We propose making two changes to satisfy the two primary consumers of the
891-
effective pod resource requests, users and other Kubernetes ecosystem software
892-
components.
893-
894-
The first change is to add a field to `PodStatus` to represent the effective
895-
resource requirements for the pod. The field is named
896-
`TotalResourcesRequested`. This field allows users to inspect running and
897-
pending pods to quickly determine their effective resource requirements. The
898-
field will be first populated by scheduler in the
899-
[updatePod](https://github.com/kubernetes/kubernetes/blob/815e651f397a6f5691efb26b0d4f3bddb034668c/pkg/scheduler/schedule_one.go#L943).
900-
901-
The updating of this field would occur the existing
902-
[generateAPIPodStatus](https://github.com/kubernetes/kubernetes/blob/a668924cb60901b413abc1fe7817bc7969167064/pkg/kubelet/kubelet_pods.go#L1459) method.
903-
904-
```
905-
// TotalResourcesRequested is the effective resource requirements for this pod, taking into consideration init containers, sidecars, containers and pod overhead.
906-
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
907-
// +optional
908-
TotalResourcesRequested ResourceList `json:"totalResourcesRequested,omitempty" protobuf:"bytes,8,opt,name=totalResourcesRequested"`
909-
```
910-
911-
The second change is to update the [PodRequestsAndLimitsReuse](https://github.com/kubernetes/kubernetes/blob/dfc9bf0953360201618ad52308ccb34fd8076dff/pkg/api/v1/resource/helpers.go#L64) function to support
912-
the new calculation and, if possible, re-use this functionality the other places
913-
that pod resource requests are needed (e.g. kube-scheduler, kubelet). This
914-
ensures that components within Kubernetes have an identical computation for
915-
effective resource requirements and will reduce maintenance effort. Currently
916-
this function is only used for the metrics `kube_pod_resource_request` and
917-
`kube_pod_resource_limit` that are exposed by `kube-scheduler` which align with the
918-
values that will also now be reported on the pod status.
919-
920-
A correct, exported function is particularly useful for other Kubernetes
921-
ecosystem components that need to know the resource requirements for pods that
922-
don’t exist yet. For example, an autoscaler needs to know what the resource
923-
requirements will be for DaemonSet pods when they are created to incorporate
924-
them into its calculations if it supports scale to zero.
925-
926-
#### Notes for implementation
927-
928-
This change could be made in a phased manner:
929-
- Refactor to use the `PodRequestsAndLimitsReuse` function in all situations where pod resource requests are needed.
930-
- Add the new `TotalResourcesRequested` field on `PodStatus` and modify
931-
`kubelet` & `kube-scheduler` to update the field.
932-
933-
These two changes are independent of the sidecar and in-place resource update
934-
KEPs. The first change doesn’t present any user visible change, and if
935-
implemented, will in a small way reduce the effort for both of those KEPs by
936-
providing a single place to update the pod resource calculation.
864+
This KEP will not expose the total resource requests field to end user
865+
as many decisions on this field need to be made from other KEPs: InPlace pod update
866+
and Pod Level resources. We do not want to make it harder for those new KEPs
867+
to be implemented by exposing this field prematurely.
937868

938869
#### Resources calculation and Pod QoS evaluation
939870

0 commit comments

Comments
 (0)