How to set terminationGracePeriodSeconds for statefulset

Hello

Running Cluster in non-sharding mode and getting always unclean shutdown.

Seems terminationGracePeriodSeconds needs to be set in order delay pod shutdown.

Thnaks
John

PS: why dont you provide all the kubernetes params by default ?

1 Like

Hello @jamoser ,

seems right now you cannot set the grace period with CR.

as for

PS: why dont you provide all the kubernetes params by default ?

well, it is tricky.

  1. We need to understand where this parameter should land. Like termnationGracePeriodSeconds is a container property, but there are others which should land under StatefulSet or Pod or something else.
  2. We need to research if OpenAPI schema even allows such thing. I see there is x-kubernetes-preserve-unknown-fields: true, but not sure yet how does it work. Will check.

Will you be interested in sending a quick PR for fixing it? :slight_smile:

1 Like

Any guide how to do a PR ?

1 Like

Hey @jamoser!

Short answer - just submit a PR at GitHub - percona/percona-server-mongodb-operator: Percona Operator for MongoDB

1 Like

Hi @Sergey_Pronin

Sorry - not having access to JIRA nor github.

termnationGracePeriodSeconds is an attribute of Statefulset of the original MongoDB distro. I assume Percona Replicaset is also based on a Statefulset … so a pass through is required.

And this param is quite important - otherwise a restart/reschedule of the pods will cause a crash of the mongodb which can lead to a very long recovery. Even worse it can totally crash the cluster if liveness probe is not configured properly.

Regards
John

Bump … would be quite important to make this work.

I added it into our backlog: [K8SPSMDB-927] Pass termnationGracePeriodSeconds to RS containers - Percona JIRA

If you still want to submit PR, it has high chances to be included in the next release :slight_smile:

1 Like

@Sergey_Pronin

I can only offer beer … :slight_smile: