<p>I setup my ASP.NET Core project to use gRPC. I have a server and a client.</p>
<p>Locally, it is working fine. But when I deploy to Docker, the client cannot call it anymore.</p>
<p>Is there anything wrong with my settings below?</p>
<p><strong>Server</strong></p>
<p><em>Startup.cs</em></p>
<pre><code>//Configure Services
services.AddGrpc();

...

//Configure
app.UseEndpoints(endpoints =&gt;
            {
                endpoints.MapGrpcService&lt;ProgramService&gt;();
                endpoints.MapControllers();
            });
</code></pre>
<p><em>appsettings.Dev.json</em></p>
<pre><code>&quot;Kestrel&quot;: {
&quot;Endpoints&quot;: {
  &quot;gRPC&quot;: {
    &quot;Url&quot;: &quot;http://localhost:8000&quot;,
    &quot;Protocols&quot;: &quot;Http2&quot;
  }
}
}
</code></pre>
<p><em>Dockerfile</em></p>
<pre><code>WORKDIR /app
EXPOSE 80 8000
ENV ASPNETCORE_URLS=http://+:8000  
</code></pre>
<p><em>kubernetes deployment.yml</em></p>
<pre><code>containers:
        - name: tenant-api-grpc 
          ports:
          - containerPort: 8000
</code></pre>
<p><em>kubernetes service.yml</em></p>
<pre><code>spec:
    type: ClusterIP
    ports:
        - name: &quot;8000&quot;
          port: 8000
          targetPort: 8000
</code></pre>
<p><strong>Client</strong></p>
<p><em>Startup.cs</em></p>
<pre><code>services.AddGrpcClient&lt;Tenant.Proto.Program.ProgramClient&gt;(o =&gt;
            {
                o.Address = new Uri(Configuration[&quot;ServiceUrlConfiguration:ServiceTenantUrl&quot;]);
            });
</code></pre>
<p><em>appsettings.Dev.json</em></p>
<pre><code>&quot;ServiceUrlConfiguration&quot;: {
    &quot;ServiceTenantUrl&quot;: &quot;http://tenant-api-grpc-svc.dev.svc.cluster.local:8000/&quot;
  }
</code></pre>

Water
<p>It is hard to analyze your porblem with the given information.</p>
<p>I would suggest to check the base url. When you start server and client in kestrel you find the services under localhost. If you deploy the services using docker-compose the services find each other under the name of the service respectively. If you deploy the containers independently, you can access localhost from within the container using host.docker.internal.</p>
