-
Notifications
You must be signed in to change notification settings - Fork 591
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
EKS: Support tagging node group's underlying ASG #2884
EKS: Support tagging node group's underlying ASG #2884
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@richardchen331: This issue is currently awaiting triage. If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Welcome @richardchen331! |
Hi @richardchen331. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
f665373
to
c961a0e
Compare
for k, v := range s.scope.ManagedMachinePool.Spec.AdditionalAsgTags { | ||
// The k/vCopy is used to address the "Implicit memory aliasing in for loop" issue | ||
// https://stackoverflow.com/questions/62446118/implicit-memory-aliasing-in-for-loop | ||
kCopy := k |
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.
Can we index the ranged map as given in the stackoverflow link?
for key := range s.scope.ManagedMachinePool.Spec.AdditionalAsgTags {
key:= key (Can remove it and check if it still throws error)
input.Tags = append(input.Tags, &autoscaling.Tag{
Key: &key,
PropagateAtLaunch: &trueVal,
ResourceId: asg.Name,
ResourceType: &asgType,
Value: & s.scope.ManagedMachinePool.Spec.AdditionalAsgTags[key],
})
}
if _, err := s.AutoscalingClient.CreateOrUpdateTags(input); err != nil {
return errors.Wrap(err, "failed to reconcile AutoScalingGroup tags for nodegroup")
}
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.
I tried to change to this but got error invalid operation: cannot take address of s.scope.ManagedMachinePool.Spec.AdditionalAsgTags[key] (map index expression of type string)
, so I'll keep it as it for now
c961a0e
to
eaf67be
Compare
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
eaf67be
to
df74782
Compare
Updated code to remove unspecified ASG tags as well |
Same issue. I will investigate |
a13a3b7
to
8dba0d2
Compare
e2e tests passed after rebasing the PR. @richardcase do you mind taking a final look at this PR? Thanks! |
/test pull-cluster-api-provider-aws-e2e-eks |
Probable a flake, so: /test pull-cluster-api-provider-aws-e2e-eks |
@richardchen331 - Looking at the CAPA logs for the e2e failure i see:
From the logs it looks like its starting reconciling the ASG tags but then:
The timeout is probably more likely due to this in the logs:
|
I've increased the timeout by 5 mins to see it's purely unfortunate timing or if the extra time reveals any errors. |
/test pull-cluster-api-provider-aws-e2e-eks |
@richardcase Looking at the e2e test log it looks like that:
|
/test pull-cluster-api-provider-aws-e2e-eks |
This is strange as the periodic e2e for EKS are passing every night. I can't see why this change would cause the e2e to fail. I'll run the e2e locally on your branch to see if it highlights anything. |
a88aa63
to
a0616ed
Compare
@richardcase I think I found the culprit... So EKS nodes relies on the "kubernetes.io/cluster/cluster-name:owned" tag in order to join the cluster (https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html#worker-node-fail), however we are incorrectly updating the ASG tags because |
Ah, we've had that issue in other places. Fingers crossed it wired works and the e2e pass. If it didn't I'll run them locally this morning |
/test pull-cluster-api-provider-aws-e2e-eks |
/test pull-cluster-api-provider-aws-e2e-eks |
1 similar comment
/test pull-cluster-api-provider-aws-e2e-eks |
Thats good the eks e2e passed |
/test pull-cluster-api-provider-aws-test |
The tests are passing, i think this is good to go: /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: richardcase The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
There is an open issue on EKS where EKS doesn’t support tagging the underlying ASGs, however it’s quite important for many organizations for compliance, cost. This PR adds such support in CAPA, where user can specify an optional
AdditionalAsgTags
field inAWSManagedMachinePool
and the node group controller will reconcile the underlying ASG tags.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2881
Special notes for your reviewer:
Checklist:
Release note: