Skip to content

[Feature]: Check for nodes cordoned by karpenter #5299

Description

@quercus-carsten

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

At the moment, when a primary runs on EKS nodes managed by karpenter, you will have to manually failover if a node is replaced or removed. This interrupts the automatic provisioning/deprovisioning of nodes.

Kubernetes uses the "node.kubernetes.io/unschedulable" taint and the "spec.unschedulable" field on a node to mark it as cordoned. The operator checks nodes for this information.
If a primary database is running on a node which was cordoned the operator will promote a secondary on another node.
This allows to evict the cordoned node without blocking the process due to the PDB of the primary.

Karpenter does not rely on "node.kubernetes.io/unschedulable" taint and/or the "spec.unschedulable" field.
Next to other things, the project basically needs to know that karpenter was the one that initiated the tainting.
kubernetes-sigs/karpenter#1152 (comment)

Describe the solution you'd like

Karpenter taints nodes with: "karpenter.sh/disruption:NoSchedule"
https://karpenter.sh/docs/concepts/disruption/#disruption-controller

It would be nice if the operator could also check for an additional/alternative taint like this.

Describe alternatives you've considered

You can set "enablePDB: false" - but this is officially not recommended for production environments.

Additional context

No response

Backport?

N/A

Are you willing to actively contribute to this feature?

No

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. markwebsterUK commented on Nov 3, 2024

    @markwebsterUK

    Ahhh, so that's what's going on! Would be great to implement this as a custom field.

  2. danielloader commented on Nov 8, 2024

    @danielloader

    I too found this after working out why my maximum age on karpenter issued nodes wasn't cycling the nodes out and instead blocked by postgres instances. Thanks OP for working this out.

  3. c-thiel commented on Jan 3, 2025

    @c-thiel

    Ran into the same problem, thanks for working it out!
    Karpenter community is also arguing about this, but they seem to prefer to stick to their current taint and not leverage the k8s ones:
    kubernetes-sigs/karpenter#1152

  4. mark-webster-catalyst commented on Jan 28, 2025

    @mark-webster-catalyst

    Any movement on this? It's making clusters managed by Karpenter unable to reliably consolidate or roll nodes without user interaction.

    EDIT: If anyone gets to it before I have a chance to, this is how the AWS EBS CSI Driver handles it https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/7bacf2d36f397bd098b3388403e8759c480be7e5/cmd/hooks/prestop.go#L47

  5. added
    enhancement 🪄
    and removed
    triage
    on Mar 25, 2025
  6. added this to the 1.26.0 milestone on Mar 25, 2025
  7. moved this to Waiting for First Review in CloudNativePG operator developmenton Mar 25, 2025
  8. moved this from Waiting for First Review to Waiting for Second Review in CloudNativePG operator developmenton Mar 26, 2025
  9. moved this from Waiting for Second Review to Done in CloudNativePG operator developmenton Mar 26, 2025
  10. markwebsterUK commented on Mar 26, 2025

    @markwebsterUK

    I am unreasonably excited that this has been fixed. Thank you!

  11. added a commit that references this issue on Mar 26, 2025
    ebc084f
  12. quercus-carsten commented on Mar 26, 2025

    @quercus-carsten
    Author

    Yep, i couldn't agree more :). This is going to be awesome - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement 🪄

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions