Issue with services where intrapod communication is not working properly

2/7/2020

When I was creating headless service in the cluster, node port and clusterip services are not working properly using clusterip & port and getting an error when using the same service for intrapod communication.

headless service

{ 
   "kind":"Service",
   "apiVersion":"v1",
   "metadata":{ 
      "name":"cocostore",
      "namespace":"dev",
      "labels":{ 
         "name":"dev"
      }
   },
   "spec":{ 
      "type":"ClusterIP",
      "clusterIP":"None",
      "selector":{ 
         "group":"dev"
      }
   }
}

Nodeport service

{ 
   "kind":"Service",
   "apiVersion":"v1",
   "metadata":{ 
      "name":"api-gateway",
      "namespace":"dev",
      "labels":{ 
         "name":"api-gateway"
      }
   },
   "spec":{ 
      "ports":[ 
         { 
            "port":8080,
            "nodePort":31000
         }
      ],
      "type":"NodePort",
      "selector":{ 
         "service":"api-gateway"
      }
   }
}

intrapod communication error

2020-01-23T09:59:29.128Z [EG:policy] warn: getaddrinfo EAI_AGAIN auth-server.cocostore.dev.svc.cluster.local:8080

Kubernetes version used 1.16.1

Can anyone help me to resolve this issue

-- T.V.Deekshith
kubernetes

0 Answers