Skip to content

EC2 Template ( creation/modify) using EC2 controller. #1841

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

Closed
rkurduka opened this issue Jul 10, 2023 · 11 comments
Closed

EC2 Template ( creation/modify) using EC2 controller. #1841

rkurduka opened this issue Jul 10, 2023 · 11 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. kind/new-resource Categorizes issue or PR as related to a new resource. service/ec2 Indicates issues or PRs that are related to ec2-controller. target/q2-2025 Issues scheduled for Q2 in 2025

Comments

@rkurduka
Copy link

rkurduka commented Jul 10, 2023

Is your feature request related to a problem?

During large scale migration (on-prem to cloud) using AWS MGN (AWS application migration service) , EC2 - Launch template is used to spin up servers across multiple accounts , one of the common problem that we see , is to update/multiple templates across multiple accounts from single source .

https://docs.aws.amazon.com/mgn/latest/ug/ec2-launch.html

Same challenge is with AWS DRS service as well , which is used to perform DR actions on multiple AWS accounts
https://docs.aws.amazon.com/drs/latest/userguide/ec2-launch.html

Describe the solution you'd like
If we able to update/modify 100's of EC2 templates from any kubernetes cluster like Kind, Minikube, EKS , that will really help to speed up the migration process.

Describe alternatives you've considered
Python boto3 is usually common choice to update these templates .

@rkurduka
Copy link
Author

I am working on it

@rkurduka rkurduka changed the title EC2 Template ( creation/modify) using EC2 controller. EC2 Template ( creation/modify) using EC2 controller. Jul 10, 2023
@a-hilaly a-hilaly added service/ec2 Indicates issues or PRs that are related to ec2-controller. kind/feature Categorizes issue or PR as related to a new feature. kind/new-resource Categorizes issue or PR as related to a new resource. labels Jul 11, 2023
@rkurduka
Copy link
Author

Hello All, i am trying to contribute to project by creating ec2- Launchtemplate and Launchtemplateversions as resources , i am able to create/delete Launchtemplates , but while creating Launchtemplateversions , resource keep getting into terminal condition with message - "Resource already exist and To bring the resource under ACK management, you should explicitly adopt the resource by creating a services.k8s.aws/AdoptedResource" , even though original Launchtemplate created by ACK . Also i noticed that "ko" objects values are properly getting assigned in SDKFIND function , and function return resource successfully , but SDKCREATE function never gets called . i am missing something any help will be really helpful

@a-hilaly
Copy link
Member

When controller A creates a resource X, and you subsequentlly delete the cluster, resource X will only exist on AWS and no longer in etcd. If you attempt to recreate resource X in a new cluster, the controller will raise an error because the resource already exists in AWS. To address this, if you want the controller to manage an already existing resource in AWS, you should utilize "AdoptedResource."

As an alternative, you have two options to handle this situation:

  • Use AdoptedResources to integrate the existing resource into the controller's management system effectively.
  • If you no longer require the exsiting resource on AWS and wish the controller to recreate it from scratch, delete the resource from AWS, and then instruct the controller to create the resource for you.

@gecube
Copy link

gecube commented Aug 3, 2023

Hi! Thanks for your efforts. I am also struggling because of absence of InstanceTemplate objects.

@rkurduka
Copy link
Author

rkurduka commented Aug 3, 2023

@gecube @a-hilaly yea , i also see need for it . just putting current progress here on this,

I am able to create launchtemplate and its versions as well and even able to delete resources as well from K8s and AWS , but only problem i see now or i am trying to figure out is how to change default version of launch template as it is not "SPEC" field but "Status" field on launch template . And it is "input" field in "modify launch template" API call.

Once i figure this out maybe i will be ready to raise pull request , will keep you posted ,

here is latest on this , if any one wants to give a try

https://github.com/rkurduka/ec2-controller/tree/ec2-launch-template

@ack-bot
Copy link
Collaborator

ack-bot commented Jan 30, 2024

Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 30, 2024
@a-hilaly a-hilaly removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 30, 2024
@ack-bot
Copy link
Collaborator

ack-bot commented Jul 28, 2024

Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 28, 2024
@gecube
Copy link

gecube commented Jul 29, 2024

/remove-lifecycle stale

@ack-prow ack-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 29, 2024
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 25, 2025

Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 25, 2025
@gecube
Copy link

gecube commented Jan 27, 2025

/remove-lifecycle stale

@ack-prow ack-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2025
@eqe-aws eqe-aws added the q2-205 label Mar 4, 2025
@jlbutler jlbutler added target/q2-2025 Issues scheduled for Q2 in 2025 and removed q2-205 labels Mar 18, 2025
ack-prow bot pushed a commit to aws-controllers-k8s/ec2-controller that referenced this issue Apr 1, 2025
Issue [#1841](aws-controllers-k8s/community#1841)

Description of changes:
Adding support for LaunchTemplate.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@a-hilaly
Copy link
Member

This is now available in recent ec2 controller versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. kind/new-resource Categorizes issue or PR as related to a new resource. service/ec2 Indicates issues or PRs that are related to ec2-controller. target/q2-2025 Issues scheduled for Q2 in 2025
Projects
None yet
Development

No branches or pull requests

6 participants