-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support EKS managed nodegroup node repair config (#8087)
- Loading branch information
1 parent
39899b0
commit 3a96038
Showing
16 changed files
with
349 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# An example ClusterConfig that uses a managed node group with auto repair. | ||
|
||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
|
||
metadata: | ||
name: cluster-44 | ||
region: us-west-2 | ||
|
||
managedNodeGroups: | ||
- name: ng-1 | ||
nodeRepairConfig: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
goformation/cloudformation/eks/aws-eks-nodegroup_noderepairconfig.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package eks | ||
|
||
import ( | ||
"goformation/v4/cloudformation/types" | ||
|
||
"goformation/v4/cloudformation/policies" | ||
) | ||
|
||
// Nodegroup_NodeRepairConfig AWS CloudFormation Resource (AWS::EKS::Nodegroup.NodeRepairConfig) | ||
type Nodegroup_NodeRepairConfig struct { | ||
Enabled *types.Value `json:"Enabled,omitempty"` | ||
|
||
// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy | ||
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"` | ||
|
||
// AWSCloudFormationUpdateReplacePolicy represents a CloudFormation UpdateReplacePolicy | ||
AWSCloudFormationUpdateReplacePolicy policies.UpdateReplacePolicy `json:"-"` | ||
|
||
// AWSCloudFormationDependsOn stores the logical ID of the resources to be created before this resource | ||
AWSCloudFormationDependsOn []string `json:"-"` | ||
|
||
// AWSCloudFormationMetadata stores structured data associated with this resource | ||
AWSCloudFormationMetadata map[string]interface{} `json:"-"` | ||
|
||
// AWSCloudFormationCondition stores the logical ID of the condition that must be satisfied for this resource to be created | ||
AWSCloudFormationCondition string `json:"-"` | ||
} | ||
|
||
// AWSCloudFormationType returns the AWS CloudFormation resource type | ||
func (r *Nodegroup_NodeRepairConfig) AWSCloudFormationType() string { | ||
return "AWS::EKS::Nodegroup.NodeRepairConfig" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
176 changes: 176 additions & 0 deletions
176
pkg/cfn/builder/testdata/launch_template/node-repair-enabled.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
{ | ||
"LaunchTemplate": { | ||
"Type": "AWS::EC2::LaunchTemplate", | ||
"Properties": { | ||
"LaunchTemplateData": { | ||
"BlockDeviceMappings": [ | ||
{ | ||
"DeviceName": "/dev/xvda", | ||
"Ebs": { | ||
"Iops": 3000, | ||
"Throughput": 125, | ||
"VolumeSize": 80, | ||
"VolumeType": "gp3" | ||
} | ||
} | ||
], | ||
"MetadataOptions": { | ||
"HttpPutResponseHopLimit": 2, | ||
"HttpTokens": "required" | ||
}, | ||
"SecurityGroupIds": [ | ||
{ | ||
"Fn::ImportValue": "eksctl-lt::ClusterSecurityGroupId" | ||
} | ||
], | ||
"TagSpecifications": [ | ||
{ | ||
"ResourceType": "instance", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "lt-node-repair-enabled-Node" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-name", | ||
"Value": "node-repair-enabled" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-type", | ||
"Value": "managed" | ||
} | ||
] | ||
}, | ||
{ | ||
"ResourceType": "volume", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "lt-node-repair-enabled-Node" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-name", | ||
"Value": "node-repair-enabled" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-type", | ||
"Value": "managed" | ||
} | ||
] | ||
}, | ||
{ | ||
"ResourceType": "network-interface", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "lt-node-repair-enabled-Node" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-name", | ||
"Value": "node-repair-enabled" | ||
}, | ||
{ | ||
"Key": "alpha.eksctl.io/nodegroup-type", | ||
"Value": "managed" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"LaunchTemplateName": { | ||
"Fn::Sub": "${AWS::StackName}" | ||
} | ||
} | ||
}, | ||
"ManagedNodeGroup": { | ||
"Type": "AWS::EKS::Nodegroup", | ||
"Properties": { | ||
"AmiType": "AL2023_x86_64_STANDARD", | ||
"ClusterName": "lt", | ||
"Labels": { | ||
"alpha.eksctl.io/cluster-name": "lt", | ||
"alpha.eksctl.io/nodegroup-name": "node-repair-enabled" | ||
}, | ||
"InstanceTypes": ["m5.xlarge"], | ||
"NodeRole": { | ||
"Fn::GetAtt": [ | ||
"NodeInstanceRole", | ||
"Arn" | ||
] | ||
}, | ||
"NodegroupName": "node-repair-enabled", | ||
"ScalingConfig": { | ||
"DesiredSize": 2, | ||
"MaxSize": 2, | ||
"MinSize": 2 | ||
}, | ||
"Subnets": [ | ||
"subnet-public-us-west-2a" | ||
], | ||
"Tags": { | ||
"alpha.eksctl.io/nodegroup-name": "node-repair-enabled", | ||
"alpha.eksctl.io/nodegroup-type": "managed" | ||
}, | ||
"LaunchTemplate": { | ||
"Id": { | ||
"Ref": "LaunchTemplate" | ||
} | ||
}, | ||
"NodeRepairConfig": { | ||
"Enabled": true | ||
} | ||
} | ||
}, | ||
"NodeInstanceRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
{ | ||
"Fn::FindInMap": [ | ||
"ServicePrincipalPartitionMap", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
"EC2" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" | ||
}, | ||
{ | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEKSWorkerNodePolicy" | ||
}, | ||
{ | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEKS_CNI_Policy" | ||
}, | ||
{ | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonSSMManagedInstanceCore" | ||
} | ||
], | ||
"Path": "/", | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": { | ||
"Fn::Sub": "${AWS::StackName}/NodeInstanceRole" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.