Search code examples
kubernetesapache-kafkajaeger

Jaeger Streaming Strategy: How to configure Kafka credentials in CRD


I'm trying to install Jaeger into my K8s cluster using the streaming strategy. I need to use the existing Kafka cluster from my cloud provider. It requires a username and password. Jaeger documentation mentions only broker and topic:

 spec:
     strategy: streaming
  collector:
    options:
      kafka: # <1>
        producer:
          topic: jaeger-spans
          brokers: my-cluster-kafka-brokers.kafka:9092 

How can I configure Kafka credentials in CRD?

-Thanks in advance!


Solution

  • Based on following example from jaeger docs:

    apiVersion: jaegertracing.io/v1
    kind: Jaeger
    metadata:
      name: simple-streaming
    spec:
      strategy: streaming
      collector:
        options:
          kafka: # <1>
            producer:
              topic: jaeger-spans
              brokers: my-cluster-kafka-brokers.kafka:9092
      ingester:
        options:
          kafka: # <1>
            consumer:
              topic: jaeger-spans
              brokers: my-cluster-kafka-brokers.kafka:9092
          ingester:
            deadlockInterval: 5s # <2>
      storage:
        type: elasticsearch
        options:
          es:
            server-urls: http://elasticsearch:9200
    

    and on example cli falgs:

    --kafka.producer.topic  jaeger-spans
    The name of the kafka topic
    --kafka.producer.brokers    127.0.0.1:9092
    The comma-separated list of kafka brokers. i.e. '127.0.0.1:9092,0.0.0:1234'
    --kafka.producer.plaintext.password 
    The plaintext Password for SASL/PLAIN authentication
    --kafka.producer.plaintext.username 
    The plaintext Username for SASL/PLAIN authentication
    

    I infere that you should be able to do the following:

    spec:
         strategy: streaming
      collector:
        options:
          kafka: # <1>
            producer:
              topic: jaeger-spans
              brokers: my-cluster-kafka-brokers.kafka:9092
              plaintext:
                username: <username>
                password: <password> 
    

    Notice that I split the cli options with the dot and added it as a nested fields in yaml. Do the same to other parameters by analogy.