<p>I have a Docker container that expose a health check that is protected by a basic authentication. I've read the documentation on liveness probes <a href="http://kubernetes.io/v1.0/docs/user-guide/liveness/README.html" rel="noreferrer">here</a> but I cannot find any details of how to specify basic auth credentials. Is this not supported by Kubernetes? Are there any workarounds?</p>

<p>It is now possible to add headers for liveness probes:</p>

<pre><code>livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
    httpHeaders:
      - name: Authorization
        value: Basic aGE6aGE=
</code></pre>

<p>It may be worth noting that:</p>

<blockquote>
  <p>if the browser uses Aladdin as the username and OpenSesame as the
  password, then the field's value is the base64-encoding of
  Aladdin:OpenSesame, or QWxhZGRpbjpPcGVuU2VzYW1l. Then the
  Authorization header will appear as:</p>
  
  <p>Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l</p>
</blockquote>

<p>Source: <a href="https://en.wikipedia.org/wiki/Basic_access_authentication" rel="noreferrer">https://en.wikipedia.org/wiki/Basic_access_authentication</a></p>

<p>You can use the command <code>base64</code> in your shell to create this string:</p>

<pre><code>echo -n "Aladdin:OpenSesame" | base64
</code></pre>
