<p>I had read on the documentation that liveness probes make a new pod and stop the other one. But in the kubernetes dashboard it shows me only restarts with my tcp livness probe. I was wondering what kubernetes does during a liveness probe. Can i control it?</p>

Java
<p>The kubelet uses <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/" rel="nofollow noreferrer">liveness probes</a> to know when to <strong>restart a Container</strong>, not recreate the pods.</p>
<p>Probes have a number of fields that you can use to more precisely control the behavior of the checks (<code>initialDelaySeconds</code>,<code>periodSeconds</code>, <code>timeoutSeconds</code>, <code>successThreshold</code> and <code>failureThreshold</code>). You can find details about them <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes" rel="nofollow noreferrer">here</a>.</p>
<p>For container restart, SIGTERM is first sent with waits for a parameterized grace period, and then Kubernetes sends SIGKILL. You can control some of this behavior by tweaking the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#podspec-v1-core" rel="nofollow noreferrer"><code>terminationGracePeriodSeconds</code></a> value and/or  <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">Attaching Handlers to Container Lifecycle Events</a>.</p>
<hr />
<p>Update:</p>
<p>The Kubernetes v1.28.x has <a href="https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2238-liveness-probe-grace-period" rel="nofollow noreferrer">a proposal</a> to add a new field exclusive for tweaking the probes:</p>
<blockquote>
<p>Liveness probes currently use the <code>terminationGracePeriodSeconds</code> on both normal shutdown and when probes fail [...]</p>
<p>I propose adding a new field to probes,
<code>probe.terminationGracePeriodSeconds</code>. When set, it will override the
<code>terminationGracePeriodSeconds</code> for liveness or startup termination, and
will be ignored for readiness probes.</p>
</blockquote>
