Skip to content

Getting "unknown field "targetPendingRequests"" while deploying HTTP Scaled Object #368

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

Closed
Giridhar23689 opened this issue Jan 18, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@Giridhar23689
Copy link

Report

While deploying an HTTP scaled object, I received the below error:

error validating data: ValidationError(HTTPScaledObject.spec.scaleTargetRef): unknown field "targetPendingRequests" in sh.keda.http.v1alpha1.HTTPScaledObject.spec.scaleTargetRef; if you choose to ignore these errors, turn validation off with --validate=false

Expected Behavior

The HTTP scaled object should be deployed,

Actual Behavior

I am getting the below validation error:

error validating data: ValidationError(HTTPScaledObject.spec.scaleTargetRef): unknown field "targetPendingRequests" in sh.keda.http.v1alpha1.HTTPScaledObject.spec.scaleTargetRef; if you choose to ignore these errors, turn validation off with --validate=false

Steps to Reproduce the Problem

  1. Download the attached TXT file.
  2. Change the extension of the file to .yaml
  3. Change directory in terminal to where the downloaded YAML file is.
  4. Run the command "kubectl apply -f .\ms-scaledobject.yaml
    ms-scaledobject.txt

Logs from KEDA HTTP operator

example

What version of the KEDA HTTP Addon are you running?

Chart version: keda-add-ons-http-0.2.1, App version: 0.2.0

Kubernetes Version

1.20

Platform

Microsoft Azure

Anything else?

No response

@Giridhar23689 Giridhar23689 added the bug Something isn't working label Jan 18, 2022
@tpiperatgod
Copy link
Contributor

According to the latest version, this field should be used like this:

kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: httpscaledobject
    namespace: app
spec:
    host: "abc.com"
    targetPendingRequests: 100 # should be here 
    scaleTargetRef:
        deployment: app-deployment
        service: app-service
        port: 443
        # targetPendingRequests: 100 # shouldn't be here

@avinash31d
Copy link

avinash31d commented Jan 19, 2022

+1 facing same issue

kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: {{ include "httptestapi.fullname" . }}
spec:
    host: {{ .Values.host }}
    targetPendingRequests: 10
    scaleTargetRef:
        deployment: {{ include "httptestapi.fullname" . }}
        service: {{ include "httptestapi.fullname" . }}
        port: 8080
    replicas:
        min: {{ .Values.autoscaling.http.minReplicas }}
        max: {{ .Values.autoscaling.http.maxReplicas }}

@dariuszbz
Copy link

@avinash31d - last time I've checked "targetPendingRequests" is not available yet - see an issue I created.
I still can't make http-add-on work (see the 361 issue). I understand it is beta, and @arschles is busy. I guess we just need to wait a bit longer, but I believe it is worth to wait.

@avinash31d
Copy link

@dariuszbz thanks for the response, by the time it gets done, can we do one thing, can we modify the default value and build our own docker image and deploy it?
do you know an easy way to do that?

@avinash31d
Copy link

@dariuszbz Also, I can see here

TargetPendingRequests int `envconfig:"KEDA_HTTP_SCALER_TARGET_PENDING_REQUESTS" default:"100"`

there is an environment variable we can set KEDA_HTTP_SCALER_TARGET_PENDING_REQUESTS

how do you set this through helm deployment?

@arschles
Copy link
Collaborator

@tpiperatgod is correct, the targetPendingRequests field must be directly under the spec, not under the scaleTargetRef. I'll fix this in the reference documentation - my apologies for the incorrect documentation.


@avinash31d regarding your comment here, you may have an old CRD schema installed. can you:

  • delete the HTTP Addon and the CRD definition
  • re-install the HTTP Addon chart
  • try installing an HTTPScaledObject as in @tpiperatgod's comment (along with your app)

and let me know if it works?


last time I've checked "targetPendingRequests" is not available yet

@avinash31d it should be available in v0.2.0. the definitive source is in the go code in v0.2.0. I'll comment on your issue as well.


I understand it is beta, and @arschles is busy. I guess we just need to wait a bit longer, but I believe it is worth to wait.

Thank you for your understanding and words of encouragement. Right now the project is mostly just me, but one more developer is starting to do work on it (in fact, he just merged his first PR)


there is an environment variable we can set KEDA_HTTP_SCALER_TARGET_PENDING_REQUESTS
how do you set this through helm deployment?

in your helm install or helm upgrade command: --set scaler.targetRequestsInterceptor=<your value>. In the helm chart, it defaults to 200. There's a bit more configuration on the configuration README for the helm chart if that helps.

You'll need chart version 0.2.0 or 0.2.1 for this to work.

This value will apply to all HTTPScaledObjects that do not set the targetPendingRequests value, but it will be overridden for ones that do.

@avinash31d
Copy link

avinash31d commented Jan 21, 2022

@arschles
Seems like targetPendingRequests property is missing int crd.yaml of the latest chart versions 0.2.0 or 0.2.1

I updated it and created a new PR #231, please review it and merge if useful.

(This is my first PR in any opensource project, please let me know if I missed something, I will fix it)

I followed the guidelines here [https://github.com/kedacore/charts/blob/main/CONTRIBUTING.md](contributing to charts)

@benjaminhuo
Copy link

@arschles hi Aaron, may I know when will v0.3.0 be released? :)
We're interested in this project and we'll see what we can help. @tpiperatgod @wanjunlei

@arschles
Copy link
Collaborator

@avinash31d I saw #231 - thanks for submitting that, and good catch! We'll merge it as soon as we can.

@benjaminhuo we're planning on two releases. First, a v0.2.2 of the charts will be early next week for the bugfix (we don't need to do a release in this repo for that). We're also planning for v0.3.0 of the HTTP Addon (this repo) by the end of next week as well. I'd do it today, but I don't want to release on a Friday and then start the weekend :)

Also, I'm happy to hear that you're interested in this project. I know that @tpiperatgod has contributed in the past, and we're happy to have any or all of you contribute where you'd like.

@avinash31d
Copy link

avinash31d commented Jan 22, 2022

@arschles even I could have contributed but my bad luck I am not a go developer.

The issue can be closed now.

@benjaminhuo
Copy link

@avinash31d I saw #231 - thanks for submitting that, and good catch! We'll merge it as soon as we can.

@benjaminhuo we're planning on two releases. First, a v0.2.2 of the charts will be early next week for the bugfix (we don't need to do a release in this repo for that). We're also planning for v0.3.0 of the HTTP Addon (this repo) by the end of next week as well. I'd do it today, but I don't want to release on a Friday and then start the weekend :)

Also, I'm happy to hear that you're interested in this project. I know that @tpiperatgod has contributed in the past, and we're happy to have any or all of you contribute where you'd like.

@arschles Looking forward to the v0.3.0 release :), seems that v0.3.0 is more stable and powerful with the global mode added. Is there any plan or roadmap for post v0.3.0 development?

Regards,
Benjamin

@arschles
Copy link
Collaborator

@benjaminhuo v0.3.0 is now released 🎉

as for the roadmap for what's next, we have plans for the next two minor releases - v0.4.0 and v0.5.0 - at the milestones page. v0.4.0 is next. it is mostly a release to improve test coverage, RPC between components, and other "internal" things like that.

is there something that you have a particular interest in seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants