evict

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns the cobra command for `kubectl datadog autoscaling cluster evict-legacy-nodes`.

func Run

Run is the orchestrator entry point. Idempotent: a second invocation on a cluster already migrated returns success without changes. Crash-safe: a killed run leaves no permanently corrupting state — re-running cleans up.

Types

type EC2API

type EC2API interface {
	TerminateInstances(ctx context.Context, in *ec2.TerminateInstancesInput, opts ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)
}

type EKSManagedNodeGroupAPI

type EKSManagedNodeGroupAPI interface {
	UpdateNodegroupConfig(ctx context.Context, in *eks.UpdateNodegroupConfigInput, opts ...func(*eks.Options)) (*eks.UpdateNodegroupConfigOutput, error)
}

type RunOptions

type RunOptions struct {
	ClusterName        string
	KarpenterNamespace string // override; auto-detected when empty
	All                bool
	Targets            []Target // parsed --target=/
	SkipCA             bool
	EnsurePDBs         bool
	DryRun             bool
	Yes                bool
	EvictionTimeout    time.Duration
	NodeTimeout        time.Duration
	Debug              bool
}

type Target

type Target struct {
	Manager clusterinfo.NodeManager
	Entity  string
	Nodes   []string
}

Target identifies a single node-management entity to evict. The Entity field is the bucket name within `ClusterInfo.NodeManagement[Manager]` — an ASG name, an EKS managed node group name, a Karpenter NodePool name, or the empty string for the standalone bucket.

func BuildPlan

func BuildPlan(info *clusterinfo.ClusterInfo, all bool, specs []Target) ([]Target, error)

func ParseTargetSpec

func ParseTargetSpec(raw string) (Target, error)

ParseTargetSpec parses a CLI `--target` value into a Target with an empty Nodes slice (Nodes are filled in by BuildPlan from the cluster snapshot).

Format: `/`, with the entity omitted for the standalone manager. Fargate and unknown are rejected here — their migration is out of scope of this command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL