<p>on GKE I created some pods and a headless service. The headless service has a selector and I am expecting the endpoint to get the IP of the Pod that matches the selector.</p>

<p>However the endpoint remains empty</p>

<pre><code>$ kubectl get pods -lservice=front-end
NAME                         READY     STATUS    RESTARTS   AGE
front-end-1567472915-tei91   1/1       Running   0          12m
$ kubectl get svc -lapp=sockshop
NAME        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
front-end   None         &lt;none&gt;                  11m
$ kubectl get endpoints -lapp=sockshop
NAME        ENDPOINTS   AGE
front-end   &lt;none&gt;      11m
$ more svc.yaml 
apiVersion: v1
kind: Service
metadata:
  labels:
    app: sockshop
  name: front-end
spec:
  clusterIP: None
  ports: null
  selector:
    service: front-end
</code></pre>

<p>I would expect an endpoint to get the IP of the Pod so that the DNS registration works.</p>

<p>if <code>ports</code> is set to <code>null</code> the endpoint will not get populated.</p>

<p>You need to add a port (even a dummy one) for the endpoint to get populated with the PodIPs of the Pods that match the selector.</p>

<p><code>
  ports:
  - port: 1234
    protocol: TCP
    targetPort: 1234
</code></p>
