<p>my pod namespace is kube-test，But the service name is this default</p>

<pre><code>[root@kube01 iyunv]# kubectl get pods -n kube-test
NAME                                              READY     STATUS    RESTARTS   AGE
business-org-deployment-c84b7d9f6-55vpl           1/1       Running   0          21h
</code></pre>

<p>Use defaulc to parse （ business-org.default.svc.cluster.local）</p>

<pre><code>[root@kube01 iyunv]# kubectl exec business-org-deployment-c84b7d9f6-55vpl -n kube-apabi -it /bin/bash

[root@business-org-deployment-c84b7d9f6-55vpl /]# ping business-org.default.svc.cluster.local
PING business-org.default.svc.cluster.local (10.254.56.71) 56(84) bytes of data.
64 bytes from business-org.default.svc.cluster.local (10.254.56.71): icmp_seq=1 ttl=64 time=0.052 ms
64 bytes from business-org.default.svc.cluster.local (10.254.56.71): icmp_seq=2 ttl=64 time=0.047 ms
64 bytes from business-org.default.svc.cluster.local (10.254.56.71): icmp_seq=3 ttl=64 time=0.049 ms
64 bytes from business-org.default.svc.cluster.local (10.254.56.71): icmp_seq=4 ttl=64 time=0.053 ms
</code></pre>

<p>Cannot be parsed using kube-test（business-org.kube-test.svc.cluster.local）</p>

<pre><code>[root@business-org-deployment-c84b7d9f6-55vpl /]# ping business-org.kube-test.svc.cluster.local
ping: business-org.kube-test.svc.cluster.local: Name or service not known
</code></pre>

<p>cat business-org.yaml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: business-org
  name: business-org
spec:
  ports:
  - port: 9051
    protocol: TCP
    targetPort: 9051
  selector:
    app: business-org
  type: ClusterIP
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: business-org-deployment
  namespace: kube-test
spec:
  replicas: 1
  template: 
    metadata:
      labels:
        app: business-org
    spec:
      containers:
      - name: business-org
        image: harbor.test.com/test/business-org:201810251757_11f8bd9
        ports:
        - containerPort: 9051
</code></pre>

kernelsky
<p>This </p>

<pre><code>ping: business-org.kube-test.svc.cluster.local: Name or service not known
</code></pre>

<p>unambiguously signaled there's no service <code>buisness-org</code> in the namespace <code>kube-test</code></p>

<p>following YAML will fix this:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  namespace: kube-test &lt;---
  labels:
    app: business-org
  name: business-org
spec:
  ports:
  - port: 9051
    protocol: TCP
    targetPort: 9051
  selector:
    app: business-org
  type: ClusterIP
</code></pre>
