<p>I've got a simple question but I can't find out the right answer.</p>
<p>I have a couple of pods runnig my applications in python in kubernetes. I didn't implement liveness and readiness yet. When I was talking to my leader, he told me that I had to create the liveness and readiness for check and restart my pods when necessary and I had to find a way to make the liveness and readiness check if the python is also running because it could get stuck and the container could show that's everything fine.</p>
<p>I'v got confused because for my liveness and readiness would do this. I must create it using command, as this microservices doesn't have endpoint or healthcheck as they are just workers.</p>
<p>Any clue for how can I do that? Or a good answer that can explain that liveness and readiness check whether the python is running or not.</p>
<p>Thanks a lot!</p>

Arthur Ávila
<p>Readiness won't restart your pod, it'll just make your worker not reachable through a load balancer/service, Liveness will do restart if the condition failed.
You don't need to have liveness run through an endpoint, you can make sure that it's just reachable:</p>
<pre><code>        livenessProbe:
          failureThreshold: 3
          initialDelaySeconds: 30
          periodSeconds: 20
          successThreshold: 1
          tcpSocket:
            port: &lt;port-number&gt;
          timeoutSeconds: 5
</code></pre>
<p>You can expose a port on the running python worker and just make sure that it's reachable, otherwise, think logically about when you do want to restart the pod? what do you mean by <code>it could get stuck </code></p>
