Skip to content

Commit

Permalink
Add parameter for configuring monitoring options of NodeGroups (#1149)
Browse files Browse the repository at this point in the history
Expose parameter for configuring monitoring settings of NodeGroups.
With detailed monitoring, all metrics, including status check metrics,
are available in 1-minute intervals. When enabled, you can also get
aggregated data across groups of similar instances.

What's notable that this cannot be turned on for ManagedNodeGroups
because AWS doesn't expose controls for the underlying ASG
(aws/containers-roadmap#762)

Closes #1032
  • Loading branch information
flostadler committed May 15, 2024
1 parent 3ee2bd5 commit a1e2711
Show file tree
Hide file tree
Showing 21 changed files with 515 additions and 6 deletions.
7 changes: 4 additions & 3 deletions examples/cluster-go/step1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func main() {
// https://github.com/pulumi/pulumi-eks/pull/813
cluster3, err := eks.NewCluster(ctx, "example-cluster-3", &eks.ClusterArgs{
NodeGroupOptions: &eks.ClusterNodeGroupOptionsArgs{
DesiredCapacity: pulumi.IntPtr(2),
MinSize: pulumi.IntPtr(2),
MaxSize: pulumi.IntPtr(2),
DesiredCapacity: pulumi.IntPtr(2),
MinSize: pulumi.IntPtr(2),
MaxSize: pulumi.IntPtr(2),
EnableDetailedMonitoring: pulumi.Bool(false),
},
})
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions examples/cluster-go/step2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ func main() {
// https://github.com/pulumi/pulumi-eks/pull/813
cluster3, err := eks.NewCluster(ctx, "example-cluster-3", &eks.ClusterArgs{
NodeGroupOptions: &eks.ClusterNodeGroupOptionsArgs{
DesiredCapacity: pulumi.IntPtr(2),
MinSize: pulumi.IntPtr(2),
MaxSize: pulumi.IntPtr(2),
DesiredCapacity: pulumi.IntPtr(2),
MinSize: pulumi.IntPtr(2),
MaxSize: pulumi.IntPtr(2),
EnableDetailedMonitoring: pulumi.Bool(false),
},
})
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions examples/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const cluster3 = new eks.Cluster(`${projectName}-3`, {
minSize: 1,
maxSize: 1,
instanceType: "t3.small",
enableDetailedMonitoring: false,
}
})

Expand Down
15 changes: 15 additions & 0 deletions nodejs/eks/nodegroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ export interface NodeGroupBaseOptions {
* `autoScalingGroupTags` or `cloudFormationTags`, but not both.
*/
cloudFormationTags?: InputTags;

/**
* Enables/disables detailed monitoring of the EC2 instances.
*
* With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.
* When enabled, you can also get aggregated data across groups of similar instances.
*
* Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.
* For more information, see "Paid tier" and "Example 1 - EC2 Detailed Monitoring" here https://aws.amazon.com/cloudwatch/pricing/.
*/
enableDetailedMonitoring?: pulumi.Input<boolean>;
}

/**
Expand Down Expand Up @@ -795,6 +806,7 @@ ${customUserData}
deleteOnTermination: args.nodeRootVolumeDeleteOnTermination ?? true,
},
userData: args.nodeUserDataOverride || userdata,
enableMonitoring: args.enableDetailedMonitoring,
},
{ parent, provider },
);
Expand Down Expand Up @@ -1219,6 +1231,9 @@ ${customUserData}
metadataOptions: args.metadataOptions,
userData: userdata,
tagSpecifications: args.launchTemplateTagSpecifications,
monitoring: {
enabled: args.enableDetailedMonitoring,
},
},
{ parent, provider },
);
Expand Down
10 changes: 10 additions & 0 deletions provider/cmd/pulumi-gen-eks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,16 @@ func nodeGroupProperties(cluster, v2 bool) map[string]schema.PropertySpec {
"should either supply the tag in `autoScalingGroupTags` or `cloudFormationTags`, but not " +
"both.",
},
"enableDetailedMonitoring": {
TypeSpec: schema.TypeSpec{
Type: "boolean",
},
Description: "Enables/disables detailed monitoring of the EC2 instances.\n\n" +
"With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.\n" +
"When enabled, you can also get aggregated data across groups of similar instances.\n\n" +
"Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.\n" +
"For more information, see \"Paid tier\" and \"Example 1 - EC2 Detailed Monitoring\" here https://aws.amazon.com/cloudwatch/pricing/.",
},
}

if cluster {
Expand Down
12 changes: 12 additions & 0 deletions provider/cmd/pulumi-resource-eks/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
"type": "integer",
"description": "The number of worker nodes that should be running in the cluster. Defaults to 2."
},
"enableDetailedMonitoring": {
"type": "boolean",
"description": "Enables/disables detailed monitoring of the EC2 instances.\n\nWith detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.\nWhen enabled, you can also get aggregated data across groups of similar instances.\n\nNote: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.\nFor more information, see \"Paid tier\" and \"Example 1 - EC2 Detailed Monitoring\" here https://aws.amazon.com/cloudwatch/pricing/."
},
"encryptRootBlockDevice": {
"type": "boolean",
"description": "Encrypt the root block device of the nodes in the node group."
Expand Down Expand Up @@ -1159,6 +1163,10 @@
"type": "integer",
"description": "The number of worker nodes that should be running in the cluster. Defaults to 2."
},
"enableDetailedMonitoring": {
"type": "boolean",
"description": "Enables/disables detailed monitoring of the EC2 instances.\n\nWith detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.\nWhen enabled, you can also get aggregated data across groups of similar instances.\n\nNote: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.\nFor more information, see \"Paid tier\" and \"Example 1 - EC2 Detailed Monitoring\" here https://aws.amazon.com/cloudwatch/pricing/."
},
"encryptRootBlockDevice": {
"type": "boolean",
"description": "Encrypt the root block device of the nodes in the node group."
Expand Down Expand Up @@ -1379,6 +1387,10 @@
"type": "integer",
"description": "The number of worker nodes that should be running in the cluster. Defaults to 2."
},
"enableDetailedMonitoring": {
"type": "boolean",
"description": "Enables/disables detailed monitoring of the EC2 instances.\n\nWith detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.\nWhen enabled, you can also get aggregated data across groups of similar instances.\n\nNote: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.\nFor more information, see \"Paid tier\" and \"Example 1 - EC2 Detailed Monitoring\" here https://aws.amazon.com/cloudwatch/pricing/."
},
"encryptRootBlockDevice": {
"type": "boolean",
"description": "Encrypt the root block device of the nodes in the node group."
Expand Down
12 changes: 12 additions & 0 deletions sdk/dotnet/Inputs/ClusterNodeGroupOptionsArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ public InputMap<string> CloudFormationTags
[Input("desiredCapacity")]
public Input<int>? DesiredCapacity { get; set; }

/// <summary>
/// Enables/disables detailed monitoring of the EC2 instances.
///
/// With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.
/// When enabled, you can also get aggregated data across groups of similar instances.
///
/// Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.
/// For more information, see "Paid tier" and "Example 1 - EC2 Detailed Monitoring" here https://aws.amazon.com/cloudwatch/pricing/.
/// </summary>
[Input("enableDetailedMonitoring")]
public Input<bool>? EnableDetailedMonitoring { get; set; }

/// <summary>
/// Encrypt the root block device of the nodes in the node group.
/// </summary>
Expand Down
12 changes: 12 additions & 0 deletions sdk/dotnet/NodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ public InputMap<string> CloudFormationTags
[Input("desiredCapacity")]
public Input<int>? DesiredCapacity { get; set; }

/// <summary>
/// Enables/disables detailed monitoring of the EC2 instances.
///
/// With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.
/// When enabled, you can also get aggregated data across groups of similar instances.
///
/// Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.
/// For more information, see "Paid tier" and "Example 1 - EC2 Detailed Monitoring" here https://aws.amazon.com/cloudwatch/pricing/.
/// </summary>
[Input("enableDetailedMonitoring")]
public Input<bool>? EnableDetailedMonitoring { get; set; }

/// <summary>
/// Encrypt the root block device of the nodes in the node group.
/// </summary>
Expand Down
12 changes: 12 additions & 0 deletions sdk/dotnet/NodeGroupV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ public InputMap<string> CloudFormationTags
[Input("desiredCapacity")]
public Input<int>? DesiredCapacity { get; set; }

/// <summary>
/// Enables/disables detailed monitoring of the EC2 instances.
///
/// With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.
/// When enabled, you can also get aggregated data across groups of similar instances.
///
/// Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.
/// For more information, see "Paid tier" and "Example 1 - EC2 Detailed Monitoring" here https://aws.amazon.com/cloudwatch/pricing/.
/// </summary>
[Input("enableDetailedMonitoring")]
public Input<bool>? EnableDetailedMonitoring { get; set; }

/// <summary>
/// Encrypt the root block device of the nodes in the node group.
/// </summary>
Expand Down
13 changes: 13 additions & 0 deletions sdk/dotnet/Outputs/ClusterNodeGroupOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ public sealed class ClusterNodeGroupOptions
/// </summary>
public readonly int? DesiredCapacity;
/// <summary>
/// Enables/disables detailed monitoring of the EC2 instances.
///
/// With detailed monitoring, all metrics, including status check metrics, are available in 1-minute intervals.
/// When enabled, you can also get aggregated data across groups of similar instances.
///
/// Note: You are charged per metric that is sent to CloudWatch. You are not charged for data storage.
/// For more information, see "Paid tier" and "Example 1 - EC2 Detailed Monitoring" here https://aws.amazon.com/cloudwatch/pricing/.
/// </summary>
public readonly bool? EnableDetailedMonitoring;
/// <summary>
/// Encrypt the root block device of the nodes in the node group.
/// </summary>
public readonly bool? EncryptRootBlockDevice;
Expand Down Expand Up @@ -181,6 +191,8 @@ public sealed class ClusterNodeGroupOptions

int? desiredCapacity,

bool? enableDetailedMonitoring,

bool? encryptRootBlockDevice,

ImmutableArray<Pulumi.Aws.Ec2.SecurityGroup> extraNodeSecurityGroups,
Expand Down Expand Up @@ -228,6 +240,7 @@ public sealed class ClusterNodeGroupOptions
CloudFormationTags = cloudFormationTags;
ClusterIngressRule = clusterIngressRule;
DesiredCapacity = desiredCapacity;
EnableDetailedMonitoring = enableDetailedMonitoring;
EncryptRootBlockDevice = encryptRootBlockDevice;
ExtraNodeSecurityGroups = extraNodeSecurityGroups;
Gpu = gpu;
Expand Down
16 changes: 16 additions & 0 deletions sdk/go/eks/nodeGroup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions sdk/go/eks/nodeGroupV2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions sdk/go/eks/pulumiTypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a1e2711

Please sign in to comment.