kedacore / http-add-on

Add-on for KEDA to scale HTTP workloads
https://kedacore.github.io/http-add-on/
Apache License 2.0
371 stars 96 forks source link

Issue with Application Gateway Ingress Controller #1096

Open lambertpandian opened 3 months ago

lambertpandian commented 3 months ago

Report

I am trying to migrate the ingress controller from Nginx to Azure Application Gateway. The following is my ingress configuration. I get a 404 Not Found error. Azure Application gateway tries to connect to keda-add-ons-http-interceptor pod for health probe and it is failing, I have attached the screenshot

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    meta.helm.sh/release-name: xkcd
    meta.helm.sh/release-namespace: keda-tester
  creationTimestamp: "2024-07-17T06:55:08Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: xkcd-dev
  namespace: keda
  resourceVersion: "118833"
  uid: 0d93e746-8789-424a-a043-5d90952e9f72
spec:
  ingressClassName: azure-application-gateway
  rules:
  - host: kedatester.mydomain.net
    http:
      paths:
      - backend:
          service:
            name: keda-add-ons-http-interceptor-proxy
            port:
              number: 8080
        path: /
        pathType: Prefix

Azure App gateway health screenshot

image

Expected Behavior

Http Addon needs to work with Azure Application Gateway ingress controller.

Actual Behavior

Http Addon is not working with Azure Application Gateway ingress controller.

Steps to Reproduce the Problem

  1. Install xkcd example with ingressClassName: azure-application-gateway
  2. Connect to the end point

Logs from KEDA HTTP operator

example

HTTP Add-on Version

0.8.0

Kubernetes Version

1.28

Platform

Microsoft Azure

Anything else?

No response

JorTurFer commented 2 months ago

Hello, The problem is that currently we check the user agent to discover if the request is a probe or not and handle it as probe and not as a legit request: https://github.com/kedacore/http-add-on/blob/08c811fe205daaf2bc55c6a46155be2729f21916/interceptor/middleware/routing.go#L85-L89

Does AGIC support adding custom user agent to the probe? if yes, just use kube-probe and it'll pass. If not, we will need to include the AGIC user agent. Do you know which is it? Are you willing to open a PR supporting it?

stale[bot] commented 6 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.