Add pod-level 'terminationGracePeriodSeconds'
Kim-menu opened this issue · 5 comments
Problem description:
Thank you for developing awesome tool SCDF :)
I want to execute 'preStop' hook with all task execution.
Because SCDF supports lifecycle hook deployer properties(postStart, preStop), I can reach my purpose.
However, I cannot find any properties for setting 'terminationGracePeriodSeconds'.
Is there any deployer properties with it? or other method that I can use for applying deployment properties which are not supported in 'spring cloud deployer k8s'?
Solution description:
support 'terminationGracePeriodSeconds' property(?) 😅
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/
Description of alternatives:
Additional context:
Tasks
- implement in k8s deployer
- update docs in SCDF
Hi @Kim-menu , thanks for the kind words. You are more than welcome.
Correct, there is not currently a pod-level terminationGracePeriodSeconds
property available.
I am going to move this issue to the spring-cloud-deployer repo.
Thanks for the report.
NOTE Since k8s 1.25, there is support for a probe-level terminationGracePeriodSeconds
. That one is a bit more involved than this simple property as there are N probes to handle - not complicated, just in multiple places to update and test. Let's see if the pod-level setting suffices for now.
Hi,
minor nitpick on this: on SCDF's launch task screen, both in Builder and Freetext forms, this new property is translated with a typo, deployer.<task>.terminiation-grace-period-seconds
. This misspelling appears to come from KubernetesDeployerProperties
. Defining this property at platform level also requires to misspell it.
Other than that, super useful feature, thanks!
Oh my, sorry about this @juanpablo-santos . It is more than a nitpick IMO.
We will get this fixed and be sure the tests in place are paying more attention to the naming of the field.
In the meantime, here is the workaround re-stated:
- when specifying the property at platform level use the bad spelling
terminiation-grace-period-seconds
- when specifying the property at app or deployer level use the proper spelling
termination-grace-period-seconds