-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
pod-overhead: add Overhead to PodSpec and RuntimeClass #76968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some wording tweaks
/priority important-soon |
d2177ca
to
0ae7470
Compare
Thanks for the quick feedback @tallclair - updated, PTAL! |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the PodOverhead feature is not enabled, the overhead field needs to be dropped. See https://github.com/kubernetes/kubernetes/blob/master/pkg/api/pod/util.go#L283
I also think it makes sense to add the RuntimeClass API in the same PR, since those fields are intrinsically linked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egernst - can you add the runtimeClass API on a separate commit ?
0ae7470
to
a115911
Compare
63caae5
to
56bbb93
Compare
if !utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) && !overheadInUse(oldPodSpec) { | ||
// Set Overhead to nil only if the feature is disabled and it is not used | ||
podSpec.Overhead = nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do the same for RuntimeClass. The framework isn't inplace for it though, so you'll need to call it from the storage strategy: https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/node/runtimeclass/strategy.go#L58
(see the pod version for an example: https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/core/pod/strategy.go#L72)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, though i didn't see how that relates to storage, per se. Added a commit, PTAL, @tallclair
56bbb93
to
013133d
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: egernst, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This needs a lgtm one more time, since the latest rebase. ping @thockin |
Prior API review approval for reference: #76968 (review) |
013133d
to
5e09568
Compare
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Update internal PodSpec to make use of Overhead field. Add validation and validation tests. Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Co-authored-by: Tim Allclair <tallclair@google.com> Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
/test pull-kubernetes-e2e-gce-100-performance |
/test pull-kubernetes-bazel-test |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API still LGTM
_ = obj.(*node.RuntimeClass) | ||
rc := obj.(*node.RuntimeClass) | ||
|
||
if !utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) && rc != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need PrepareForUpdate() ?
@@ -3095,6 +3101,10 @@ func ValidatePodSpec(spec *core.PodSpec, fldPath *field.Path) field.ErrorList { | |||
allErrs = append(allErrs, ValidatePreemptionPolicy(spec.PreemptionPolicy, fldPath.Child("preemptionPolicy"))...) | |||
} | |||
|
|||
if spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have the strategy blanking out the fields, you should not even need to check the gate here - it will be nil, right?
What type of PR is this?
/kind feature
What this PR does / why we need it:
Addition of overhead field to the PodSpec as part of the API changes described in the Pod Overhead KEP
Does this PR introduce a user-facing change?:
Yes
/sig node