Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PodRequests calculations for initContainers with restartPolicy: Always #479

Closed
jonathan-innis opened this issue Aug 20, 2023 · 1 comment · Fixed by #569
Closed
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. scheduling v1.x Issues prioritized for post-1.0

Comments

@jonathan-innis
Copy link
Member

jonathan-innis commented Aug 20, 2023

Description

What problem are you trying to solve?

Kubernetes 1.28 introduces the SidecarContainers feature into alpha. This feature means that sidecar containers can now be ordered, meaning that upstream K8s have essentially collapsed the concept of a sidecar container down into an ordered init container with a restartPolicy set to Always. This change means that we now have to consider initContainers in our calculation of pod resource requests differently if they have a restartPolicy set to Always (since this means that the resource requests will always be utilized for all containers on the pod to run).

The changes the calculation from:

podRequests = max(max(each initContainers[i]),sum(containers))

to:

initContainerRequests[i] = sum(sidecar containers with index < i) + initContainers[i]
podRequests = max(max(each initContainers[i]) , sum(sidecarContainers) + sum(containers))

Relevant Links

Upstream Resource Request Calculation Code: https://github.com/kubernetes/kubernetes/blob/e2afa175e4077d767745246662170acd86affeaf/pkg/api/v1/resource/helpers.go#L96
KEP: https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/753-sidecar-containers/README.md
Blog: https://www.mirantis.com/blog/understanding-kubernetes-new-sidecar-container-feature

How important is this feature to you?

This is a supported feature in upstream that is currently in Alpha but has sufficient momentum that there is belief in the community that it will be quickly pushed to Beta, where Karpenter will want to support it.

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@jonathan-innis jonathan-innis added kind/feature Categorizes issue or PR as related to a new feature. v1.x Issues prioritized for post-1.0 scheduling labels Aug 20, 2023
@sadath-12
Copy link
Contributor

Happy to help with this issue . Assign me

@k8s-ci-robot k8s-ci-robot added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed help-wanted labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. scheduling v1.x Issues prioritized for post-1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants