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

Step 5 – generic controplane: split aggregator API priorities #124613

Merged
merged 2 commits into from Apr 30, 2024

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Apr 29, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

In a generic controlplane, the aggregator will need a partial set of API priorities. This PR splits up the big table, and merges non-generic API priorities into the generic priorities.

NO FUNCTIONAL CHANGE.

Part of #124530.

Which issue(s) this PR fixes:

Towards kubernetes/enhancements#4080.

Special notes for your reviewer:

This is just code move. No behaviour change.

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 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-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 sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 29, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Apr 29, 2024
@sttts sttts added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 29, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Apr 29, 2024
@sttts sttts added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2024
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
@sttts sttts force-pushed the sttts-generic-api-versions branch from 3cc5f33 to 03ae7fc Compare April 29, 2024 14:19
@sttts sttts changed the title :feature: generic controplane: split aggregator API priorities generic controplane: split aggregator API priorities Apr 29, 2024
Comment on lines 47 to 50
{Group: "autoscaling", Version: "v1"}: {Group: 17500, Version: 15},
{Group: "autoscaling", Version: "v2"}: {Group: 17500, Version: 30},
{Group: "autoscaling", Version: "v2beta1"}: {Group: 17500, Version: 9},
{Group: "autoscaling", Version: "v2beta2"}: {Group: 17500, Version: 1},
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason these are in the controlplane code and not in kube-apiserver?

Copy link
Contributor

Choose a reason for hiding this comment

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

aren't these for kube-apiserver related aka workloads?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aren't they working against any resource with scale resource? Then they are generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I agree with you, looking into that group which resources it exposes. Updated the PR.

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2024

/retest

@mjudeikis
Copy link
Contributor

I think this impacts only controlplane as we might be missing resources there, but not in kube-apiserver. So we can always move from one bucket to another later on.
/lgtm

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

LGTM label has been added.

Git tree hash: 00407496c307c135e97f221896c5ab87776cfbc9

@k8s-ci-robot k8s-ci-robot merged commit 031e6c3 into kubernetes:master Apr 30, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone Apr 30, 2024
@cici37
Copy link
Contributor

cici37 commented Apr 30, 2024

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 30, 2024
@sttts sttts changed the title generic controplane: split aggregator API priorities Step 5 – generic controplane: split aggregator API priorities May 1, 2024
@@ -349,3 +317,10 @@ func apiServicesToRegister(delegateAPIServer genericapiserver.DelegationTarget,

return apiServices
}

func merge(a, b map[schema.GroupVersion]controlplaneapiserver.APIServicePriority) map[schema.GroupVersion]controlplaneapiserver.APIServicePriority {
Copy link
Member

Choose a reason for hiding this comment

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

now it's not a problem, but I was first thinking that it could be problematic if this function would be passed some generic global variable, as this func mutates a. You indeed solved it with having a function returning a new variable every time, but just something to be careful about, unless this function first does a deep copy of a.

{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {Group: 16100, Version: 12},
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16100, Version: 9},
{Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16000, Version: 9},
{Group: "resource.k8s.io", Version: "v1alpha2"}: {Group: 15900, Version: 9},
Copy link
Member

Choose a reason for hiding this comment

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

Is this really generic? This seems to be related to Dynamic Resource Allocation, which is pod-specific if I'm not mistaken?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I can see it has few types we might want to use in building some quota machinery:
https://pkg.go.dev/k8s.io/api@v0.30.0/resource/v1alpha2
but in general I think you right.

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants