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

Ignoring requests #282

Open
arschles opened this issue Oct 1, 2021 · 3 comments
Open

Ignoring requests #282

arschles opened this issue Oct 1, 2021 · 3 comments
Labels
enhancement New feature or request feature good first issue Good for newcomers

Comments

@arschles
Copy link
Collaborator

arschles commented Oct 1, 2021

I'd like to be able to configure the interceptor to prevent specific incoming requests from triggering a scaling event. Examples of these types of requests would be health checks or requests for metrics.

Use-Case

My interceptor fleet is fronted by a load balancer that makes periodic health check requests to the /healthz path. In this situation, I want these requests to check if the interceptors are healthy, not necessarily the backend application. Therefore, the backend application should not scale.

Specification

There should be optional configuration to instruct the interceptor to ignore certain classes of requests. I believe this should be a different CRD, as ignore configuration should be orthogonal to scaling configuration. Such a CRD might look similar to the below:

kind: HTTPIgnoreRule
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: healthz-path
spec:
    paths:
        - /healthz*

This rule would ignore all paths that match the pattern (perhaps one that matches the one defined in filepath.Match) across all requests. Importantly, this ignore rule would match all requests across all hosts. The CRD should support specification of hosts or host patterns via a spec.hosts field so that HTTPIgnoreRules have a many-to-many relationship to HTTPScaledObjects.

There should also be a spec.headers field that contains matching rules for incoming request headers:

kind: HTTPIgnoreRule
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: custom-value-header
spec:
    headers:
        - X-Custom-Value: abc*xyz

This rule would match all incoming requests that have an X-Custom-Value header that starts with abc and ends with xyz.

If both of these rules were submitted to the cluster at once, only requests that match the union of these two rules would be ignored. In other words, for any given host, all applicable rules are ANDed together to match against requests.

@arschles arschles added the enhancement New feature or request label Oct 1, 2021
@arschles arschles added this to the v0.3.0 milestone Oct 1, 2021
@vitarkah
Copy link

vitarkah commented Oct 2, 2021

Looks good; one question - How would HTTPIgnoreRule be tied back to the relevant HTTPScaledObject?

@arschles
Copy link
Collaborator Author

arschles commented Oct 4, 2021

@vitarkah it may not tie back to just one specific HTTPScaledObject but the intersection point between the two is the Host. If there were an HTTPScaledObject issued for host: mysite.com and an HTTPIgnoreRule issued similar to this:

kind: HTTPIgnoreRule
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: healthz-path
spec:
    hosts:
        - *site.com

Then the ignore would apply to that HTTPScaledObject and others ending in site.com (like host: myothersite.com)

@vitarkah
Copy link

vitarkah commented Nov 1, 2021

Perfect! Thanks and look forward to this feature.

@arschles arschles modified the milestones: v0.3.0, v0.2.1 Nov 16, 2021
@arschles arschles added the good first issue Good for newcomers label Nov 16, 2021
@arschles arschles modified the milestones: v0.3.0, v0.5.0 Jan 27, 2022
@tomkerkhove tomkerkhove removed this from the v0.5.0 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature good first issue Good for newcomers
Projects
Status: To Do
Development

No branches or pull requests

3 participants