kubernetes / enhancements

Enhancements tracking repo for Kubernetes
Apache License 2.0
3.37k stars 1.45k forks source link

Introduce finalizerProbe for the pods like we have livenessProbe #4757

Open bitsmaestro opened 1 month ago

bitsmaestro commented 1 month ago

Enhancement Description

Requirement: while deleting a pod API server is not sure if anything on that pod is running or not. May be pod is still processing response for some rest call and we may loose it.

Enhancement: So suggestion is introduce an finalizerProbe which when curled should return if Pod is ready to die or not. this should only be used when we get some external delete with force option, all other deletion scenarios should not care about finalizerProbe

finalizerProbe should return 500 if not ready to be deleted & 200 when ready to be deleted

Application inside the pod should ensure the logic to return return 500 or 200 as per the business that new request is not accepted once a finalizerProbe is called or metadata.deletionTimestamp is added to the pod.

Please keep this description up to date. This will help the Enhancement Team to track the evolution of the enhancement efficiently.

bitsmaestro commented 1 month ago

/sig app

k8s-ci-robot commented 1 month ago

@bitsmaestro: The label(s) sig/app cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubernetes/enhancements/issues/4757#issuecomment-2222954352): >/sig app Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
bitsmaestro commented 1 month ago

/sig app

k8s-ci-robot commented 1 month ago

@bitsmaestro: The label(s) sig/app cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubernetes/enhancements/issues/4757#issuecomment-2222955620): >/sig app Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
bitsmaestro commented 1 month ago

/sig apps

bitsmaestro commented 1 month ago

Like HTTP we can implement similar concept for TCP probes and GRPC Health Checking Protocol also error returned by finalizerProbe we dont delete the pod , success we delete the pod it will be amalgamation of finalizers & probes concept