<p>I am trying to test a liveness probe while learning kubernetes.
I have set up a minikube and configured a pod with a liveness probe.</p>

<p>Testing the script (E.g. via docker exec) it seems to report success and failure as required.</p>

<p>The probe leads to failures events which I can view via <em>kubectl describe podname</em>
but it does not report recovery from failures.</p>

<p><a href="https://stackoverflow.com/a/34599554/1569204">This answer</a> says that liveness probe successes are not reported by default.</p>

<p>I have been trying to increase the log level with no success by running variations like:</p>

<pre><code>minikube start --extra-config=apiserver.v=4
minikube start --extra-config=kubectl.v=4
minikube start --v=4
</code></pre>

<p>As suggested <a href="https://stackoverflow.com/questions/55929593/run-kubernetes-api-server-in-minikube-in-verbose-mode">here</a> &amp; <a href="https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/" rel="nofollow noreferrer">here</a>.</p>

<p><strong>What is the proper way to configure the logging level for a kubelet?</strong></p>

<p>can it be modified without restarting the pod or minikube?</p>

<p>An event will be reported if a failure causes the pod to be restarted.
For kubernetes itself I understand that using it to decide whether to restart the pod is sufficient.</p>

<p>Why aren't events recorded for recovery from a failure which does not require a restart?
This is how I would expect probes to work in a health monitoring system.</p>

<p>How would recovery be visible if the same probe was used in prometheus or similar?
For an expensive probe I would not want it to be run multiple times.
(granted one probe could cache the output to a file making the second probe cheaper)</p>

Bruce Adams
<blockquote>
  <p>I have been trying to increase the log level with no success by
  running variations like:</p>

<pre><code>minikube start --extra-config=apiserver.v=4
minikube start --extra-config=kubectl.v=4
minikube start --v=4
</code></pre>
</blockquote>

<p>@Bruce, none of the options mentioned by you will work as they are releted with other components of Kubernetes cluster and in the answer you referred to it was clearly said:</p>

<blockquote>
  <p>The output of successful probes isn't recorded anywhere unless your
  <strong>Kubelet</strong> has a log level of at least --v=4, <strong><em>in which case it'll be in
  the Kubelet's logs</em></strong>.</p>
</blockquote>

<p>So you need to set <code>-v=4</code> specifically for <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">kubelet</a>. In the official docs you can see that it can be started with specific flags including the one, changing default verbosity level of it's logs:</p>

<pre><code>-v, --v Level
number for the log level verbosity
</code></pre>

<p><strong>Kubelet</strong> runs as a system service on each node so you can check it's status by simply issuing:</p>

<pre><code>systemctl status kubelet.service
</code></pre>

<p>and if you want to see it's logs issue the command:</p>

<pre><code>journalctl -xeu kubelet.service
</code></pre>

<p>Try:</p>

<pre><code>minikube start --extra-config=kubelet.v=4
</code></pre>

<p>however I'm not 100% sure if <strong>Minikube</strong> is able to pass this parameter so you'll need to verify it on your own. If it doesn't work you should still be able to add it in kubelet configuration file, specifying parameters with which it is started (don't forget to restart your <code>kubelet.service</code> after submitting the changes, you simply need to run <code>systemctl restart kubelet.service</code>)</p>

<p>Let me know if it helps and don't hesitate to ask additional questions if something is not completely clear.</p>
