Skip to content

feat: add EC2NodeClass placement group support#9013

Open
rocketbitz wants to merge 1 commit intoaws:mainfrom
rocketbitz:feature/placement-groups
Open

feat: add EC2NodeClass placement group support#9013
rocketbitz wants to merge 1 commit intoaws:mainfrom
rocketbitz:feature/placement-groups

Conversation

@rocketbitz
Copy link
Copy Markdown

Addresses #3324

Description

Adds placement group support to EC2NodeClass by allowing Karpenter to reference an existing EC2 placement group
during instance launch.

This PR adds:

  • spec.placementGroup with exactly one of name or id
  • optional partition support for partition placement groups
  • status.placementGroup and PlacementGroupReady
  • placement group resolution and validation in the nodeclass controller
  • launch template placement-group wiring
  • tests, docs, example manifest, and generated CRD/deepcopy updates

This design intentionally does not create, delete, or mutate placement groups. Karpenter only references an existing
placement group, which keeps the feature aligned with the existing EC2NodeClass model for AWS resources.

How was this change tested?

  • Added API validation coverage for spec.placementGroup
  • Added nodeclass reconciliation tests for placement group resolution and validation
  • Added launch template tests covering placement group name/id/partition wiring
  • Ran compile-only package checks:
    • env GOCACHE=/tmp/karpenter-provider-aws-gocache go test -run '^$' ./pkg/apis/v1/... ./pkg/controllers/ nodeclass/... ./pkg/providers/launchtemplate/... ./pkg/providers/placementgroup/...
    • env GOCACHE=/tmp/karpenter-provider-aws-gocache go test -run '^$' ./cmd/controller/... ./kwok/... ./pkg/ operator/... ./pkg/controllers/...

Full envtest-backed suites were not run locally because this environment does not have local kubebuilder assets
installed (/usr/local/kubebuilder/bin/etcd missing).

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rocketbitz rocketbitz force-pushed the feature/placement-groups branch from a1d1c51 to 6887380 Compare March 14, 2026 20:28
@rocketbitz rocketbitz force-pushed the feature/placement-groups branch from 6887380 to fa1a97a Compare March 14, 2026 20:50
@rocketbitz rocketbitz marked this pull request as ready for review March 14, 2026 20:51
@rocketbitz rocketbitz requested a review from a team as a code owner March 14, 2026 20:51
@rocketbitz rocketbitz requested a review from Sarthug99 March 14, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant