Johnas
Johnas

Reputation: 336

Configure pod liveness after pod was created

I am using Spark, which has a predefined script to create a pod in my kubernetes cluster.

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 I do not have control over, as my pod is created by Spark and I cannot change its config file.

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?

I am a beginner to Kubernetes, sorry for this question!

Upvotes: 0

Views: 184

Answers (1)

Thomas
Thomas

Reputation: 12049

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.

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.

Upvotes: 2

Related Questions