<p>Im trying to create an internal service only within kubernetes. Its a clamav service, the docker container runs on port 3310. I have created a deployment and a service.</p>
<p>I have put the service and deployment in a 'clamav' namespace</p>
<p>I have port forwarded both the service and pods and can confirm it works as expected.</p>
<p>If I connect directly to the pod and run <code>curl localhost:3310</code> its good, if i <code>curl clamav</code> (no port as ive configured 80 as the incoming service port) (which clamav being the service name) I get the following 503 error:</p>
<pre><code>upstream connect error or disconnect/reset before headers. reset reason: connection termination
</code></pre>
<p>If I connect to a different service and try the same <code>curl clamav.clamav</code> I get the same error. (no port as ive configured 80 as the incoming service port)</p>
<p>Do I need something else other than a service and deployment or is something misconfigured?</p>
<p>The service spec is shown below.</p>
<pre><code>spec:
  clusterIP: 10.10.255.194
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 3310
  selector:
    app: clamav
  sessionAffinity: None
  type: ClusterIP
</code></pre>
<p>I have tried changing the name to &quot;3310-3310&quot; and changing the port to &quot;3310&quot; as well... had to update the curl commands to have the :3310 for the port... but same error.</p>
<p>Also just to add, I do have the istio service mesh running in this cluster and injected.</p>
<p>Thanks
Kevin</p>

Kevin
<p>The answer to this was the service, changing it to:</p>
<pre><code>spec:
  clusterIP: 10.10.255.194
  ports:
  - name: tcp-clamav
    port: 80
    targetPort: 3310
  selector:
    app: clamav
  sessionAffinity: None
  type: ClusterIP
</code></pre>
<p>Fixed the issue</p>
