terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
Support Probe-level `terminationGracePeriodSeconds`
Description
Kubernetes >v1.25 supports a terminationGracePeriodSeconds field on livenessProbe and startupProbe. This field overrides the Pod-level terminationGracePeriod field when a SIGTERM is triggered by a probe failure.
Probe-level terminationGracePeriodSeconds cannot be set for readiness probes.
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#probe-level-terminationgraceperiodseconds
Potential Terraform Configuration
resource "kubernetes_deployment" "example" {
metadata {
# ...
}
spec {
# ...
template {
# ...
spec {
container {
# ...
liveness_probe {
# ...
termination_grace_period_seconds = 3
}
}
}
}
}
}
References
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#probe-level-terminationgraceperiodseconds
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Opened a PR: https://github.com/hashicorp/terraform-provider-kubernetes/pull/2697
There's some relevant discussion in https://github.com/hashicorp/terraform-provider-kubernetes/issues/2705#issuecomment-2736679918:
We're working on a comprehensive solution to cover all of the missing attributes consistently, through code generation.
Hopefully this solution can be released soon.