<p>I have created a service like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: amen-sc
spec:
  ports:
    - name: http
      port: 3030
      targetPort: 8000
  selector:
    component: scc-worker
</code></pre>
<p>I am able to access this service, from within my pods of the same cluster (&amp; Namespace), using the IP address I get from <code>kubectl get svc</code>, but I am not able to access using the service name like <code>curl amen-sc:3030</code>.</p>
<p>Please advise what could possibly be wrong.
I intend to expose certain pods, only within my cluster and access them using the <code>service-name:port</code> format.</p>

<p>Make sure you have DNS service configured and corresponding pods are running.</p>
<pre class="lang-text prettyprint-override"><code>kubectl get svc -n kube-system -l k8s-app=kube-dns
</code></pre>
<p>and</p>
<pre class="lang-text prettyprint-override"><code>kubectl get pods -n kube-system -l k8s-app=kube-dns
</code></pre>
