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 scalar types for most commonly used resource outputs #1445

Merged
merged 10 commits into from
Oct 16, 2024

Conversation

flostadler
Copy link
Contributor

@flostadler flostadler commented Oct 16, 2024

To ease the impact of the breaking API changes caused by generating the node SDK, we decided to add additional scalar inputs that simplify UX across all SDKs (for more details see internal doc).

This change adds the scalar properties mentioned in the doc and adds acceptance tests for them.
While adding the acceptance tests I noticed that running pods on Fargate doesn't work deterministically. In some cases the cluster fails to get healthy (coredns stuck in pending).
This was caused by a race-condition between coredns starting and the fargate profile being created. If the fargate profile deployed after coredns, the pods got stuck in pending because they got assigned to the default-scheduler instead of the fargate-scheduler.
The fix is relatively easy; making coredns depend on the fargate profile.

I'll separately update the migration guide.

New properties

Existing Resource New Top Level Property Description
clusterSecurityGroup: Output<aws.ec2.SecurityGroup | undefined> clusterSecurityGroupId: Output<string> Only really useful property of a security group. Used to add additional ingress/egress rules. Default to the EKS created security group id
nodeSecurityGroup: Output<aws.ec2.SecurityGroup | undefined> nodeSecurityGroupId: Output<string>
eksClusterIngressRule: Output<aws.ec2.SecurityGroupRule | undefined> clusterIngressRuleId: Output<string> Only really useful property of a rule. Default to ””
defaultNodeGroup: Output<eks.NodeGroupData | undefined> defaultNodeGroupAsgName: Output<string> The only useful property of the default node group is the auto scaling group. Exposing its name allows users to reference it in IAM roles, tags, etc. Default to ””
core fargateProfile: Output<aws.eks.FargateProfile | undefined> fargateProfileId: Output<string> The id of the fargate profile. Can be used to reference it. Default to ””
fargateProfileStatus: Output<string> The status of the fargate profile. Default to ””
oidcProvider: Output<aws.iam.OpenIdConnectProvider | undefined> oidcProviderArn: Output<string> & oidcProviderUrl: Output<string> & oidcIssuer: Output<string Arn and Url are properties needed to set up IAM identities for pods (required for the assume role policy of the IAM role). Users currently need to trim the https:// part of the url to actually use it. We should expose oidcProvider with that already done to ease usage.

Fixes #1041

@flostadler flostadler requested review from t0yv0 and a team October 16, 2024 09:36
@flostadler flostadler self-assigned this Oct 16, 2024
@flostadler flostadler added the needs-release/major Marking a PR to compute the next major version label Oct 16, 2024
{
parent,
provider,
dependsOn: fargateProfile.apply((profile) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the fix for the Fargate issues. I needed to include it here otherwise I couldn't test the changes in this PR.

Copy link

Does the PR have any schema changes?

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

@@ -1103,6 +1145,7 @@ func generateSchema(version semver.Version) schema.PackageSpec {
},
},
"eks:index:VpcCniAddon": {
IsComponent: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated to this PR, but I noticed this was incorrectly set and we had .get functions for this component.

@flostadler flostadler changed the title Add scalar types for most commonly used outputs Add scalar types for most commonly used resource outputs Oct 16, 2024
@@ -1077,10 +1077,18 @@
"$ref": "/aws/v6.18.2/schema.json#/provider",
"description": "The AWS resource provider."
},
"clusterIngressRuleId": {
Copy link
Member

Choose a reason for hiding this comment

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

The additions here can be copied into PR description to make searching easier. Referring to an internal doc is not that helpful for posterity. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it to the PR description

@@ -14,7 +14,7 @@ namespace Pulumi.Eks
/// For more information see: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html
/// </summary>
[EksResourceType("eks:index:VpcCniAddon")]
public partial class VpcCniAddon : global::Pulumi.CustomResource
public partial class VpcCniAddon : global::Pulumi.ComponentResource
Copy link
Member

Choose a reason for hiding this comment

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

Will this break things? Should we call it out? Or it is a new resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New resource, we added it as part of v3 but forgot to mark it as a component

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.

LGTM

@flostadler flostadler merged commit 1e2e4aa into release-3.x.x Oct 16, 2024
34 checks passed
@flostadler flostadler deleted the flostadler/scalar-types branch October 16, 2024 14:19
flostadler added a commit that referenced this pull request Oct 16, 2024
This change builds on top of
#1445 and makes `NodeGroup` &
`NodeGroupV2` accept the scalar security group properties introduced in
that PR.

This way users can connect their node groups to the cluster without
having to use any applies.
flostadler added a commit that referenced this pull request Oct 17, 2024
#1445 and
#1446 introduced new scalar
properties as a workaround to the breaking Node.js SDK changes.

This documents those in the migration guide.
flostadler added a commit that referenced this pull request Oct 17, 2024
To ease the impact of the breaking API changes caused by generating the
node SDK, we decided to add additional scalar inputs that simplify UX
across all SDKs (for more details [see internal
doc](https://docs.google.com/document/d/1f97nmDUG_nrZSllYxu_XSeI7ON8vhZzfVrdBTQQmZzw/edit#heading=h.fbweiu8gc5bw)).

This change adds the scalar properties mentioned in the doc and adds
acceptance tests for them.
While adding the acceptance tests I noticed that running pods on Fargate
doesn't work deterministically. In some cases the cluster fails to get
healthy (coredns stuck in pending).
This was caused by a race-condition between coredns starting and the
fargate profile being created. If the fargate profile deployed after
coredns, the pods got stuck in pending because they got assigned to the
`default-scheduler` instead of the `fargate-scheduler`.
The fix is relatively easy; making coredns depend on the fargate
profile.

I'll separately update the migration guide.

### New properties

| Existing Resource |  | New Top Level Property | Description |
| :---- | :---- | :---- | :---- |
| `clusterSecurityGroup: Output<aws.ec2.SecurityGroup \| undefined>` | |
`clusterSecurityGroupId: Output<string>` | Only really useful property
of a security group. Used to add additional ingress/egress rules.
Default to `the EKS created security group id` |
| `nodeSecurityGroup: Output<aws.ec2.SecurityGroup \| undefined>` | |
`nodeSecurityGroupId: Output<string>` | |
| `eksClusterIngressRule: Output<aws.ec2.SecurityGroupRule \|
undefined>` | | `clusterIngressRuleId: Output<string>` | Only really
useful property of a rule. Default to `””` |
| `defaultNodeGroup: Output<eks.NodeGroupData \| undefined>` | |
`defaultNodeGroupAsgName: Output<string>` | The only useful property of
the default node group is the auto scaling group. Exposing its name
allows users to reference it in IAM roles, tags, etc. Default to `””` |
| `core` | `fargateProfile: Output<aws.eks.FargateProfile \| undefined>`
| `fargateProfileId: Output<string>` | The id of the fargate profile.
Can be used to reference it. Default to `””` |
| | | `fargateProfileStatus: Output<string>` | The status of the fargate
profile. Default to `””` |
| | `oidcProvider: Output<aws.iam.OpenIdConnectProvider \| undefined>` |
`oidcProviderArn: Output<string>` & `oidcProviderUrl: Output<string>` &
`oidcIssuer: Output<string` | Arn and Url are properties needed to set
up IAM identities for pods (required for the assume role policy of the
IAM role). Users currently need to trim the `https://` part of the url
to actually use it. We should expose `oidcProvider` with that already
done to ease usage. |


Fixes #1041
flostadler added a commit that referenced this pull request Oct 17, 2024
This change builds on top of
#1445 and makes `NodeGroup` &
`NodeGroupV2` accept the scalar security group properties introduced in
that PR.

This way users can connect their node groups to the cluster without
having to use any applies.
flostadler added a commit that referenced this pull request Oct 17, 2024
#1445 and
#1446 introduced new scalar
properties as a workaround to the breaking Node.js SDK changes.

This documents those in the migration guide.
flostadler added a commit that referenced this pull request Oct 17, 2024
#1445 and
#1446 introduced new scalar
properties as a workaround to the breaking Node.js SDK changes.

This documents those in the migration guide.
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.0.0-beta.2.

flostadler added a commit that referenced this pull request Oct 17, 2024
To ease the impact of the breaking API changes caused by generating the
node SDK, we decided to add additional scalar inputs that simplify UX
across all SDKs (for more details [see internal
doc](https://docs.google.com/document/d/1f97nmDUG_nrZSllYxu_XSeI7ON8vhZzfVrdBTQQmZzw/edit#heading=h.fbweiu8gc5bw)).

This change adds the scalar properties mentioned in the doc and adds
acceptance tests for them.
While adding the acceptance tests I noticed that running pods on Fargate
doesn't work deterministically. In some cases the cluster fails to get
healthy (coredns stuck in pending).
This was caused by a race-condition between coredns starting and the
fargate profile being created. If the fargate profile deployed after
coredns, the pods got stuck in pending because they got assigned to the
`default-scheduler` instead of the `fargate-scheduler`.
The fix is relatively easy; making coredns depend on the fargate
profile.

I'll separately update the migration guide.

### New properties

| Existing Resource |  | New Top Level Property | Description |
| :---- | :---- | :---- | :---- |
| `clusterSecurityGroup: Output<aws.ec2.SecurityGroup \| undefined>` | |
`clusterSecurityGroupId: Output<string>` | Only really useful property
of a security group. Used to add additional ingress/egress rules.
Default to `the EKS created security group id` |
| `nodeSecurityGroup: Output<aws.ec2.SecurityGroup \| undefined>` | |
`nodeSecurityGroupId: Output<string>` | |
| `eksClusterIngressRule: Output<aws.ec2.SecurityGroupRule \|
undefined>` | | `clusterIngressRuleId: Output<string>` | Only really
useful property of a rule. Default to `””` |
| `defaultNodeGroup: Output<eks.NodeGroupData \| undefined>` | |
`defaultNodeGroupAsgName: Output<string>` | The only useful property of
the default node group is the auto scaling group. Exposing its name
allows users to reference it in IAM roles, tags, etc. Default to `””` |
| `core` | `fargateProfile: Output<aws.eks.FargateProfile \| undefined>`
| `fargateProfileId: Output<string>` | The id of the fargate profile.
Can be used to reference it. Default to `””` |
| | | `fargateProfileStatus: Output<string>` | The status of the fargate
profile. Default to `””` |
| | `oidcProvider: Output<aws.iam.OpenIdConnectProvider \| undefined>` |
`oidcProviderArn: Output<string>` & `oidcProviderUrl: Output<string>` &
`oidcIssuer: Output<string` | Arn and Url are properties needed to set
up IAM identities for pods (required for the assume role policy of the
IAM role). Users currently need to trim the `https://` part of the url
to actually use it. We should expose `oidcProvider` with that already
done to ease usage. |


Fixes #1041
flostadler added a commit that referenced this pull request Oct 17, 2024
This change builds on top of
#1445 and makes `NodeGroup` &
`NodeGroupV2` accept the scalar security group properties introduced in
that PR.

This way users can connect their node groups to the cluster without
having to use any applies.
flostadler added a commit that referenced this pull request Oct 17, 2024
#1445 and
#1446 introduced new scalar
properties as a workaround to the breaking Node.js SDK changes.

This documents those in the migration guide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-release/major Marking a PR to compute the next major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants