<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="nofollow 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="nofollow 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="nofollow 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="nofollow 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>

bgarcial
<p>When you are accessing the service from the pod in the <strong>same namespace</strong> you can use just the service name. 
Example:</p>

<pre><code>http://elasticsearch:9200
</code></pre>

<p>If you are accessing the service from the pod in the <strong>different namespace</strong> you should also specify the namespace.
Example: </p>

<pre><code>http://elasticsearch.mynamespace:9200
http://elasticsearch.mynamespace.svc.cluster.local:9200
</code></pre>

<p>To check in what namespace the service is located, use the following command:</p>

<pre><code>kubectl get svc --all-namespaces -o wide
</code></pre>

<p><strong>Note</strong>: Changing ConfigMap does not apply it to deployment instantly. Usually, you need to restart all pods in the deployment to apply new ConfigMap values. There is no rolling-restart functionality at the moment, but you can use the following command as a workaround:<br>
<em>(replace deployment name and pod name with the real ones)</em></p>

<pre><code>kubectl patch deployment mydeployment -p '{"spec":{"template":{"spec":{"containers":[{"name":"my-pod-name","env":[{"name":"START_TIME","value":"'$(date +%s)'"}]}]}}}}'
</code></pre>
