-
Notifications
You must be signed in to change notification settings - Fork 1
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
S3 user data support for AWSMachinePool
#592
Conversation
@@ -57,20 +59,21 @@ const ( | |||
// ReconcileLaunchTemplate reconciles a launch template and triggers instance refresh conditionally, depending on | |||
// changes. | |||
// | |||
//nolint:gocyclo | |||
//nolint:gocyclo,maintidx | |||
func (s *Service) ReconcileLaunchTemplate( |
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.
The PR contains quite some interface changes, parameter additions, etc. So I'm marking a few of the most important spots where the actual feature is implemented.
Main change number 1
@@ -78,6 +79,10 @@ func (s *Service) ReconcileBucket() error { | |||
return errors.Wrap(err, "ensuring bucket policy") | |||
} | |||
|
|||
if err := s.ensureBucketLifecycleConfiguration(bucketName); err != nil { |
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.
Main change number 2 (including the IAM permission; note how it was already present in our CAPA IAM role)
@@ -161,6 +166,51 @@ func (s *Service) Create(m *scope.MachineScope, data []byte) (string, error) { | |||
return objectURL.String(), nil | |||
} | |||
|
|||
func (s *Service) CreateForMachinePool(scope scope.LaunchTemplateScope, data []byte) (string, error) { |
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.
Main change number 3
* Add Giant Swarm fork modifications * Push to Azure registry * aws-cni-deleted-helm-managed-resources * import-order * Filter CNI subnets when creating EKS NodeGroup * add godoc * 🐛 Create a `aws.Config` with region to be able to work different AWS partition (like gov cloud or china AWS partition) (#588) * create-aws-client-with-region * 🐛 Add ID to secondary subnets (#589) * give name to secondary subnets * make linter happy * Add non root volumes to AWSMachineTemplate * Support adding custom secondary VPC CIDR blocks in `AWSCluster` (backport) (#590) * S3 user data support for `AWSMachinePool` (#592) * Delete machine pool user data files that did not get deleted yet by the lifecycle policy (#593) * Delete machine pool user data files that did not get deleted yet by the lifecycle policy * Use paging for S3 results * Log S3 list operation * Handle NotFound * Remove duplicated argument * Add `make test` to Circle CI build, S3 test fixes (#596) * Cancel instance refresh on any relevant change to ASG instead of blocking until previous one is finished (which may have led to failing nodes due to outdated join token) (#598) * Use feature gate for S3 storage (#599) * Fixes after cherry-pick our customizations --------- Co-authored-by: Andreas Sommer <andreas@giantswarm.io> Co-authored-by: calvix <vaclav@giantswarm.io> Co-authored-by: Mario Nitchev <marionitchev@gmail.com> Co-authored-by: calvix <rozsypalek.vaclav@gmail.com>
* Add Giant Swarm fork modifications * aws-cni-deleted-helm-managed-resources * Filter CNI subnets when creating EKS NodeGroup * Add non root volumes to AWSMachineTemplate * Support adding custom secondary VPC CIDR blocks in `AWSCluster` (backport) (#590) * S3 user data support for `AWSMachinePool` (#592) * Add GS workflow action --------- Co-authored-by: Andreas Sommer <andreas@giantswarm.io> Co-authored-by: calvix <vaclav@giantswarm.io> Co-authored-by: Mario Nitchev <marionitchev@gmail.com>
Towards giantswarm/roadmap#3442
Upstream CAPA supports putting EC2 user data into S3 buckets, but only for single
AWSMachine
s, as we use for the control plane. For machine pools, it's more complicated. Since we're exceeding the user data size limit of AWS, I implemented this feature.Tested: