Jaeger auto injecting into pods?

Hello,

I did:
microk8s.enable jaeger

And Jaeger UI is up.

Then added the inject tag to a Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hue
  labels:
    deployment: hue
  annotations:
    "sidecar.jaegertracing.io/inject": "true"

But I don’t see a 2/2 containers for the Deployments, while Jaeger should auto-inject a container if I understand correctly:

kubectl get pods
NAME                               READY   STATUS    RESTARTS   AGE
hue-66b5747bcf-48d7x               1/1     Running   0          113s
hue-66b5747bcf-6rrp4               1/1     Running   0          113s
jaeger-operator-79ddf78c85-llkbt   1/1     Running   0          94m
postgres-xx-c7lkh                 1/1     Running   0          113s
simplest-77d6c9b79-5z4zj           1/1     Running   0          94m

Am I missing something? Thanks!

Hi @Romain_Rigaux, I think I found the issue. Give it a try and see if it works.

"sidecar.jaegertracing.io/inject": "true" # <1>

https://www.jaegertracing.io/docs/1.14/operator/#auto-injecting-jaeger-agent-sidecars

Thank you, just what is different in the YAML in the first post?

I also can see:

kubectl logs jaeger-operator-79ddf78c85-llkbt 
time="2019-09-27T19:59:31Z" level=info msg=Go arch=amd64 os=linux version=go1.11.1
time="2019-09-27T19:59:31Z" level=info msg=operator-sdk version=v0.1.1
time="2019-09-27T19:59:31Z" level=info msg="Registering Components."
time="2019-09-27T19:59:31Z" level=info msg="Starting the Cmd."
time="2019-09-27T19:59:31Z" level=info msg="Reconciling Deployment" name=jaeger-operator namespace=default
time="2019-09-27T19:59:31Z" level=info msg="Reconciling Deployment" name=simplest namespace=default
time="2019-09-27T19:59:31Z" level=info msg="Reconciling Jaeger" name=simplest namespace=default
time="2019-09-27T19:59:31Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T19:59:35Z" level=info msg="Reconciling Deployment" name=simplest namespace=default
time="2019-09-27T19:59:35Z" level=info msg="Reconciling Deployment" name=simplest namespace=default
time="2019-09-27T19:59:40Z" level=info msg="Reconciling Deployment" name=simplest namespace=default
time="2019-09-27T19:59:59Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:00:45Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:00:45Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:00:45Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:00:45Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:01:01Z" level=info msg="Reconciling Deployment" name=hue namespace=default
time="2019-09-27T20:01:03Z" level=info msg="Reconciling Deployment" name=hue namespace=default

Similarly, same issue why trying with a local client below (it works when using the same client and https://www.jaegertracing.io/docs/1.14/getting-started/ though)

kubectl get svc simplest-agent

NAME             TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                               AGE
simplest-agent   ClusterIP   None         <none>        5775/TCP,5778/TCP,6831/TCP,6832/TCP   107m

kubectl port-forward svc/simplest-agent --address localhost 5775 5778 6831 6832

Forwarding from 127.0.0.1:5775 -> 5775
Forwarding from [::1]:5775 -> 5775
Forwarding from 127.0.0.1:5778 -> 5778
Forwarding from [::1]:5778 -> 5778
Forwarding from 127.0.0.1:6831 -> 6831
Forwarding from [::1]:6831 -> 6831
Forwarding from 127.0.0.1:6832 -> 6832
Forwarding from [::1]:6832 -> 6832

Python client:

import logging
from jaeger_client import Config


def init_tracer(service):
    logging.getLogger('').handlers = []
    logging.basicConfig(format='%(message)s', level=logging.DEBUG)

    config = Config(
        config={
            'sampler': {
                'type': 'const',
                'param': 1,
            },
            'logging': True,
            # 'local_agent': {
            #     'reporting_host': '127.0.0.1',
            #     'reporting_port': 9999,
            # },
        },
        service_name=service,
        validate=True,
    )

    # this call also sets opentracing.tracer
    return config.initialize_tracer()

tracer = init_tracer('aa')

from opentracing.ext import tags as ext_tags


def say_hello(hello_to):
    span = tracer.start_span('say-hello')
    span.set_tag(ext_tags.SAMPLING_PRIORITY, 1)

    hello_str = 'Hello, %s!' % hello_to
    print(hello_str)
    span.finish()

say_hello('query!')

import time
# yield to IOLoop to flush the spans
time.sleep(2)
tracer.close()

Maybe because the k8s ports of the service with microk8s are wrong: TCP and not UDP

When using the official jaeger operator https://www.jaegertracing.io/docs/1.14/operator/#installing-the-operator-on-kubernetes:

simplest-agent                ClusterIP   None             <none>        5775/UDP,5778/TCP,6831/UDP,6832/UDP      13s
simplest-collector            ClusterIP   10.152.183.115   <none>        9411/TCP,14250/TCP,14267/TCP,14268/TCP   13s
simplest-collector-headless   ClusterIP   None             <none>        9411/TCP,14250/TCP,14267/TCP,14268/TCP   13s
simplest-query                ClusterIP   10.152.183.123   <none>        16686/TCP                                13s

For the record, it works with the upstream jaeger kubernetes yaml, maybe there is an issue with the one in microk8s. Created https://github.com/ubuntu/microk8s/issues/698 to track