-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(eks): add eks cluster builder #1259
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jay Chen <[email protected]>
} | ||
|
||
func waitForNodeGroupReady(ctx context.Context, eksClient *eks.Client, clusterName, nodeGroupName string) error { | ||
childCtx, cancel := context.WithTimeout(ctx, 10*time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here for wait time and wait tick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for a node group to become ready can take about 5 minutes.
I'll change to 5 seconds here.
|
||
amiId, err := resolveAMI(ctx, ec2Client, cfg.Region, k8sMinorVersion, nodeMachineType, eksctlapi.DefaultNodeImageFamily) | ||
if err != nil { | ||
return errors.Wrap(err, "failed to resolve AMI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we print the Region or cluster name here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cluster name is the environment/cluster-builder name, so it's known by the caller.
Region is loaded from the environment variable as well and I'm open to print this. The concern is, this framework tends to not print anything during a cluster building. I'm not sure whether should I print or how should I log since it looks like we don't have a logging mechanism provided in KTF.
Signed-off-by: Jay Chen <[email protected]>
Signed-off-by: Jay Chen <[email protected]>
Signed-off-by: Jay Chen <[email protected]>
closes #285
Features
This PR provides the following features:
Builder
for creating EKS clusters on AWSCluster
representing the cluster created and provides the functionality of cleaning up the cluster and all underlying resources createdNewFromExisting
helper function to retrieve kubeconfig from an existing clusterAbove features are tested manually and a CI run can be found here:
https://github.com/kumahq/kuma-smoke/actions/runs/12785877388/job/35641958835
Implementation
Unlike
eksctl
which creates the cluster using AWS CloudFormation, this PR creates underlying AWS resources directly using the Golang SDK provided by AWS.The entrypoint for creating a new cluster is the function
eks.aws_operations.CreateEKSClusterAll
The entrypoint for cleaning up a cluster is the function
eks.aws_operations.DeleteEKSClusterAll
Reused the logic of
eksctl
to generateuserdata
for bootstraping the nodes.Limitations
Usage
I'll provide an integration test soon in a new PR.