Skip to content
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

support metrics collection in scaling config for unmanaged node groups #2055

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

saada
Copy link
Contributor

@saada saada commented Apr 20, 2020

Description

closes #827

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the site/content directory)
  • Manually tested
  • Added labels for change area (e.g. area/nodegroup), target version (e.g. version/0.12.0) and kind (e.g. kind/improvement)
  • Make sure the title of the PR is a good description that can go into the release notes

go.mod Outdated Show resolved Hide resolved
@sayboras
Copy link
Contributor

@saada understand that this is still in draft condition, are you planning to add the mapping between configuration struct to cloudformation for metric collection as well ?

@saada
Copy link
Contributor Author

saada commented Apr 20, 2020

@sayboras , thanks for the feedback! Where can I do the mapping to cloudformation? Which directory?

@sayboras
Copy link
Contributor

@sayboras , thanks for the feedback! Where can I do the mapping to cloudformation? Which directory?

You can find it here https://github.com/weaveworks/eksctl/blob/master/pkg/cfn/builder/nodegroup.go#L263.

I just have a quick look, seems like this feature will be only for un-managed node group. CF for managed nodegroup didn't support metric related attribute yet https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-scalingconfig.html

@saada saada added area/nodegroup kind/feature New feature or request labels Apr 20, 2020
@saada saada changed the title support metrics collection in scaling config support metrics collection in scaling config for unmanaged node groups Apr 20, 2020
Copy link
Contributor

@cPu1 cPu1 left a comment

Choose a reason for hiding this comment

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

I left some comments but otherwise LGTM. Thanks for the PR!

pkg/apis/eksctl.io/v1alpha5/types.go Outdated Show resolved Hide resolved
pkg/apis/eksctl.io/v1alpha5/types.go Outdated Show resolved Hide resolved
@saada saada force-pushed the support-metrics-collection branch from 9631ca4 to 10a8a3b Compare April 20, 2020 16:51
@martina-if
Copy link
Contributor

Can we add some tests for this? :) I think you can probably extend one of the existing tests for this.

@saada saada force-pushed the support-metrics-collection branch from bb44d8a to 933ea47 Compare April 22, 2020 19:56
@saada saada marked this pull request as ready for review April 22, 2020 20:14
@saada saada requested a review from rndstr April 22, 2020 20:43
@saada saada force-pushed the support-metrics-collection branch from 4979d1f to 4626ece Compare April 22, 2020 22:20
@sayboras
Copy link
Contributor

@saada LGTM 💯

@@ -274,6 +274,9 @@ func nodeGroupResource(launchTemplateName *gfn.Value, vpcZoneIdentifier interfac
if ng.MaxSize != nil {
ngProps["MaxSize"] = fmt.Sprintf("%d", *ng.MaxSize)
}
if len(ng.ASGMetricsCollection) > 0 {
ngProps["MetricsCollection"] = ng.ASGMetricsCollection
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we shouldn't couple the API schema of eksctl with the cloudformation template directly. It could happen in the future that the schema is extended or changed to a new version and that would break the backend part of eksctl.

Even though it's verbose I think the right thing to do is to recreate the CFN struct like we do in line 287 with mixedInstancesPolicy()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@martina-if , can you please verify the latest changes?

@saada saada force-pushed the support-metrics-collection branch 5 times, most recently from 183c3ff to 9dd2817 Compare April 27, 2020 18:09
@dholbach
Copy link
Contributor

Once rebased on master, this should pass the link checker again.

@saada
Copy link
Contributor Author

saada commented Apr 28, 2020

Successfully tested this manually with the following config:

---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: mahmoud-cluster-1
  region: eu-west-2

nodeGroups:
  - name: ng-1
    instanceType: t2.medium
    desiredCapacity: 1
    asgMetricsCollection:
      - granularity: 1Minute
        metrics:
          - GroupMinSize
          - GroupMaxSize
          - GroupDesiredCapacity
          - GroupInServiceInstances
          - GroupPendingInstances
          - GroupStandbyInstances
          - GroupTerminatingInstances
          - GroupTotalInstances

add name to humans.txt

reset go.mod

make metrics optional

add cloudformation mapping

regenerate

fix if statement

apply pr review changes

apply pr review changes

WIP

update schema and generated deepcopy

add tests and update docs

cleanup test comments
@saada saada force-pushed the support-metrics-collection branch from 9dd2817 to b099403 Compare April 28, 2020 15:38
@saada
Copy link
Contributor Author

saada commented Apr 28, 2020

Screen Shot 2020-04-28 at 11 45 53 AM

@martina-if martina-if merged commit 960f85e into master Apr 28, 2020
@martina-if martina-if deleted the support-metrics-collection branch April 28, 2020 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nodegroup kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable/disable EC2 auto scaling group metric collection
6 participants