<p>I would like some help to solve a particular Kubernetes + mTLS problem please.</p>
<p>How to make Kubernetes liveness probe work on a <strong>secure https mTLS health check endpoint</strong> please?</p>
<p>My application is a web application where a health check endpoint is exposed over a particular port, same port as other business endpoints.</p>
<p>Per security, audit and compliance review, I <strong>must secure all my endpoints over mTLS</strong>, even the simple and innocent health check endpoint.</p>
<p>Per security, audit and compliance review, I <strong>cannot expose any other ports</strong> like doing my business endpoints on https port 1, but health on http port 2.</p>
<p>Hence, this is failing and marking my app as down (since it is over simple http, the endpoint is https)</p>
<pre><code>          livenessProbe:
            httpGet:
              path: /health
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 10
</code></pre>
<p>Just to confirm during a test, we disabled https and mTLS, enabling plain old http, everything is working perfectly, but we simply cannot do that.</p>
<p>How to solve this problem please?</p>
<p>Thank you.</p>

<p>Can you try changing scheme: HTTP to HTTPS?</p>
<p>livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTPS
initialDelaySeconds: 10
periodSeconds: 10</p>
<p>If scheme field is set to HTTPS, the kubelet sends an HTTPS request skipping the certificate verification.</p>
