Skip to content

feat: auto tolerate DaemonSets with MutatingAdmissionPolicy - #494

Open
Ayush4958 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Ayush4958:feat/auto-tolerate-daemonsets
Open

Ayush4958 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Ayush4958:feat/auto-tolerate-daemonsets

Conversation

@Ayush4958

@Ayush4958 Ayush4958 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

When new nodes join the cluster with readiness.k8s.io/* taints, critical Infra DaemonSets (network & storage driver) can't schedule on them without explicit tolerations. This causes a deadlock where node can't become ready until those drivers run

I had added automatic toleration injection for DaemonSets without requiring a separate webhook server:

  • Controller keeps a list of active readiness taints in a ConfigMap
  • Kubernetes MutatingAdmissionPolicy reads list & automatically add the missing tolerations to DaemonSets when they are created / updated
  • Existing tolerations are preserved without duplication & workloads can opt out using the annotation readiness.k8s.io/auto-tolerate: false
  • If the policy or configmap is missing daemonsets are admitted normally without being blocked

Related Issue

Closes #7

Type of Change

/kind feature

Testing

  • Automated Tests: make test passed across all packages
  • Static Checks: ./hack/verify-all.sh passed
  • Helm Validation: helm lint & template rendering verified
  • Cluster Test: Verified on a Kubernetes v1.36 KinD cluster that DaemonSets receive tolerations automatically & opt out annotations are respected

Checklist

  • make test passes
  • make lint passes

Does this PR introduce a user-facing change?

Auto tolerate DaemonSets against readiness taints using Kubernetes MutatingAdmissionPolicy

Generative AI Usage Disclosure

  • No AI tools were used
  • AI tools were used

How they were used:
AI assisted with drafting the CEL expressions, helm templates and unit tests. All changes, failure modes, and test results were reviewed, debugged, and verified locally on kind by myself

Signed-off-by: Ayush <bhandariayush935@gmail.com>
@kubernetes-prow kubernetes-prow Bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 18, 2026
@netlify

netlify Bot commented Oct 18, 2026

Copy link
Copy Markdown

👷 Deploy Preview for node-readiness-controller processing.

Name Link
🔨 Latest commit 69a302a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6ad51628192db2691d648e16

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ayush4958
Once this PR has been reviewed and has the lgtm label, please assign sergeykanzhelev for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Oct 18, 2026

Copy link
Copy Markdown

✅ Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit 69a302a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6ad51628192db2691d648e16

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 18, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @Ayush4958. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 18, 2026
@Ayush4958

Copy link
Copy Markdown
Contributor Author

Hi @Karthik-K-N
Please take time to review it
Thanks ..

@Karthik-K-N

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 23, 2026
@kubernetes-prow

Copy link
Copy Markdown

@Ayush4958: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-node-readiness-controller-scale-test-binary-1000-continuous 69a302a link true /test pull-node-readiness-controller-scale-test-binary-1000-continuous

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Auto tolerate DaemonSets with mutating admission controller

2 participants