<p>I am using Spark, which has a predefined script to create a pod in my kubernetes cluster.</p>
<p>After the pod is created and running, I want to check if it's still alive. I could do this by using a livenessProbe, however this is configured in the configuration file for the Pod, which <strong>I do not have control over</strong>, as my pod is created by Spark and I cannot change its config file.</p>
<p>So my question is, after the pod has been already created and running, how can I change the configuration for it so that is uses livenessProbe?
Or is there any other way to check the liveness of the pod?</p>
<p>I am a beginner to Kubernetes, sorry for this question!</p>

Johnas
<p>After a Pod is created you can't change the livenessProe definition.
You could use a second Pod to report on the status of your workload, if that works for your use case.</p>
<p>The other option is to use a Mutating Admission Controller to modify the Pod definition from your Spark script, though I would consider this not exactly beginner friendly.</p>
<ul>
<li><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook</a></li>
<li><a href="https://www.trion.de/news/2019/04/25/beispiel-kubernetes-mutating-admission-controller.html" rel="nofollow noreferrer">https://www.trion.de/news/2019/04/25/beispiel-kubernetes-mutating-admission-controller.html</a></li>
<li><a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/</a></li>
</ul>
