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

Disable priority and fairness by default #171

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

dgrisonnet
Copy link
Member

Disable priority and fairness by default because the metric APIs are not meant to be interacted with directly but rather by going through the kube-apiserver where the P&F config should reside. In the eventually that some users ever need to enable P&F at the metric server level, they will still be able to do it via the --enable-priority-and-fairness flag.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 25, 2024
@dgrisonnet
Copy link
Member Author

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If custom-metrics-apiserver contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet

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 25, 2024
@CatherineF-dev
Copy link
Contributor

CatherineF-dev commented Apr 25, 2024

/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 25, 2024
@CatherineF-dev
Copy link
Contributor

CatherineF-dev commented Apr 25, 2024

/hold

Feel free to unhold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 25, 2024
@CatherineF-dev
Copy link
Contributor

I tested locally and unit tests passed.

@dgrisonnet
Copy link
Member Author

Thanks for the review @CatherineF-dev :)

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 1a855fe into kubernetes-sigs:master Apr 25, 2024
5 checks passed
@CatherineF-dev
Copy link
Contributor

CatherineF-dev commented Apr 25, 2024

I did an E2E test and found this error. Not sure whether we should do code-gen in custom-metrics-apiserver or not.

F0425 18:59:25.634052       1 openapi.go:43] Failed to build open api spec for root: cannot find model definition for k8s.io/metrics/pkg/apis/custom_metrics/v1beta1.MetricValueList. If you added a new type, you may need to add +k8s:openapi-gen=true to the package or type and run code-gen again

https://github.com/kubernetes/apiserver/blob/master/pkg/server/routes/openapi.go#L43

@dgrisonnet
Copy link
Member Author

@CatherineF-dev was that after this specific commit? Or when you tried updating your deps from the old version to the latest? Because it sounds unrelated to that change.

From the look of it, it could be that you are just building the OpenAPI v3 spec instead of building both v2 and v3.

@dgrisonnet
Copy link
Member Author

@CatherineF-dev
Copy link
Contributor

was that after this specific commit? Or when you tried updating your deps from the old version to the latest? Because it sounds unrelated to that change.

Yes, I tried updating deps from the old version to the latest for https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter.

From the look of it, it could be that you are just building the OpenAPI v3 spec instead of building both v2 and v3.

Thanks for it!

@CatherineF-dev
Copy link
Contributor

prometheus-adapter is still using sigs.k8s.io/custom-metrics-apiserver v1.27.0.

https://github.com/kubernetes-sigs/prometheus-adapter/blob/master/go.mod#L23

Will upgrade dependencies to sigs.k8s.io/custom-metrics-apiserver v1.27.0 first to see whether the issue is related to custom-metrics-apiserver or not.

@dgrisonnet
Copy link
Member Author

I have a bump of prometheus adapter to 1.29.4 locally on which I ran e2e tests and it worked fine.

Is the stackdriver-adapter importing prometheus-adapter ?

@CatherineF-dev
Copy link
Contributor

E2E test passed in prometheus-adapter kubernetes-sigs/prometheus-adapter#655 after upgrading custom-metrics-apiserver to latest.

Is the stackdriver-adapter importing prometheus-adapter ?

No, stackdriver-adapter depends on custom-metrics-apiserver.

This error F0425 18:59:25.634052 1 openapi.go:43] Failed to build open api spec for root: cannot find model definition for k8s.io/metrics/pkg/apis/custom_metrics/v1beta1.MetricValueList. If you added a new type, you may need to add +k8s:openapi-gen=true to the package or type and run code-gen again is not related to custom-metrics-apiserver.

@JorTurFer
Copy link
Contributor

JorTurFer commented Apr 26, 2024

Time to suggest KEDA as replacement for those adapters? 😉
I'm just kidding, xD I'm going to bump the dep in KEDA too and check if it works. We just use external metrics so maybe the error doesn't happen but as we rely on the default implementation for custom metrics, I guess that all the internal stuff will be compiled too in any case

EDIT: It has worked like a charm and we are already using it

@CatherineF-dev
Copy link
Contributor

Time to suggest KEDA as replacement for those adapters? 😉

KEDA is an awesome project. I find KEDA provides more functionalities than an adapter. Does KEDA support deploying an adapter only? @JorTurFer

@JorTurFer
Copy link
Contributor

JorTurFer commented May 3, 2024

I was kidding when I suggested KEDA 🤣

KEDA is an awesome project. I find KEDA provides more functionalities than an adapter. Does KEDA support deploying an adapter only? @JorTurFer

Do you mean just as the metrics proxy without ScaledObjects and other stuff? No sorry, currently KEDA only supports deploying operator + metrics server, and the scaling configuration has to be provided via CRD (ScaledObject).
This also helps with not requiring complex configurations on adapter side but using more friendly configurations close to workloads (ScaledObjects or ScaledJobs). KEDA just does all the hard work generating the HPA and configuring all the things for the autoscaling :)
The metrics server is just a proxy for Kubernetes, and the admission webhook is an optional component for validating misconfigurations.

Our problem is that the current HPA capabilities are quite limited, despite it's on track with things like scaling to zero supports, currently it's behind a feature gate, so actually it is not supported for almost all the users.

@JorTurFer
Copy link
Contributor

But you can just ping me by slack if you want and I can answer all your questions (or at least I'll do my best answering them xD). I'm Jorge Turrado in Kubernetes and CNCF workspaces

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants