<p>I'm runnning a cluster in Kubernetes with minikube and VirtualBox.</p>
<p>This is my headless service</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    service: test
  name: test-group-ping
spec:
  clusterIP: None
  ports:
    - port: 4444
      name: ping
      protocol: TCP
      targetPort: 4444
  selector:
    service: test
  sessionAffinity: None
  type: ClusterIP
</code></pre>
<p>This is how I deployed the pods</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
  labels:
    app: test
spec:
  replicas: 3
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
    spec:
      containers:
      - name: test
        image: image
        env:
        - name: KC_PROXY
          value: &quot;edge&quot;
        - name: PROXY_ADDRESS_FORWARDING
          value: &quot;true&quot;
        ports:
          - containerPort: 8080
          - containerPort: 4444
          - containerPort: 8888
        readinessProbe:
            httpGet:
              path: &quot;/test&quot;
              port: 8080
            initialDelaySeconds: 600
            periodSeconds: 30
</code></pre>
<p>I have another Load Balancer for the pods</p>
<p>When I use <code>kubectl get services</code> , I get <code>test-group-ping</code> as an headless service</p>
<pre><code>test-group-ping   ClusterIP      None             &lt;none&gt;          4444/TCP     8h


kubectl describe service test-group-ping
Name:              test-group-ping
Namespace:         default
Labels:            service=test
Annotations:       &lt;none&gt;
Selector:          service=test
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                None
IPs:               None
Port:              ping  4444/TCP
TargetPort:        4444/TCP
Endpoints:         &lt;none&gt;
Session Affinity:  None
Events:            &lt;none&gt;
</code></pre>
<p>I need the DNS query for this headless service</p>
<p>I tried  <code>test-group-ping.default.svc.cluster.local</code>, but when I tried to do a DNS lookup on this, it doesn't return any IP addresses of the pod</p>
<pre><code> % dig +search test-group-ping.default.svc.cluster.local


; &lt;&lt;&gt;&gt; DiG 9.10.6 &lt;&lt;&gt;&gt; +search test-group-ping.default.svc.cluster.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NXDOMAIN, id: 8544
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test-group-ping.default.svc.cluster.local. IN A

;; AUTHORITY SECTION:
.           10800   IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2022032100 1800 900 604800 86400

;; Query time: 140 msec
;; SERVER: 2600:1702:8c0:e100::1#53(2600:1702:8c0:e100::1)
;; WHEN: Mon Mar 21 10:33:50 CDT 2022
;; MSG SIZE  rcvd: 151

;; Query time: 140 msec
;; SERVER: 2600:1702:8c0:e100::1#53(2600:1702:8c0:e100::1)
;; WHEN: Mon Mar 21 10:33:50 CDT 2022
;; MSG SIZE  rcvd: 151
</code></pre>

MrRobot9
<p>Your Service selector <code>service: test</code> does not match with the Pod label <code>app: test</code>.</p>
