<p>I have a file in <code>/tmp/healthy</code> as mentioned in official documentation and YAML is available</p>
<pre><code>livenessProbe:
  exec:
    command:
    - cat
    - /tmp/healthy
</code></pre>
<p>But in my case file always be here and it will contain message like Success or Failure</p>
<p>It is possible with <code>livenessProbe:command</code> to behave on these messages?</p>

<p>The point of a liveness probe is usually just to check if a pod is up and reachable. <code>cat</code> is decent command to use for liveness probes because it always returns success as long as the file is there. It is just checking if Kubelet can reach the pod.</p>
<p>If I'm understanding what you mean though, it is possible to have the result of the liveness probe depend on the contents of the file. You can execute any bash and exit with a 1 or 0 (fail or suceed) to control the result you want.</p>
<p>For example, if you want the liveness probe to fail if your file contains any failure message:</p>
<pre><code>    livenessProbe:
      exec:
        command:
        - /bin/bash
        - '-c'
        - grep -zqv &quot;Failure&quot; file.txt 
</code></pre>
