jaegertracing / jaeger-operator

Jaeger Operator for Kubernetes simplifies deploying and running Jaeger on Kubernetes.
https://www.jaegertracing.io/docs/latest/operator/
Apache License 2.0
1.01k stars 342 forks source link

[Feature]: context root support for ingress #2240

Open stanworld opened 1 year ago

stanworld commented 1 year ago

Requirement

We have a domain name used for our applications in a cluster (mydomain.com), and would like to add jaeger support at mydomain.com/jaeger

Problem

When I try to create a ingress backed up jaeger-query service like:

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-jaeger spec: ingressClassName: nginx rules:

Refused to apply style from 'http://mydomain.com:9080/static/index-c3b54a40.css' because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled. jaeger:41 GET http://mydomain.com:9080/static/index-5a1abd6a.js net::ERR_ABORTED 401 (Unauthorized)

Proposal

No response

Open questions

No response

stanworld commented 1 year ago

This is like a follow up for the host support at issue:

https://github.com/jaegertracing/jaeger-operator/issues/135

iblancasa commented 1 year ago

Thanks for creating the issue. Would you like to send a PR? @stanworld

stanworld commented 1 year ago

@iblancasa , I love to help but frankly I am quite new to this, and not sure where to get started. If someone can give some suggestions, I'd give a try.

iblancasa commented 1 year ago

@stanworld awesome!

  1. You will need to check what is missing in the Ingress object created by the operator
  2. Check pkg/ingress/query.go to see how Ingress objects are created
  3. Add an option to Jaeger.Spec.Query.Options similar to query.base-path for your missing fields. Or maybe, it can be a new field in Jaeger.Spec.Ingress.Options`.
  4. Add the missing stuff to the creation of the Ingress object
  5. Add an unit test
  6. Send your PR!
stanworld commented 1 year ago

I think the issue is not within the ingress creation piece but how jaeger operator handles an ingress with a path. The template posted in the problem will actually create an ingress like mydomain.com/jaeger, but it seems js/css doesn't know how to handle it.

iblancasa commented 1 year ago

@stanworld Is it a behavior you can reproduce without the operator? Because, in that case, it would make more sense to open an issue in the Jaeger repo