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

Fix making OpenAPI V2 aggregator lazy #118212

Merged
merged 1 commit into from Jul 19, 2023

Conversation

Jefftree
Copy link
Member

@Jefftree Jefftree commented May 23, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Some notes:

  • PruningDefaults was removed. Built-ins & aggregated apiservices have defaults pruned, CRDs have defaults pruned already. No defaults should exist during aggregation. An extra PruneDefaults to the aggregator openapi (apiregistration.k8s.io) and removed it everywhere else in the aggregator
  • BuildandRegisterAggregator is extremely difficult to test. Instead of mocking webservices, openapiconfig, delegationtargets, etc, I opted to call a helper function to construct the specAggregator and test that instead.

Does this PR introduce a user-facing change?

Reduces CPU and memory consumption of kube-apiserver if OpenAPI V2 is not accessed by any client. Also improves performance of the apiserver on installation of many CRDs.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@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. release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kube-proxy area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 23, 2023
@Jefftree Jefftree force-pushed the updated-lazy-aggregator-v2 branch from 3ab8bce to 51d035a Compare May 23, 2023 21:51
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2023
@Jefftree Jefftree force-pushed the updated-lazy-aggregator-v2 branch 2 times, most recently from abf3d5f to 684484a Compare July 10, 2023 19:35
Copy link
Member

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

Thanks, left two minor comments. LGTM otherwise.

@Jefftree
Copy link
Member Author

Rebased and squashed

@sttts sttts added this to the v1.28 milestone Jul 18, 2023
@sttts sttts changed the title Update lazy aggregator OpenAPI V2 Fix making OpenAPI V2 aggregator lazy Jul 18, 2023
@sttts sttts added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jul 18, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 18, 2023
@sttts sttts added the kind/bug Categorizes issue or PR as related to a bug. label Jul 18, 2023
@furkatgofurov7
Copy link
Member

@Jefftree @sttts hey!

On behalf of the bug triage release team for 1.28, I'd like to inform you about the Code Freeze (01:00 UTC Wednesday 19th July 2023 / 18:00 PDT Tuesday 18th July 2023) that approaches tomorrow. Please ensure this PR goes in by tomorrow to avoid it being pushed out of the milestone

also cc PR labeled SIG-leads:
@kubernetes/sig-api-machinery-leads, @kubernetes/sig-architecture-leads, @kubernetes/sig-auth-leads, @kubernetes/sig-cli-leads, @kubernetes/sig-cloud-provider-leads, @kubernetes/sig-cluster-lifecycle-leads, @kubernetes/sig-instrumentation-leads, @kubernetes/sig-network-leads, @kubernetes/sig-storage-leads, @kubernetes/sig-node-leads

@Jefftree
Copy link
Member Author

This is a cleanup/bug fix PR. Also I think the tags are a bit stale, the changes mainly target sig apimachinery.

@sttts
Copy link
Contributor

sttts commented Jul 19, 2023

/lgtm
/approve

This makes the v2 aggregation a little more sane, and makes it lazy. There is certainly more potential for clarity, but this is a step into the right direction.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 19, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fb398cccd570350258a97e3b2ef4cc963bee6a5e

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree, sttts

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 853e3bd into kubernetes:master Jul 19, 2023
12 checks passed
SIG Node PR Triage automation moved this from Needs Reviewer to Done Jul 19, 2023
@Jefftree Jefftree deleted the updated-lazy-aggregator-v2 branch July 31, 2023 14:02
sushanth0910 added a commit to sushanth0910/kubernetes that referenced this pull request Feb 28, 2024
…zy-aggregator-v2"

This reverts commit 853e3bd, reversing
changes made to d6e5258.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kube-proxy area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants