<p>We successfully integrated 'service-locator-dns' in Lagom and deployed in Kubernetes, All services in the Lagom project are properly resolving with Kubernetes SRV requests.</p>

<p>But even statically defined(in build.sbt) non-lagom projects also go through <code>name-translators</code> and <code>srv-translators</code> and finally not resolving.</p>

<p>I have raised the issue for the same in Github <a href="https://github.com/lightbend/service-locator-dns/issues/29" rel="nofollow noreferrer">https://github.com/lightbend/service-locator-dns/issues/29</a></p>

<p>Can we avoid this with changes in name-translators itself or do we need to do any extra changes?</p>

<p>It will be very helpful for us if you please provide support or reference any documentation.</p>

<p>Log in kubernetes</p>

<p>log</p>

<pre><code>Resolving: premium-calculator
Translated premium-calculator to _http-lagom-api._tcp.premium-calculator.staging.svc.cluster.local
Resolving _http-lagom-api._tcp.premium-calculator.staging.svc.cluster.local (SRV)
Message to /10.114.0.10:53: Message(16,&lt;QUERY,RD,SUCCESS&gt;,List(Question(_http-lagom-api._tcp.premium-calculator.staging.svc.cluster.local,SRV,IN)),List(),List(),List())
Received message from /10.114.0.10:53: ByteString(0, 16, -127, -125, 0, 1, 0, 0, 0, 1, 0, 0, 15, 95, 104, 116, 116, 112, 45, 108, 97, 103, 111, 109, 45, 97, 112, 105, 4, 95, 116, 99, 112, 18, 112, 114, 101, 109, 105, 117, 109, 45, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 7, 115, 116, 97, 103, 105, 110, 103, 3, 115, 118, 99, 7, 99, 108, 117, 115, 116, 101, 114, 5, 108, 111, 99, 97, 108, 0, 0, 33, 0, 1, 7, 99, 108, 117, 115, 116, 101, 114, 5, 108, 111, 99, 97, 108, 0, 0, 6)... and [76] more
Decoded: Message(16,&lt;AN,QUERY,RD,RA,NAME_ERROR&gt;,Vector(Question(_http-lagom-api._tcp.premium-calculator.staging.svc.cluster.local,SRV,IN)),Vector(),Vector(UnknownRecord(cluster.local,60,6,1,ByteString(2, 110, 115, 3, 100, 110, 115, 7, 99, 108, 117, 115, 116, 101, 114, 5, 108, 111, 99, 97, 108, 0, 10, 104, 111, 115, 116, 109, 97, 115, 116, 101, 114, 7, 99, 108, 117, 115, 116, 101, 114, 5, 108, 111, 99, 97, 108, 0, 90, -80, -107, 80, 0, 0, 112, -128, 0, 0, 28, 32, 0, 9, 58, -128, 0, 0, 0, 60))),Vector())
Resolved: Vector()
java.lang.IllegalStateException: Service premium-calculator was not found by service locator
</code></pre>

<p>service trait</p>

<pre><code>trait PremiumCalculator extends Service {
  def getPremiums(channelName: String): ServiceCall[JsValue, JsValue]
  override final def descriptor = {
    import Service._
    named("premium-calculator")
      .withCalls(
        restCall(Method.POST, "/api/v2/premium/:channelName", getPremiums _))
      .withAutoAcl(true)
  }
}
</code></pre>

<p>in build.sbt</p>

<pre><code>lagomUnmanagedServices in ThisBuild := Map(
  "premium-calculator" -&gt; "https://test.in",
)
</code></pre>

Chandan Pasunoori
<p>For locating Non-Lagom/Third Party Service in Lagom on Kubernetes, we have to use Lagom's service locator. Like this:</p>

<pre><code>lagom.services {
  "premium-calculator" = "https://test.in"
}
</code></pre>

<p>Also, we have to use <code>ConfigurationServiceLocator</code> to locate the service:</p>

<pre><code>if(environment.isProd()) {
  bind(ServiceLocator.class).to(ConfigurationServiceLocator.class);
}
</code></pre>

<p>Here <code>ConfigurationServiceLocator</code> locates the service via configuration (as the name suggests).</p>

<p>I hope this helps!</p>
