0

I have Deployment that runs 5 pods.

I want to restart all pods each 5min.

Currently I'm doing it with python scritpt that is running kubectl get po and checks AGE, if the AGE bigger than 5 min it deletes the pod.

Is there another way to achieve that?

Matt
  • 7,419
  • 1
  • 11
  • 22
samisaviv
  • 283
  • 1
  • 7
  • 17

1 Answers1

1

You could do a liveness check to achieve this, but why would you do it? Deployment is for LongRunning Tasks.

A liveness check will reschedule a pod if its not true (gives a other exit code than 0)

For more Info here:

https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/

Theroth
  • 31
  • 9