<p>I have 3 node K8S cluster, I have created 3 replica pods on which application - app1 is running on all the pods, I have established service by running service yaml file and I can see my cluster-Ip created by running kubectl get service</p>

<p>When I try to do curl from one of the node I am getting " curl: (7) Failed to connect - failed to connect"
 when I try to curl inside the pod I am getting ... "command terminated with exit code 7"</p>

<p>Commands Ran:</p>

<blockquote>
  <p>kubectl  run kubia --image=kubia --port=8080 --generator=run/v1</p>
  
  <p>kubectl scale rc kubia --replicas=3 </p>
</blockquote>

<p>Manifest file used: </p>

<blockquote>
  <p>apiVersion: v1<br>
  kind: Service<br>
  metadata:<br>
    name: kubia<br>
  spec:
    ports:<br>
    - port: 80<br>
      targetPort: 8080.<br>
    selector:
      app: kubia</p>
</blockquote>

<p>Can any body help me on this.
Thanks</p>

args
<p>Solution :  In yaml file - selector should be run: kubia instead of app: kubia, deleted the old service and again created new service , I am able to do curl on the internal ip from the pod. Thanks.</p>
