Skip to content

WIP: feat: add support for EKS service on AWS #472

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zdrapela
Copy link
Member

@zdrapela zdrapela commented Apr 17, 2025

Add support to create AWS EKS clusters, currently without spot instances.
I might need to add support for configuring AWS extensions to allow RHDH deployments for testing.

#357, https://issues.redhat.com/browse/RHIDP-6637

Main content of this PR:

Smaller fixes and improvements

@adrianriobo
Copy link
Collaborator

Beyond code, can you squash your commits?, also consider a message in format as:

feat: Adding support for EKS service on AWS

}
}
// Create a Security Group that we can use to actually connect to our cluster
clusterSg, err := ec2.NewSecurityGroup(ctx, "cluster-sg", &ec2.SecurityGroupArgs{
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use the sg utility in the code to reduce this content:

https://github.com/redhat-developer/mapt/blob/main/pkg/provider/aws/action/fedora/fedora.go#L308

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I incorporated it, but I have issues with the networking and subnets. See the below comment

func (r *EKSRequest) deployer(ctx *pulumi.Context) error {
// Read back the default VPC and public subnets, which we will use.
t := true
vpc, err := ec2.LookupVpc(ctx, &ec2.LookupVpcArgs{Default: &t})
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use https://github.com/redhat-developer/mapt/blob/main/pkg/provider/aws/action/fedora/fedora.go#L192 to create the networking, typically each action create its own stack of networking as that will not increase cost and it will allow to isolate the service

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to use it now, but I encountered an issue where the EKS cluster requires at least two subnets in two availability zones, but the current implementation of networking uses only one. I tried to extend it, but I got stuck on this as it became increasingly complex. I created the network_extended/network_extended.go based on network.go for trying to implement it (because editing network.go kept breaking other things that use it).

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@zdrapela zdrapela May 7, 2025

Choose a reason for hiding this comment

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

With the networking, I figured out that I need to define multiple CIDRs, but now I'm not sure how to attach the subnets to the VPC (error: * updating EKS Cluster (eks-cluster-5370d02) VPC configuration: operation error EKS: UpdateClusterConfig, https response error StatusCode: 400, RequestID: 591ad7dc-961f-46b9-804b-21498734fb05, InvalidRequestException: Subnets specified must belong to the VPC: vpc-03ae06bf486414612 )

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use this one to get 3 Azs..2 Public Subnet...Privates and Intra...if you just need 3 Public or whatever you can use that https://github.com/redhat-developer/mapt/blob/main/pkg/provider/aws/modules/network/standard/standard.go#L46 network request with your expected values...i.e only the PublicSubnet blocks...the create and that should do the trick

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yes, this works great 😄 Thank you! I got it working using that with ease. It should've caught my eye 😓

@zdrapela zdrapela changed the title WIP: feat: add AWS EKS support WIP: feat: Add support for EKS service on AWS May 7, 2025
@zdrapela zdrapela changed the title WIP: feat: Add support for EKS service on AWS WIP: feat: add support for EKS service on AWS May 7, 2025
@zdrapela zdrapela force-pushed the eks-support-1 branch 4 times, most recently from f424b4a to ebf9b89 Compare May 12, 2025 11:07
zdrapela added 2 commits May 12, 2025 15:00
Review - securityGroups

Review - use Network, still only one subnet (required 2+)

Define multiple CIDRs

Remove unused

Use standard networking

az
@zdrapela zdrapela changed the title WIP: feat: add support for EKS service on AWS feat: add support for EKS service on AWS May 12, 2025
@zdrapela
Copy link
Member Author

Hi, I resolved the issues with networking, and I added an option to install AWS Load Balancer Controller (following the AWS docs), as we require this to be installed for RHDH testing.

@zdrapela zdrapela changed the title feat: add support for EKS service on AWS WIP: feat: add support for EKS service on AWS May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants