<p>We have a Kubernetes cluster behind a L4 load balancer but we do not have programmatic access to the load balancer to add/remove nodes when we need to update/reboot nodes (the LB is managed by the Support team of our hosting provider).</p>
<p>The load balancer does support healthchecks but the current setup is to call port 80 on each node to determine whether the node is healthy. This will succeed even if the node is drained so we have no choice except to reboot the node and wait up to 10 seconds for the LB to notice and take it out of the set when kubeapi dies.</p>
<p>I want something like a pod per-node that we could use to determine whether the node is alive, presumably setup with a node port. The problem is that I can't find how to do this. If I use a daemonset, I don't think the pods are evicted during drain so that wouldn't work and if I used a normal deployment, there is no guarantee that a healthy node will have an instance of the pod and would appear unhealthy. Even with anti-affinity setup I don't think there is any guarantee that all healthy nodes will have a running pod to check.</p>
<p>Does anyone know a way of using a TCP or HTTP call to a node to detect it is drained?</p>

Luke Briner
<p>It seems that the solution you are looking for is fully described in <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/monitor-node-health/" rel="nofollow noreferrer">this documentation</a>:</p>
<blockquote>
<p><em>Node Problem Detector</em> is a daemon for monitoring and reporting about a node's health. You can run Node Problem Detector as a <code>DaemonSet</code> or as a standalone daemon. Node Problem Detector collects information about node problems from various daemons and reports these conditions to the API server as <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#condition" rel="nofollow noreferrer">NodeCondition</a> and <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#event-v1-core" rel="nofollow noreferrer">Event</a>.</p>
</blockquote>
<p>You can create a node monitoring based on its <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#condition" rel="nofollow noreferrer">condition</a>.</p>
<p>You need to also know about the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/monitor-node-health/#limitations" rel="nofollow noreferrer">limitations</a>:</p>
<blockquote>
<ul>
<li>Node Problem Detector only supports file based kernel log. Log tools such as  <code>journald</code>  are not supported.</li>
<li>Node Problem Detector uses the kernel log format for reporting kernel issues. To learn how to extend the kernel log format, see  <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/monitor-node-health/#support-other-log-format" rel="nofollow noreferrer">Add support for another log format</a>.</li>
</ul>
</blockquote>
