Giter Site home page Giter Site logo

Comments (3)

mihasya avatar mihasya commented on July 26, 2024

Hello, @foriequal0 ! We have rolled out this controller in both our staging and prod clusters and, indeed, so far it's working great. I'm scanning the issues list to see what might lie ahead, and am wondering if you could flesh out what gaps are currently known.

from pod-graceful-drain.

mihasya avatar mihasya commented on July 26, 2024

I should add, if the issues are well defined and we can reproduce them locally, we are likely to prioritize contributing to this controller, as it has solved a big problem for us.

from pod-graceful-drain.

foriequal0 avatar foriequal0 commented on July 26, 2024

Hello, @mihasya ! I'm glad to hear that!
I think it is a good-to-have issue, rather than an urgent one. Anyway, let me give you detailed explanations.

Pod can be deleted with these options: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#delete-delete-a-pod
Currently, the controller uses Client from sigs.k8s.io/controller-runtime/pkg/client and its Delete() function. It can accept an optional client.DeleteOptions: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/options.go#L182
I think you can experiment with --grace-period flag in kubectl delete and kubectl apply. It seems that --dry-run is usually implemented in client side.

Also policyv1beta1.Eviction can be created with optional DeleteOptions in its fields: https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#eviction-v1beta1-policy

As you can see, these options are about gracePeriodSeconds, propagationPolicy, and preconditions.

Their handling is missing in 2 places I think.

  1. preconditions are not checked when the pod deletion/eviction is intercepted https://github.com/foriequal0/pod-graceful-drain/blob/main/internal/pkg/webhooks/pod_validator.go
    pod deletion is scheduled and the pod is successfully deleted even if it had faling preconditions.
  2. These options are not passed to the scheduled deletion: https://github.com/foriequal0/pod-graceful-drain/blob/main/internal/pkg/core/pod_mutate.go#L185

Also, it calls Delete() for both deletion/eviction. I assume that it might not respect pod disruption budget (I might be wrong).

I've stopped here since missing features are not critical in use cases that the controller is focused on.
But if you think they are critical to your workflow, then feel free to implement it. I'm willing to accept it.

from pod-graceful-drain.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.