Answers: <p>When resolving a service in Kubernetes,</p>
  
  <blockquote>
    <p>Assume a Service named foo in the Kubernetes namespace bar. A Pod running in namespace bar can look up this service by simply doing a DNS query for foo. A Pod running in namespace quux can look up this service by doing a DNS query for foo.bar.</p>
  </blockquote>
  
  <p>Since Jaeger is in the same namespace, then yes, it can resolve the Elasticsearch endpoint with just <code>elasticsearch</code>. Your configuration is correct in that respect and requires no changes.</p>
  
  <p>If Jaeger were located in another namespace, you could specify the full DNS record <code>elasticsearch.default.svc.cluster.local</code>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-01-10T05:37:14.487Z
Answers: 2019-01-10T05:37:14.487Z
Answers: user2640621
Body: <p>I have a kubernetes cluster on google cloud platform, and on it, I have a jaeger deployment via development setup of <a href="https://github.com/jaegertracing/jaeger-kubernetes#development-setup" rel="noreferrer">jaeger-kubernetes templates</a> 
  because my purpose is setup <code>elasticsearch</code> like backend storage, due to this, I follow the jaeger-kubernetes github documentation with the following actions</p>
  
  <ul>
  <li>I've created the services via <a href="https://github.com/jaegertracing/jaeger-kubernetes#production-setup" rel="noreferrer">production setup</a> options</li>
  </ul>
  
  <p>Here are configured the URLs to access to <code>elasticsearch</code> server and username and password and ports</p>
  
  <pre><code>kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/production-elasticsearch/configmap.yml
  </code></pre>
  
  <p>And here, there are configured the download of docker images of the elasticsearch service and their volume mounts. </p>
  
  <pre><code>kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/production-elasticsearch/elasticsearch.yml
  </code></pre>
  
  <p>And then, at this moment we have a elasticsearch service running over 9200 and 9300 ports</p>
  
  <pre><code> kubectl get service elasticsearch                                                                                                                                [a89fbe2]
  NAME            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE
  elasticsearch   ClusterIP   None         &lt;none&gt;        9200/TCP,9300/TCP   1h
  </code></pre>
  
  <ul>
  <li>I've follow with the creation of jaeger components using the <code>kubernetes-jaeger</code> <a href="https://github.com/jaegertracing/jaeger-kubernetes#jaeger-components" rel="noreferrer">production templates</a> of this way:</li>
  </ul>
  
  <hr>
  
  <pre><code>λ bgarcial [~] → kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/jaeger-production-template.yml        
  deployment.extensions/jaeger-collector created
  service/jaeger-collector created
  service/zipkin created
  deployment.extensions/jaeger-query created
  service/jaeger-query created
  daemonset.extensions/jaeger-agent created
  
  λ bgarcial [~/workspace/jaeger-elastic] at  master ?
  </code></pre>
  
  <p>According to the <a href="https://eng.uber.com/wp-content/uploads/2017/02/Distributed_Tracing_Header.png" rel="noreferrer">Jaeger architecture</a>, the <code>jaeger-collector</code> and <code>jaeger-query</code> services require access to backend storage. </p>
  
  <p>And so, these are my services running on my kubernetes cluster:</p>
  
  <pre><code>λ bgarcial [~/workspace/jaeger-elastic] at  master ?
  → kubectl get services                                                                                  [baefdf9]
  NAME               TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                        AGE
  elasticsearch      ClusterIP      None            &lt;none&gt;           9200/TCP,9300/TCP              3h
  jaeger-collector   ClusterIP      10.55.253.240   &lt;none&gt;           14267/TCP,14268/TCP,9411/TCP   3h
  jaeger-query       LoadBalancer   10.55.248.243   35.228.179.167   80:30398/TCP                   3h
  kubernetes         ClusterIP      10.55.240.1     &lt;none&gt;           443/TCP                        3h
  zipkin             ClusterIP      10.55.240.60    &lt;none&gt;           9411/TCP                       3h
  
  λ bgarcial [~/workspace/jaeger-elastic] at  master ?
  </code></pre>
  
  <ul>
  <li>I going to <code>configmap.yml</code> elastic search file  <code>kubectl edit configmap jaeger-configuration</code> command in order to try to edit it in relation to the elasticsearch URLs endpoints (may be? ... At this moment I am supossing that this is the next step ...)</li>
  </ul>
  
  <p>I execute it:</p>
  
  <pre><code>λ bgarcial [~] → kubectl edit configmap jaeger-configuration 
  </code></pre>
  
  <p>And I get the following edit entry:</p>
  
  <pre><code> apiVersion: v1
  data:
    agent: |
      collector:
        host-port: "jaeger-collector:14267"
    collector: |
      es:
        server-urls: http://elasticsearch:9200
        username: elastic
        password: changeme
      collector:
        zipkin:
          http-port: 9411
    query: |
      es:
        server-urls: http://elasticsearch:9200
        username: elastic
        password: changeme
    span-storage-type: elasticsearch
  kind: ConfigMap
  metadata:
    creationTimestamp: "2018-12-27T13:24:11Z"
    labels:
      app: jaeger
      jaeger-infra: configuration
    name: jaeger-configuration
    namespace: default
    resourceVersion: "1387"
    selfLink: /api/v1/namespaces/default/configmaps/jaeger-configuration
    uid: b28eb5f4-09da-11e9-9f1e-42010aa60002
  </code></pre>
  
  <p>Here ... do I need setup our own URLs to collector and query services, which will be connect wiht elasticsearch backend service?</p>
  
  <p>How to can I setup the elasticsearch IP address or URLs here?</p>
  
  <p>In the jaeger components, the query and collector need access to storage, but I don't know what is the elastic endpoint ... </p>
  
  <p>Is this <code>server-urls: http://elasticsearch:9200</code> a correct endpoint?</p>
  
  <p>I am starting in the kubernetes and DevOps world, and I appreciate if someone can help me in the concepts and point me in the right address in order to setup jaeger and elasticsearch as a backend storage.</p>
  
Tags: <kubernetes><elastic><storage>
Title: Connecting jaeger with elasticsearch backend storage on kubernetes cluster
UserDisplayName: bgarcial
ThreadText: # Connecting jaeger with elasticsearch backend storage on kubernetes cluster
  
  (Asked by: username_0 on 2018-12-24)
  
  I have a kubernetes cluster on google cloud platform, and on it, I have a jaeger deployment via development setup of [jaeger-kubernetes templates](https://github.com/jaegertracing/jaeger-kubernetes#development-setup)
  because my purpose is setup `elasticsearch` like backend storage, due to this, I follow the jaeger-kubernetes github documentation with the following actions
  
  * I've created the services via [production setup](https://github.com/jaegertracing/jaeger-kubernetes#production-setup) options
  
  Here are configured the URLs to access to `elasticsearch` server and username and password and ports
  
  ```
  kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/production-elasticsearch/configmap.yml
  
  ```
  
  And here, there are configured the download of docker images of the elasticsearch service and their volume mounts.
  
  ```
  kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/production-elasticsearch/elasticsearch.yml
  
  ```
  
  And then, at this moment we have a elasticsearch service running over 9200 and 9300 ports
  
  ```
   kubectl get service elasticsearch                                                                                                                                [a89fbe2]
  NAME            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE
  elasticsearch   ClusterIP   None         <none>        9200/TCP,9300/TCP   1h
  
  ```
  
  * I've follow with the creation of jaeger components using the `kubernetes-jaeger` [production templates](https://github.com/jaegertracing/jaeger-kubernetes#jaeger-components) of this way:
  
  ---
  
  ```
  λ username_0 [~] → kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/jaeger-production-template.yml        
  deployment.extensions/jaeger-collector created
  service/jaeger-collector created
  service/zipkin created
  deployment.extensions/jaeger-query created
  service/jaeger-query created
  daemonset.extensions/jaeger-agent created
  
  λ username_0 [~/workspace/jaeger-elastic] at  master ?
  
  ```
  
  According to the [Jaeger architecture](https://eng.uber.com/wp-content/uploads/2017/02/Distributed_Tracing_Header.png), the `jaeger-collector` and `jaeger-query` services require access to backend storage.
  
  And so, these are my services running on my kubernetes cluster:
  
  ```
  λ username_0 [~/workspace/jaeger-elastic] at  master ?
  → kubectl get services                                                                                  [baefdf9]
  NAME               TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                        AGE
  elasticsearch      ClusterIP      None            <none>           9200/TCP,9300/TCP              3h
  jaeger-collector   ClusterIP      10.55.253.240   <none>           14267/TCP,14268/TCP,9411/TCP   3h
  jaeger-query       LoadBalancer   10.55.248.243   35.228.179.167   80:30398/TCP                   3h
  kubernetes         ClusterIP      10.55.240.1     <none>           443/TCP                        3h
  zipkin             ClusterIP      10.55.240.60    <none>           9411/TCP                       3h
  
  λ username_0 [~/workspace/jaeger-elastic] at  master ?
  
  ```
  
  * I going to `configmap.yml` elastic search file `kubectl edit configmap jaeger-configuration` command in order to try to edit it in relation to the elasticsearch URLs endpoints (may be? ... At this moment I am supossing that this is the next step ...)
  
  I execute it:
  
  ```
  λ username_0 [~] → kubectl edit configmap jaeger-configuration 
  
  ```
  
  And I get the following edit entry:
  
  ```
   apiVersion: v1
  data:
    agent: |
      collector:
        host-port: "jaeger-collector:14267"
    collector: |
      es:
        server-urls: http://elasticsearch:9200
        username: elastic
        password: changeme
      collector:
        zipkin:
          http-port: 9411
    query: |
      es:
        server-urls: http://elasticsearch:9200
        username: elastic
        password: changeme
    span-storage-type: elasticsearch
  kind: ConfigMap
  metadata:
    creationTimestamp: "2018-12-27T13:24:11Z"
    labels:
      app: jaeger
      jaeger-infra: configuration
    name: jaeger-configuration
    namespace: default
    resourceVersion: "1387"
    selfLink: /api/v1/namespaces/default/configmaps/jaeger-configuration
    uid: b28eb5f4-09da-11e9-9f1e-42010aa60002
  
  ```
  
  Here ... do I need setup our own URLs to collector and query services, which will be connect wiht elasticsearch backend service?
  
  How to can I setup the elasticsearch IP address or URLs here?
  
  In the jaeger components, the query and collector need access to storage, but I don't know what is the elastic endpoint ...
  
  Is this `server-urls: http://elasticsearch:9200` a correct endpoint?
  
  I am starting in the kubernetes and DevOps world, and I appreciate if someone can help me in the concepts and point me in the right address in order to setup jaeger and elasticsearch as a backend storage.
  
  **Tags:** kubernetes, elastic, storage
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-10. Score: 1 | Accepted answer
  
  When resolving a service in Kubernetes,
  
  > Assume a Service named foo in the Kubernetes namespace bar. A Pod running in namespace bar can look up this service by simply doing a DNS query for foo. A Pod running in namespace quux can look up this service by doing a DNS query for foo.bar.
  
  Since Jaeger is in the same namespace, then yes, it can resolve the Elasticsearch endpoint with just `elasticsearch`. Your configuration is correct in that respect and requires no changes.
  
  If Jaeger were located in another namespace, you could specify the full DNS record `elasticsearch.default.svc.cluster.local`.
  
  
  ---
  
  