Cr.yaml and kubernetes lifecycle

Hello

In a deployment yaml one would be able to

        lifecycle:
          preStop:
            exec:
              command:
              - /bin/bash
              - -c
              - <do some stuff to clean up>

How can this be achieved with cr.yaml

Regards
John

1 Like

Hey @jamoser ,

for now it is not possible.
Do you have an example of desired clean up?

I’m just thinking how will it work for a statefulset. Will you perform a clean up on all Pods?

1 Like

This should be (a hook or whatever) available for each pod of the replicaset.

One could for ex. delete “/data/db/mongod.lock” (see ticket "Detected unclean shutdown2)

1 Like