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

[Bug]: Ingress jaeger-query should use the default IngressClass if one is not provided #2225

Open Jeansen opened 1 year ago

Jeansen commented 1 year ago

What happened?

When I deploy jaeger the operator also createas an Ingress 'jaeger-query'. Although my kubernes IngressClass is configured as default (there is only one Ingress in my setup) and I also set it to watch for Ingress deployments without an IngressClass, the jaeger Ingress always has an IngressClass of ''.

When I delete the Ingress and recreate it, it has the default IngressClass 'nginx'. But after a while, it is overwritten with '' again. Happens only with jaeger . Other, manually created Ingresses, work just fine!

Steps to reproduce

  1. Prepare a kubernetes Cluster. Mine runs 1.27
  2. Install Ingress, like so:
    helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    helm repo update
    helm upgrade --install  ingress-nginx ingress-nginx/ingress-nginx  --set watchIngressWithoutClass=true --set controller.ingressClassResource.default=true --namespace ingress-nginx --create-namespace
  3. Install Jaeger, follow the documentation at https://www.jaegertracing.io/docs/1.18/operator/. The 'AllInOne' Setup should be fine, though I use the production strategey.
  4. Check the jaeger-query is there. It should have an IngressClass of 'nginx'.
  5. Wait an hour or so....check again. Now it should how an IngressClass of ''.
  6. Save the Ingress to to a yaml file: kubectl get ingress jaeger-query -o yaml > /tmp/ingerss.yaml
  7. Create the Ingress again: kubectl replace -f /tmp/ingress.yaml --force
  8. Repeat Steps 4 and 5

Expected behavior

Ingress jaeger-query should always have a default IngressClass 'nginx'.

Relevant log output

No response

Screenshot

No response

Additional context

No response

Jaeger backend version

v1.44.0

SDK

No response

Pipeline

No response

Stogage backend

Open-Search

Operating system

Linux, Debian 11

Deployment model

Kubernetes

Deployment configs

No response

iblancasa commented 1 year ago

@Jeansen could you provide the CR used to create your Jaeger instance?

If you check how the Jaeger Operator works, it will set the IngressClass only if you provided one to the Jaeger .spec.ingress.ingressclassname: https://github.com/jaegertracing/jaeger-operator/blob/76b16a32ff2c692633ebfc65e29b686e924ea1cf/pkg/ingress/query.go#L54

If you modify the Ingress created by the Jaeger Operator, it will be reconciled and your changes overwritten.

Jeansen commented 1 year ago
PASSWORD=${'$'}(kubectl get -n $ns secret ${clusterName}-admin-password -o=jsonpath="{.data.password}" | base64 --decode)
USERNAME=${'$'}(kubectl get -n $ns secret ${clusterName}-admin-password -o=jsonpath="{.data.username}" | base64 --decode)
kubectl -n $ns create -f https://github.com/jaegertracing/jaeger-operator/releases/download/$version/jaeger-operator.yaml
kubectl -n $ns create secret generic jaeger-secret --from-literal=ES_PASSWORD=${'$'}{PASSWORD} --from-literal=ES_USERNAME=${'$'}USERNAME

cat <<EOF | kubectl apply --force -f -
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
  name: jaeger
  namespace: $ns
spec:
  collector:
    autoscale: false
  strategy: production
  agent:
    strategy: DaemonSet
  storage:
    type: elasticsearch
    options:
      log-level: debug
      query:
        base-path: /jaeger
      es:
        server-urls: https://${clusterName}.${ns}:9200
        tls:
          ca: /es/certificates/ca.crt
    secretName: jaeger-secret
  volumeMounts:
    - name: certificates
      mountPath: /es/certificates/
      readOnly: true
  volumes:
    - name: certificates
      secret:
        secretName: ${clusterName}-http-cert
Jeansen commented 1 year ago

If you modify the Ingress created by the Jaeger Operator, it will be reconciled and your changes overwritten.

@iblancasa Well, that's exactly the point. I did not specify an IngressClass and therefore expect the cluster default to be used.

iblancasa commented 1 year ago

@Jeansen ok, now I understand. Please, could you modify the title of the issue to Ingress jaeger-query should use the default IngressClass if one is not provided? I can take a look into that and try to send a PR

Jeansen commented 1 year ago

@iblancasa Of course. And thank you for all the help. Looking forward to that PR.

parauliya commented 7 months ago

Hi @iblancasa , Can I pick this issue? Please assign this to me.

parauliya commented 7 months ago

Hi @iblancasa , I am trying to reproduce this issue but I am not able to install the jaeger crds as per the docs of 1.18 version mentioned in the issue. https://www.jaegertracing.io/docs/1.18/operator/

In the above link the following command is being failed: [kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/main/deploy/crds/jaegertracing.io_jaegers_crd.yaml](kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/main/deploy/crds/jaegertracing.io_jaegers_crd.yaml) As the file it is applying does not exist in the above location. Could you please let me know that which version of jaeger-operator I should install to reproduce this issue?

parauliya commented 7 months ago

@iblancasa Also Could you please let me know which tool you use for community wide communication like slack, telegram or Team etc.? And if possible add me there so that in your absents someone else can reply to my query for faster resolution.

iblancasa commented 7 months ago

Hi @iblancasa , I am trying to reproduce this issue but I am not able to install the jaeger crds as per the docs of 1.18 version mentioned in the issue. https://www.jaegertracing.io/docs/1.18/operator/

In the above link the following command is being failed: [kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/main/deploy/crds/jaegertracing.io_jaegers_crd.yaml](kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/main/deploy/crds/jaegertracing.io_jaegers_crd.yaml) As the file it is applying does not exist in the above location. Could you please let me know that which version of jaeger-operator I should install to reproduce this issue?

I didn't reproduce it. Try installing the latest version.

@iblancasa Also Could you please let me know which tool you use for community wide communication like slack, telegram or Team etc.? And if possible add me there so that in your absents someone else can reply to my query for faster resolution.

CNCF Slack channel.

antoniomerlin commented 6 months ago

created a pull request addressing this #2458