[CASCL-1386] (7/11) Evict EKS managed node groups#3174
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 7f9f9f5 | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## lenaic/CASCL-1386-evict-06-ec2-instance-id-helper #3174 +/- ##
=====================================================================================
+ Coverage 44.05% 44.12% +0.07%
=====================================================================================
Files 389 389
Lines 31093 31132 +39
=====================================================================================
+ Hits 13698 13737 +39
Misses 16501 16501
Partials 894 894
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
c0c8b6a to
9250b71
Compare
dd81350 to
0f545f7
Compare
9250b71 to
f9c10d1
Compare
0f545f7 to
3b7cda6
Compare
8e43ad1 to
3718447
Compare
91c9a7b to
0f3bbd1
Compare
3718447 to
6c79f69
Compare
0f3bbd1 to
e69973f
Compare
f91f53d to
7322549
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d6b7023b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
409d632 to
5884694
Compare
Introduce the reusable node-cordon and pod-eviction/drain primitives that the per-manager evictors (EKS managed node groups, ASG, Karpenter, standalone) build on: - cordonNodes/cordonNode: idempotent, conflict-retrying cordon that treats an already-gone node as a silent skip and returns the cordoned Node objects. - drainNode: evicts every evictable pod (skipping mirror, DaemonSet, completed and terminating pods), then waits for the node to empty. - evictPodWithRetry: PDB-aware eviction that retries on 429 and treats 404 as success. - listPodsOnNode, waitForNodeEmpty and the pod-classification predicates (podOccupiesNode/shouldSkipEviction/isMirrorPod/isDaemonSetPod/isCompleted). These primitives have no production caller yet; the first (evictEKSManagedNode- Group) lands in the next PR in the stack. A temporary blank-identifier reference keeps golangci-lint's `unused` quiet until then (the linter runs with tests = false, so the unit tests do not count as use) and is removed by that PR.
Part of a stack splitting #3026 (too large to review in one piece) into small pieces that each build and pass tests on their own. The command is fully functional only once the whole stack lands.
5884694 to
eec5e58
Compare
47f7ed9 to
39bbf26
Compare
What does this PR do?
Implements EKS managed node group eviction (scale-to-zero then wait; EKS drains pods server-side, so it needs no client-side drain primitives).
Motivation
PR #3026 is too large to review as a single change. This is part 7 of 11 of a stack that splits it into small, individually-reviewable pieces that each build and pass tests on their own. See #3026 for the full feature context and end-to-end QA.
Additional Notes
Stacked PR — the base branch is
lenaic/CASCL-1386-evict-06-ec2-instance-id-helper, notmain, so the diff shows only this step's change. Implements an evictor the skeleton (part 1) left stubbed. The code is taken verbatim from #3026 (rebased ontomain); there are no logic changes versus #3026.Minimum Agent Versions
N/A —
kubectl-datadogplugin only.Describe your test plan
go test ./cmd/kubectl-datadog/autoscaling/cluster/...passes at this commit. Full end-to-end QA is tracked on #3026.Checklist
qa/skip-qalabel applied (not independently shippable; QA tracked on [CASCL-1386] Add evict-legacy-nodes subcommand to drain non-Datadog node groups #3026)