[CASCL-1386] Add e2e tests for autoscaling cluster evict-legacy-nodes - #3230
Draft
L3n41c wants to merge 1 commit into
Draft
[CASCL-1386] Add e2e tests for autoscaling cluster evict-legacy-nodes#3230L3n41c wants to merge 1 commit into
L3n41c wants to merge 1 commit into
Conversation
Adds TestEvictLegacyNodes to the autoscaling e2e suite, covering the evict-legacy-nodes subcommand end-to-end against the shared EKS cluster: refusal when Karpenter is not installed, flag validation, a dry-run that mutates nothing, a real --all drain of the EKS managed node groups onto Datadog-managed Karpenter NodePools, and idempotency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎯 Code Coverage (details) 🔗 Commit SHA: e92e2b2 | Docs | Datadog PR Page | Give us feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
TestEvictLegacyNodesto the autoscaling e2e suite (test/e2e/tests/autoscaling_suite/), giving thekubectl datadog autoscaling cluster evict-legacy-nodessubcommand its first end-to-end coverage. The subtests run sequentially on the shared EKS cluster, in a deliberately ordered flow:--dry-runso a violated precondition can never destructively drain the cluster).--all/--target, missing target, non-positive--eviction-timeout, and the rejectedfargatetarget (all fail invalidate()before any cluster call).--all --dry-runproduces a plan, cordons nothing, and leaves the legacy managed node groups intact.--alleviction; verifies the EKS managed node groups are drained to zero and every workload pod reschedules onto a Datadog-managed Karpenter node.--allrun is a no-op (Nothing to evict).Motivation
evict-legacy-nodes(CASCL-1386) was merged across ~a dozen PRs with thorough unit coverage but no e2e coverage, unlike its siblingsinstall/uninstall/update. This closes that gap and validates the orchestrator end-to-end (preconditions, dry-run safety, the real cordon→drain→scale-to-zero→reschedule path, and idempotency) against a live cluster.Additional Notes
runKubectlDatadog,testInstall,testUninstall,waitForAllPodsRunning,waitForPendingPods) and the shared anti-affinity workload; a newrunEvicthelper centralizes the CLI prefix. It reuses the production constantaws.LabelEKSNodegroupso the test stays coupled to the label the drain code actually keys off.e2e_autoscalingjob'schangesrule already coverstest/e2e/tests/autoscaling_suite/**/*, andmake e2e-autoscaling-testsbuildsbin/kubectl-datadogfirst.Jira: CASCL-1386
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
go vetandgofmtpass on the new file.e2e_autoscalingGitLab CI job, which builds the plugin and runsmake e2e-autoscaling-tests. The new subtests add roughly one extra install + drain + uninstall cycle to the suite runtime.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel🤖 Generated with Claude Code