<p>I need to configure the probes in kubernetes. In my probes endpoints I use http and basic auth. Here is an example of my deployment.yml</p>
<pre><code>livenessProbe:
 httpGet:
 path: /actuator/health/liveness
 port: 8080
 scheme: HTTP
 httpHeaders:
 - name: Authorization
 value: Basic dXNlcjpwYXNzd29yZA==
</code></pre>
<p>Is it possible to configure it to use the secret value in header authorization? As far as I know header must be 'user: password' encoded in base64, otherwise it won't work. I keep the user and password in my application's application.yml, the configMap for this project was created on the basis of application.yml. Is it possible to automatically retrieve user and password from configMap and add to base64 and assign to a variable or secrecy? or is there any possibility to keep user and password in secret and use this in probe? [I don't mean to keep 'user: password' already in base64 in secret type token, only basic auth '].</p>
<p>I will be very grateful for any answer.</p>

annaskwq
<blockquote>
<p>Is it possible to automatically retrieve user and password from
configMap and add to base64 and assign to a variable or secrecy?</p>
</blockquote>
<p>Short answer is no. If you look into docs you will notice that Kubernetes does not have this functionality. All available options are listed in this <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#httpheader-v1-core" rel="nofollow noreferrer">Kubernetes API</a> reference.</p>
<p>You will have to create a custom solution to make this functionality possible like write your own script that read that ConfigMap (e.g. curl API for that config).</p>
