Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing configuration options for Managed Node Groups #1339

Conversation

flostadler
Copy link
Contributor

@flostadler flostadler commented Sep 5, 2024

The ManagedNodeGroup component was missing configuration the other node groups had.
In detail, that's amiId, gpu and userData.

Those will allow booting specific/custom AMIs, nodes with GPUs or setting custom user data.
The added E2E tests ensure this works as expected.

Relates to #1224

@flostadler flostadler self-assigned this Sep 5, 2024
@flostadler flostadler requested review from corymhall, rquitales, t0yv0 and a team September 5, 2024 20:56
Copy link

github-actions bot commented Sep 5, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@flostadler flostadler marked this pull request as ready for review September 5, 2024 20:59
@flostadler flostadler force-pushed the flostadler/mng-better-configs branch 2 times, most recently from 4be30e4 to e85b6e5 Compare September 6, 2024 07:49
@flostadler flostadler force-pushed the flostadler/bottlerocket-disk-size branch from de0d23c to 50b96a5 Compare September 6, 2024 12:26
@flostadler
Copy link
Contributor Author

flostadler commented Sep 6, 2024

The diff got messed up when the base PR got rebased. Will need to untangle this..
DONE

@flostadler flostadler marked this pull request as draft September 6, 2024 12:29
@flostadler flostadler marked this pull request as ready for review September 6, 2024 12:35
Base automatically changed from flostadler/bottlerocket-disk-size to flostadler/al2023-bottlerocket-support September 6, 2024 13:52
@t0yv0
Copy link
Member

t0yv0 commented Sep 6, 2024

Does this cover #1224 GPU support?

"See for more details: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html#launch-template-user-data.",
},
"gpu": {
TypeSpec: schema.TypeSpec{Type: "boolean"},
Copy link
Member

Choose a reason for hiding this comment

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

Would this be any better with defining the explicit default in the schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to know whether it's false or not defined. There's certain combinations that do not work (e.g. you cannot choose an AMI with GPU and then set GPU to false).
Is my understanding wrong that we'd receive false in the provider in that case?

},
"amiId": {
TypeSpec: schema.TypeSpec{Type: "string"},
Description: "The AMI ID to use for the worker nodes.\nDefaults to the latest recommended " +
Copy link
Member

Choose a reason for hiding this comment

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

Likewise, should schema define Default: "latest" or some such?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default value here is not "latest". The provider performs actions in the background to fetch the latest recommended AMI ID.

Copy link
Member

Choose a reason for hiding this comment

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

So it does so when amiId is empty/undefined, the provider does the search. OK, I guess the current form is the best.

@@ -2105,9 +2163,6 @@ function getRecommendedAMI(
k8sVersion: pulumi.Output<string>,
parent: pulumi.Resource | undefined,
): pulumi.Input<string> {
// TODO[pulumi/pulumi-eks#1195]: Add gpu argument to ManagedNodeGroupOptions
Copy link
Member

Choose a reason for hiding this comment

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

Is this todo fixed by this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!

@flostadler
Copy link
Contributor Author

Does this cover #1224 GPU support?

Yes it does! I folded that into this PR because it's relevant here as well. (added this to the PR description)

amiIdMutuallyExclusive.forEach((key) => {
if (args.amiId && args[key]) {
throw new pulumi.ResourceError(
`amiId and ${key} are mutually exclusive to create a managed node group`,
Copy link
Member

Choose a reason for hiding this comment

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

The grammar here seems a little funny (but also I'm not a native speaker). Feed it to LLM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually copied the grammar from a similar error message from above. But now that you're saying this it also sounds weird to me (also not native speaker).

Let me reword those.

operatingSystem: eks.OperatingSystem.Bottlerocket,
instanceTypes: ["g5g.xlarge"],
nodeRole: role,
gpu: true,
Copy link
Member

Choose a reason for hiding this comment

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

Neat.

Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

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

🚢

The settings with exclusivity constraints are getting a bit tricky to reason about but maybe fine for now. If this continues to grow we could try an internal TypeScript union model to parse into with several variants of settings.

@flostadler flostadler merged commit 46f69fe into flostadler/al2023-bottlerocket-support Sep 6, 2024
34 checks passed
@flostadler flostadler deleted the flostadler/mng-better-configs branch September 6, 2024 17:13
flostadler added a commit that referenced this pull request Sep 13, 2024
The `ManagedNodeGroup` component was missing configuration the other
node groups had.
In detail, that's `amiId`, `gpu` and `userData`.

Those will allow booting specific/custom AMIs, nodes with GPUs or
setting custom user data.
The added E2E tests ensure this works as expected.

Relates to #1224
flostadler added a commit that referenced this pull request Oct 17, 2024
The `ManagedNodeGroup` component was missing configuration the other
node groups had.
In detail, that's `amiId`, `gpu` and `userData`.

Those will allow booting specific/custom AMIs, nodes with GPUs or
setting custom user data.
The added E2E tests ensure this works as expected.

Relates to #1224
flostadler added a commit that referenced this pull request Oct 17, 2024
The `ManagedNodeGroup` component was missing configuration the other
node groups had.
In detail, that's `amiId`, `gpu` and `userData`.

Those will allow booting specific/custom AMIs, nodes with GPUs or
setting custom user data.
The added E2E tests ensure this works as expected.

Relates to #1224
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.

2 participants