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

Expose KubeletExtraArgs and BootstrapExtraArgs for managed nodegroups #1131

Merged
merged 8 commits into from
May 17, 2024

Conversation

rquitales
Copy link
Member

@rquitales rquitales commented Apr 24, 2024

Proposed changes

This PR enables setting kubelet and bootstrap extra args by creating a custom launch template if the arguments are supplied. Existing ManagedNodeGroups will not have a diff since we only create and use a custom launch template if these options are used by the Pulumi program.

Tests:

  • Updated existing NodeJS and Golang test cases to ensure MNGs can supply kubelet extra args and the launch template is used
  • Manually tested and verified within the AWS console that the user data is set correctly when these options are supplied

Related issues (optional)

Closes: #611

Copy link

Does the PR have any schema changes?

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

@rquitales rquitales force-pushed the rquitales/expose-kubeletextraargs branch from 1e4fb97 to 5a8a4b9 Compare April 24, 2024 20:53
Copy link

Does the PR have any schema changes?

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

Copy link

github-actions bot commented May 9, 2024

Does the PR have any schema changes?

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

@rquitales
Copy link
Member Author

Upgrade tests are failing due to kubeconfig diff and AMI ID diffs (see #1145). This is expected, and no other diffs are observed.

@rquitales rquitales marked this pull request as ready for review May 10, 2024 19:50
@rquitales rquitales force-pushed the rquitales/expose-kubeletextraargs branch from dcaec6f to d3725d7 Compare May 10, 2024 23:06
Copy link

Does the PR have any schema changes?

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

@rquitales rquitales requested review from thomas11, t0yv0 and a team May 13, 2024 18:45
Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

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

edit: whoops ignore me

provider/cmd/pulumi-resource-eks/schema.json Show resolved Hide resolved
nodejs/eks/nodegroup.ts Outdated Show resolved Hide resolved
@@ -830,6 +831,30 @@ func generateSchema() schema.PackageSpec {
"version": {
TypeSpec: schema.TypeSpec{Type: "string"},
},
"kubeletExtraArgs": {
Copy link
Member

Choose a reason for hiding this comment

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

I'm remembering now that TF has a ConflictsWith helper which we don't (yet?) have, could be a useful shorthand for marking mutually exclusive fields.

@t0yv0 t0yv0 self-requested a review May 16, 2024 21:32
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 changes look good to me code-wise. I don't have a good concept of the use-cases here though FWIW. I had the same question on whether string or []string (or both?) is user friendly, sounds like it's beeing considered.

@rquitales rquitales force-pushed the rquitales/expose-kubeletextraargs branch from d3725d7 to 5bcd157 Compare May 17, 2024 19:00
Copy link

Does the PR have any schema changes?

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

@rquitales
Copy link
Member Author

Will be leaving the input as a string in this PR to maintain consistency with the other nodegroup resource to make it less jarring for users managing both types of resources. We can look into extending the type to be a string array in the future.

@rquitales rquitales merged commit 6d04bbe into master May 17, 2024
39 of 40 checks passed
@rquitales rquitales deleted the rquitales/expose-kubeletextraargs branch May 17, 2024 20:08
rquitales added a commit that referenced this pull request May 21, 2024
### Proposed changes
Exposes a new option for ManagedNodeGroups to enable IMDSv2. This PR is
stacked on top of #1131 which allows the creation of a LaunchTemplate to
implement these features.

Manual testing was done to ensure that we can create a ManagedNodeGroup
with IMDSv2 enabled using instructions from:
https://stackoverflow.com/questions/64595032/how-to-tell-what-version-of-instance-metadata-serviceimds-ec2-instance-is-usin

### Related issues (optional)

Fixes: #682
@@ -1677,13 +1710,57 @@ function createManagedNodeGroupInternal(
};
}),
subnetIds: subnetIds,
launchTemplate: launchTemplate ? { id: launchTemplate.id, version: launchTemplate.latestVersion.apply((version) => {return `${version}`})} : undefined,

Choose a reason for hiding this comment

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

Hi @rquitales, I believe with this line you're effectively discarding args.launchTemplate, thus causing #1193

flostadler pushed a commit that referenced this pull request Sep 4, 2024
…#1131)

### Proposed changes

This PR enables setting kubelet and bootstrap extra args by creating a
custom launch template if the arguments are supplied. Existing
ManagedNodeGroups will not have a diff since we only create and use a
custom launch template if these options are used by the Pulumi program.

#### Tests:

- Updated existing NodeJS and Golang test cases to ensure MNGs can
supply kubelet extra args and the launch template is used
- Manually tested and verified within the AWS console that the user data
is set correctly when these options are supplied

### Related issues (optional)
Closes: #611
flostadler pushed a commit that referenced this pull request Sep 4, 2024
### Proposed changes
Exposes a new option for ManagedNodeGroups to enable IMDSv2. This PR is
stacked on top of #1131 which allows the creation of a LaunchTemplate to
implement these features.

Manual testing was done to ensure that we can create a ManagedNodeGroup
with IMDSv2 enabled using instructions from:
https://stackoverflow.com/questions/64595032/how-to-tell-what-version-of-instance-metadata-serviceimds-ec2-instance-is-usin

### Related issues (optional)

Fixes: #682
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.

Add kubeletExtraArgs to ManagedNodeGroup opts
5 participants