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.03k stars 345 forks source link

[Bug]: Jaeger operator ignores --es.num-replicas=0 #2321

Open ankitcharolia opened 1 year ago

ankitcharolia commented 1 year ago

I have externally setup single node elasticsearch using eck-stack operator and am trying to ingrate jaeger with elasticsearch storage. I see that jaeger-span-* and jaeger-service-* indices are created with default replica count of 1. That means --es.num-replicas: 0 is being ignored.

I believe that this is happening due to this line: https://github.com/jaegertracing/jaeger-operator/blob/main/pkg/storage/elasticsearch.go#L263

Steps to reproduce

Jager instance yaml file

apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
  name: jaeger-simple
spec:
  strategy: production
  collector:
    replicas: 3
    resources:
      requests:
        cpu: 100m
        memory: 128Mi
  storage:
    type: elasticsearch
    elasticsearch:
      nodeCount: 1
      redundancyPolicy: ZeroRedundancy
    options:
      es:
        server-urls: "https://elasticsearch-es-http:9200"
        version: 7                                      # Necessary as it doesn't work with 8 yet
        create-index-templates: false       # Necessary as it doesn't work with 8 yet
        tls:
          ca: /es/certificates/ca.crt
        num-shards: 1
        num-replicas: 0                     
    secretName: jaeger-elasticsearch-secret
  volumeMounts:
    - name: certificates
      mountPath: /es/certificates/
      readOnly: true
  volumes:
    - name: certificates
      secret:
        secretName: elasticsearch-es-http-certs-public

Expected behavior

es.num-replicas=0 should be respected.

Relevant log output

No response

Screenshot

Screenshot from 2023-09-10 13-15-54

Additional context

No response

Jaeger backend version

1.46.0

SDK

No response

Pipeline

No response

Stogage backend

Elasticsearch

Operating system

Linux

Deployment model

Kubernetes

Deployment configs

No response

iblancasa commented 1 year ago

Actually, it should be along these lines: https://github.com/jaegertracing/jaeger-operator/blob/main/pkg/storage/elasticsearch.go#L73C1-L76C3

The num-replicas argument is not found and a default value is assigned.

ankitcharolia commented 1 year ago

@iblancasa I have defined num-replicas: 0 in my Jaeger manifest file, but it still takes the default value.

iblancasa commented 1 year ago

@iblancasa I have defined num-replicas: 0 in my Jaeger manifest file, but it still takes the default value.

Yes. I can see it in the configuration you provided. I'm just describing what the code is doing. Somebody will have to check deeper and see why that is happening.