CodeMonkey
CodeMonkey

Reputation: 12434

terminationGracePeriodSeconds in kind pod vs kind deployment

I'm trying to set a grace shutdown period for my pods. I found out you can add a field called terminationGracePeriodSeconds to the helm charts to set the period. I then looked for example and crossed upon these:

https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace

In the above link they define the value in a kind: pod template.

https://pracucci.com/graceful-shutdown-of-kubernetes-pods.html

In the above link they define the value in a kind: deployment template.

Is there a difference between the 2 kinds in regard to where I define this value?

Upvotes: 2

Views: 4291

Answers (1)

Jonas
Jonas

Reputation: 128897

Is there a difference between the 2 kinds in regard to where I define this value?

A Deployment has a field template: and that is actually a PodTemplate (most structure of a Pod) that includes the terminationGracePeriodSeconds property.

A good way to check documentations for fields is to use kubectl explain.

E.g.

kubectl explain Deployment.spec.template.spec

and

kubectl explain Pod.spec

Upvotes: 3

Related Questions