Skip to content

Nodegroups eks fargate eks - #1523

Merged
hectorvent merged 2 commits into
mainfrom
nodegroupsEks_FargateEks
Jul 15, 2026
Merged

Nodegroups eks fargate eks#1523
hectorvent merged 2 commits into
mainfrom
nodegroupsEks_FargateEks

Conversation

@IoannisLafiotis

Copy link
Copy Markdown
Contributor

Summary

  • New feature (feat:)
    Branch: nodegroupsEks_FargateEks

Commits:

  • c50f388 Testintg on node groups and fargate profiles

    • Added service-level EKS tests for nodegroup support.
    • Added service-level EKS tests for Fargate profile support.
    • Covered create, describe, list, delete, duplicate, missing cluster, missing name, and not-found behavior.
  • 7b27f4e Add EKS SDK nodegroup and Fargate tests

    • Added AWS SDK compatibility lifecycle tests for EKS nodegroups.
    • Added AWS SDK compatibility lifecycle tests for EKS Fargate profiles.
    • Added cleanup for partially created SDK test resources.
    • Removed Mockito from EksServiceTest setup to avoid JDK 25 inline mock attachment failures.

Verification:

  • JAVA_HOME=/Users/ioannislafiotis/.sdkman/candidates/java/25.0.1-amzn ./mvnw -Dtest=EksServiceTest test passed.
  • ../../mvnw -DskipTests test-compile passed in compatibility-tests/sdk-test-java.

@hectorvent hectorvent added feature eks Amazon Elastic Kubernetes Service (EKS) labels Jun 25, 2026
@hectorvent

hectorvent commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for putting this together, the node group and Fargate profile support is a great addition and the wire shapes look spot on. I checked the paths, response wrappers, field casing, the FargateProfileStatus enum, and the error codes against service-2.json and they all match AWS. Nice work.

A couple of things worth a look before this is ready.

Node groups and Fargate profiles stay in CREATING forever. In EksService.java create sets the status to CREATING, but the readiness poller only advances clusters, so describe always returns CREATING and never ACTIVE. The previous code set node groups to ACTIVE right away, and moto does the same for both resources, so this is a small regression. The practical impact is that SDK waiters like NodegroupActive and tools like eksctl or terraform will hang waiting for a state that never arrives. Either set ACTIVE immediately in mock mode like before, or teach the poller to advance these too.

The diff got reindented from 4 spaces to 2. Most of the line count in EksController.java and EksService.java is whitespace, which makes the real changes hard to spot and drops the comment explaining why the node group routes are declared explicitly (they have to outrank the S3 catch all, issue #1137). Reverting the formatting so only the new endpoints show would help a lot.

Smaller notes:

  • The new createNodeGroup path in EksService.java no longer validates nodeRole and subnets, which AWS marks as required. The old code rejected those.
  • There are duplicate method pairs now (createNodegroup and createNodeGroup, etc.), probably worth collapsing to one.

Also the CI is red on a few checks, could you take a look? Build and Test, the native image build, sdk-test-go, and the Conventional Commits check are all failing. The commit titles like Testintg on node groups will need the feat: prefix to pass that last one.

Example of the stuck status:

aws eks create-nodegroup ...   # status: CREATING
aws eks describe-nodegroup ... # status: CREATING  (never becomes ACTIVE)

Thanks again, this is close and the protocol side is solid.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds EKS node group and Fargate profile support to the emulator — covering create, describe, list, and delete operations — through a new dedicated request model (CreateNodeGroupRequest, CreateFargateProfileRequest), updated controller routes, and a new fargateProfileStorage backend. It also resolves several issues flagged in the previous review round.

  • Node group and Fargate profile CRUD: EksService gains six new public methods; EksController registers the corresponding JAX-RS routes under /clusters/{name}/node-groups and /clusters/{name}/fargate-profiles, backed by prefix-keyed in-memory stores.
  • Version and ARN fixes: Node group version now inherits from the cluster when not supplied by the caller; both node group and Fargate profile ARNs include a UUID segment to match real AWS format.
  • Test coverage: EksServiceTest is rewritten without Mockito (JDK 25 compatibility), adding 14 focused unit tests; EksNodegroupIntegrationTest is updated; EksTest (SDK compatibility) gains full lifecycle tests for both resource types with proper cleanup in @AfterAll.

Confidence Score: 5/5

Safe to merge — all previously reported issues are resolved and no new defects were found.

The delegation compile error, incorrect doc paths, missing UUID in the Fargate ARN, and hardcoded nodegroup version are all fixed. The new Fargate profile and nodegroup implementations are consistent with the existing cluster pattern: cluster existence is validated before every operation, duplicate detection is in place, storage keys use a stable prefix scheme, and both ARNs include a random UUID segment. The Mockito removal in EksServiceTest works correctly because the @PostConstruct guard ensures the null EksClusterManager is never reached in mock mode. Test coverage across unit, integration, and SDK compatibility layers is thorough.

No files require special attention.

Important Files Changed

Filename Overview
src/main/java/io/github/hectorvent/floci/services/eks/EksService.java Core service layer refactored to use dedicated request models, adds Fargate profile CRUD, fixes version inheritance from cluster, and includes UUID in both ARN types.
src/main/java/io/github/hectorvent/floci/services/eks/EksController.java Added four new JAX-RS routes for Fargate profile CRUD; nodegroup methods updated to use renamed service methods and typed request model.
src/main/java/io/github/hectorvent/floci/services/eks/model/FargateProfile.java New model class for Fargate profiles with nested Selector, Health, and Issue types; accountId correctly excluded from serialization via @JsonIgnore.
src/main/java/io/github/hectorvent/floci/services/eks/model/CreateNodeGroupRequest.java New dedicated request model separating create-time input from the stored Nodegroup response shape.
src/main/java/io/github/hectorvent/floci/services/eks/model/CreateFargateProfileRequest.java New request model for Fargate profile creation; all AWS API fields present including selectors and clientRequestToken.
src/test/java/io/github/hectorvent/floci/services/eks/EksServiceTest.java Completely rewritten without Mockito using JDK dynamic proxies; adds 14 unit tests covering nodegroup and Fargate profile CRUD, validation, and error paths.
compatibility-tests/sdk-test-java/src/test/java/com/floci/test/EksTest.java Added full lifecycle tests for nodegroups and Fargate profiles at orders 8-9, with proper cleanup in @afterall; ARN assertions now correctly require the UUID suffix segment.
src/main/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationResourceProvisioner.java Two call sites updated from old camelCase method names to renamed methods (deleteNodeGroup/createNodeGroup).
src/test/java/io/github/hectorvent/floci/services/eks/EksNodegroupIntegrationTest.java Test method renames and status assertion tightened from anyOf(ACTIVE, CREATING) to equalTo(ACTIVE), reflecting immediate-active emulator behaviour.
docs/services/eks.md Documents new nodegroup and Fargate profile endpoints with correct /node-groups and /fargate-profiles paths, ARN formats, and curl examples.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Client as AWS SDK / curl
    participant Ctrl as EksController
    participant Svc as EksService
    participant NGStore as nodeGroupStorage
    participant FPStore as fargateProfileStorage
    participant CStore as clusterStorage

    Client->>Ctrl: "POST /clusters/{name}/node-groups"
    Ctrl->>Svc: createNodeGroup(name, CreateNodeGroupRequest)
    Svc->>Svc: map request to Nodegroup
    Svc->>CStore: describeCluster(name) [validates cluster exists]
    Svc->>NGStore: get(clusterName/ngName) [duplicate check]
    Svc->>NGStore: put(clusterName/ngName, Nodegroup)
    Svc-->>Ctrl: Nodegroup (ACTIVE)
    Ctrl-->>Client: "200 {nodegroup: ...}"

    Client->>Ctrl: "POST /clusters/{name}/fargate-profiles"
    Ctrl->>Svc: createFargateProfile(name, CreateFargateProfileRequest)
    Svc->>CStore: describeCluster(name) [validates cluster exists]
    Svc->>FPStore: get(clusterName/profileName) [duplicate check]
    Svc->>FPStore: put(clusterName/profileName, FargateProfile)
    Svc-->>Ctrl: FargateProfile (ACTIVE)
    Ctrl-->>Client: "200 {fargateProfile: ...}"

    Client->>Ctrl: "DELETE /clusters/{name}/node-groups/{ngName}"
    Ctrl->>Svc: deleteNodeGroup(name, ngName)
    Svc->>NGStore: "get -> Nodegroup"
    Svc->>NGStore: delete(clusterName/ngName)
    Svc-->>Ctrl: Nodegroup (DELETING)
    Ctrl-->>Client: "200 {nodegroup: {status: DELETING}}"
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Client as AWS SDK / curl
    participant Ctrl as EksController
    participant Svc as EksService
    participant NGStore as nodeGroupStorage
    participant FPStore as fargateProfileStorage
    participant CStore as clusterStorage

    Client->>Ctrl: "POST /clusters/{name}/node-groups"
    Ctrl->>Svc: createNodeGroup(name, CreateNodeGroupRequest)
    Svc->>Svc: map request to Nodegroup
    Svc->>CStore: describeCluster(name) [validates cluster exists]
    Svc->>NGStore: get(clusterName/ngName) [duplicate check]
    Svc->>NGStore: put(clusterName/ngName, Nodegroup)
    Svc-->>Ctrl: Nodegroup (ACTIVE)
    Ctrl-->>Client: "200 {nodegroup: ...}"

    Client->>Ctrl: "POST /clusters/{name}/fargate-profiles"
    Ctrl->>Svc: createFargateProfile(name, CreateFargateProfileRequest)
    Svc->>CStore: describeCluster(name) [validates cluster exists]
    Svc->>FPStore: get(clusterName/profileName) [duplicate check]
    Svc->>FPStore: put(clusterName/profileName, FargateProfile)
    Svc-->>Ctrl: FargateProfile (ACTIVE)
    Ctrl-->>Client: "200 {fargateProfile: ...}"

    Client->>Ctrl: "DELETE /clusters/{name}/node-groups/{ngName}"
    Ctrl->>Svc: deleteNodeGroup(name, ngName)
    Svc->>NGStore: "get -> Nodegroup"
    Svc->>NGStore: delete(clusterName/ngName)
    Svc-->>Ctrl: Nodegroup (DELETING)
    Ctrl-->>Client: "200 {nodegroup: {status: DELETING}}"
Loading

Reviews (4): Last reviewed commit: "docs: sync generated action tables" | Re-trigger Greptile

Comment thread src/main/java/io/github/hectorvent/floci/services/eks/EksService.java Outdated
Comment thread src/main/java/io/github/hectorvent/floci/services/eks/EksService.java Outdated
Comment thread docs/services/eks.md Outdated
Comment thread src/main/java/io/github/hectorvent/floci/services/eks/EksService.java Outdated
Comment thread src/main/java/io/github/hectorvent/floci/services/eks/EksService.java Outdated
@hectorvent

Copy link
Copy Markdown
Collaborator

@IoannisLafiotis check greptile comments.

@IoannisLafiotis
IoannisLafiotis force-pushed the nodegroupsEks_FargateEks branch from 0b393c1 to 8f4ea6e Compare July 8, 2026 13:47
@hectorvent

Copy link
Copy Markdown
Collaborator

Nice work on the Fargate profile side. I checked the shapes against botocore's service-2.json and FargateProfile, FargateProfileStatus and the fargateProfileNames list response all match. Adding the cluster existence check to the describe and list paths is a real fix too.

One thing to sort before merge. CreateNodegroup now drops remoteAccess, taints, launchTemplate and nodeRepairConfig. The controller used to bind straight into Nodegroup and the service mutated that object in place, so whatever the client sent came back. Now CreateNodeGroupRequest only declares 14 of the 18 input members and EksService.createNodeGroup builds a fresh Nodegroup from an explicit field list, so those four disappear from the create response and from every later DescribeNodegroup.

// sent
{"nodegroupName":"ng1","nodeRole":"...","subnets":["subnet-abc"],
 "taints":[{"key":"dedicated","value":"gpu","effect":"NO_SCHEDULE"}]}

// returned
{"nodegroup":{"nodegroupName":"ng1","nodeRole":"...","subnets":["subnet-abc"]}}

All four are on the Nodegroup output shape, and Terraform reads every one of them back on refresh (remote_access, taint, launch_template, node_repair_config in node_group.go), so an aws_eks_node_group with a taint or a launch template will show permanent drift. Adding the four properties to the request DTO and copying them alongside the rest should cover it.

Two smaller notes, neither blocking:

defaultScalingConfig() moved from min=1, max=2, desired=2 to 1/1/1. botocore doesn't document a default, but moto uses 2/2/2 and the AWS docs say maxSize defaults to 2, so the new value matches neither and nothing in the PR explains the change.

The Mockito removal in EksServiceTest probably isn't needed. 95 other test files use Mockito and they pass on the project JDK 25.0.3, so the inline mock failure looks like a local 25.0.1-amzn toolchain thing rather than a repo one. Keeping Mockito would shrink the diff.

@hectorvent hectorvent self-assigned this Jul 15, 2026

@hectorvent hectorvent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @IoannisLafiotis,
Solid implementation

@hectorvent
hectorvent merged commit 095e167 into main Jul 15, 2026
17 checks passed
Preston-Cai pushed a commit to Preston-Cai/floci that referenced this pull request Jul 22, 2026
* feat(eks): add nodegroups and fargate profiles

* docs: sync generated action tables
@hectorvent
hectorvent deleted the nodegroupsEks_FargateEks branch July 30, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eks Amazon Elastic Kubernetes Service (EKS) feature waiting-contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants