<p>I've defined a dummy service as a means of registering my pods in DNS, as a cluster IP will not work for my application right now.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: company
spec:
  selector:
    app: company_application
  clusterIP: None
</code></pre>

<hr>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: company-master-deployment
  labels:
    app: company_application
    role: master
spec:
  selector:
    matchLabels:
      app: company_application
      role: master
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: company_application
        role: master
    spec:
      hostname: master
      subdomain: company
</code></pre>

<p>I'm using the DNS entry for <code>master.company.default.svc.cluster.local</code> to connect to that pod from another pod.</p>

<p>I've noticed a really annoying behavior in Kubernetes under these conditions:</p>

<ul>
<li>I have a pod that is in "unhealthy" as defined by a ReadinessCheck</li>
<li>I have another pod whose application wants to do a DNS lookup on that pod</li>
<li>The DNS lookup fails until the "unhealthy" pod becomes healthy.</li>
</ul>

<p>Is this the way Kubernetes is supposed to work? Is there any way, other than removing the readiness check, to make sure that the DNS continues to resolve?</p>

tacos_tacos_tacos
<p>Yes, Pods are not added to service endpoints till they pass readiness checks. You can confirm this by running following command:</p>

<pre><code>kubectl get endpoints company -n &lt;your_namespace&gt;
</code></pre>

<p>You wont see any endpoints till </p>

<blockquote>
  <p>readinessProbe</p>
</blockquote>

<p>is failing.</p>
