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

pod-overhead: add Overhead to PodSpec and RuntimeClass #76968

Merged
merged 8 commits into from
Jun 18, 2019

Conversation

egernst
Copy link
Contributor

@egernst egernst commented Apr 23, 2019

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

Addition of Overhead field to the PodSpec and RuntimeClass types as part of the Pod Overhead KEP

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 23, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 24, 2019
Copy link
Member

@tallclair tallclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some wording tweaks

staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
@tallclair
Copy link
Member

/priority important-soon
/sig node
/milestone v1.15

@k8s-ci-robot k8s-ci-robot added this to the v1.15 milestone Apr 24, 2019
@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 24, 2019
@egernst egernst changed the title WIP: PodSpec overhead pod-overhead: add overhead to the PodSpec Apr 24, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2019
@egernst egernst changed the title pod-overhead: add overhead to the PodSpec pod-overhead: add Overhead to the PodSpec Apr 24, 2019
@egernst
Copy link
Contributor Author

egernst commented Apr 24, 2019

Thanks for the quick feedback @tallclair - updated, PTAL!

@fejta-bot
Copy link

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.

@tallclair tallclair added the api-review Categorizes an issue or PR as actively needing an API review. label Apr 25, 2019
Copy link
Member

@tallclair tallclair left a 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.

pkg/apis/core/types.go Show resolved Hide resolved
pkg/apis/core/types.go Outdated Show resolved Hide resolved
pkg/apis/core/validation/validation.go Show resolved Hide resolved
Copy link
Member

@yastij yastij left a 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 ?

pkg/apis/core/validation/validation.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 5, 2019
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 10, 2019
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
}
Copy link
Member

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)

Copy link
Contributor Author

@egernst egernst Jun 17, 2019

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

pkg/apis/core/types.go Outdated Show resolved Hide resolved
pkg/features/kube_features.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/core/v1/types.go Outdated Show resolved Hide resolved
pkg/apis/node/types.go Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@egernst
Copy link
Contributor Author

egernst commented Jun 17, 2019

This needs a lgtm one more time, since the latest rebase. ping @thockin

@egernst
Copy link
Contributor Author

egernst commented Jun 18, 2019

Prior API review approval for reference: #76968 (review)

/cc @liggitt @tallclair @thockin @yastij

Eric Ernst and others added 8 commits June 18, 2019 08:05
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>
@egernst
Copy link
Contributor Author

egernst commented Jun 18, 2019

/test pull-kubernetes-e2e-gce-100-performance

@egernst
Copy link
Contributor Author

egernst commented Jun 18, 2019

/test pull-kubernetes-bazel-test

@tallclair
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 18, 2019
@k8s-ci-robot k8s-ci-robot merged commit 155f4a6 into kubernetes:master Jun 18, 2019
Copy link
Member

@thockin thockin left a 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 {
Copy link
Member

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) {
Copy link
Member

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?

@liggitt liggitt moved this from Assigned to API review completed, 1.16 in API Reviews Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: API review completed, 1.16
Development

Successfully merging this pull request may close these issues.

None yet

10 participants