Skip to content

Conversation

@AndiDog
Copy link

@AndiDog AndiDog commented Jun 5, 2024

Towards giantswarm/roadmap#3442

Upstream CAPA supports putting EC2 user data into S3 buckets, but only for single AWSMachines, 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:

  • Cluster creation
  • Regular addition of launch template version with latest bootstrap join token
  • Cluster upgrade to cluster-aws with changed bootstrap config – nodes roll out correctly, no reconciliation death loop observed

@AndiDog AndiDog requested a review from a team June 5, 2024 22:05
//
//nolint:gocyclo
//nolint:gocyclo,maintidx
func (s *Service) ReconcileLaunchTemplate(
Copy link
Author

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

return errors.Wrap(err, "ensuring bucket policy")
}

if err := s.ensureBucketLifecycleConfiguration(bucketName); err != nil {
Copy link
Author

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)

return objectURL.String(), nil
}

func (s *Service) CreateForMachinePool(scope scope.LaunchTemplateScope, data []byte) (string, error) {
Copy link
Author

Choose a reason for hiding this comment

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

Main change number 3

@AndiDog AndiDog merged commit 0bcf5b8 into release-2.3 Jun 6, 2024
fiunchinho pushed a commit that referenced this pull request Jul 1, 2024
fiunchinho added a commit that referenced this pull request Jul 4, 2024
* 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 <[email protected]>
Co-authored-by: calvix <[email protected]>
Co-authored-by: Mario Nitchev <[email protected]>
Co-authored-by: calvix <[email protected]>
fiunchinho pushed a commit that referenced this pull request Aug 21, 2024
fiunchinho pushed a commit that referenced this pull request Aug 27, 2024
fiunchinho added a commit that referenced this pull request Sep 9, 2024
* 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 <[email protected]>
Co-authored-by: calvix <[email protected]>
Co-authored-by: Mario Nitchev <[email protected]>
AndiDog added a commit that referenced this pull request Nov 11, 2024
AndiDog added a commit that referenced this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants