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

namespacedNameError on Proxy when attempting to submit a cURL call to it #1041

Closed
Varun-Mehrotra opened this issue May 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Varun-Mehrotra
Copy link

Varun-Mehrotra commented May 27, 2024

Report

The Keda http proxy is unable to find hosts and returns NamespacedName is nil error

Expected Behavior

When the proxy is hit with an appropriate host it should be able to serve traffic without an error

Actual Behavior

When I portforward the http-add-on proxy and hit it with a cURL call, it returns Not Found and the following can be seen on the keda-add-ons-http-interceptor-proxy logs:

RROR    LoggingMiddleware.RoutingMiddleware.StaticHandler    Not Found    {"routingKey": "//myhost.com/", "namespacedNameError": "PANIC=value method k8s.io/apimachinery/pkg/types.NamespacedName.MarshalLog called using nil *NamespacedName pointer", "stream": "<nil>"}
github.com/kedacore/http-add-on/interceptor/handler.(*Static).ServeHTTP
    github.com/kedacore/http-add-on/interceptor/handler/static.go:36
github.com/kedacore/http-add-on/interceptor/middleware.(*Routing).ServeHTTP
    github.com/kedacore/http-add-on/interceptor/middleware/routing.go:49
github.com/kedacore/http-add-on/interceptor/middleware.(*Logging).ServeHTTP
    github.com/kedacore/http-add-on/interceptor/middleware/logging.go:42
github.com/kedacore/http-add-on/interceptor/middleware.(*Metrics).ServeHTTP
    github.com/kedacore/http-add-on/interceptor/middleware/metrics.go:24
net/http.serverHandler.ServeHTTP
    net/http/server.go:3137
net/http.(*conn).serve
    net/http/server.go:2039

Steps to Reproduce the Problem

  1. Attempt to deploy the example helm chart
  2. Port forward the proxy to 8080:8080 as the walkthrough suggests with kubectl port-forward svc/keda-add-ons-http-interceptor-proxy -n keda 8080:8080
  3. Run the following cURL call: curl -H "Host:myhost.com" 127.0.0.1:8080

Logs from KEDA HTTP operator

N/A, no relevant HTTP operator logs

HTTP Add-on Version

0.8.0

Kubernetes Version

1.28

Platform

Amazon Web Services

Anything else?

Keda is installed in the keda namespace along with the http-add-on:
image

@Varun-Mehrotra Varun-Mehrotra added the bug Something isn't working label May 27, 2024
@Varun-Mehrotra
Copy link
Author

Varun-Mehrotra commented May 28, 2024

Nevermind, this wasn't the case. Not sure what the specific issues was here but I've got a good feeling I just made a spelling mistake somewhere and when I re-applied things they fixed themselves. Regardless I spent some time going down a rabbit hole. Couple of learnings for anybody who might stumble on this:

  1. DNS may have trouble resolving for the externalName service, always try out the FQDN (i.e. keda-add-ons-http-interceptor-proxy.keda.svc.cluster.local) before trying much else.
  2. You may have to define ports in the externalName service as well:
apiVersion: v1
kind: Service
metadata:
  name: my-proxy
spec:
  type: ExternalName
  externalName: keda-add-ons-http-interceptor-proxy.keda.svc.cluster.local
  ports:
  - port: 80
    targetPort: 8080
  1. The ALB Ingress Controller does not play nice with the externalName service as of now either, but there is an open PR as of writing this. To get around it, I unfortunately just have to run keda and the http add on in each of my namespaces.

@Varun-Mehrotra Varun-Mehrotra closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
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
Status: Done
Development

No branches or pull requests

1 participant