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

ASOAPI: propagate machinepool values to ManagedClustersAgentPools #4798

Merged
merged 2 commits into from
May 2, 2024

Conversation

nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented May 2, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:

This PR uses the ASOAPI mutator framework to set the Kubernetes version and replica count for ASO agent pools based on its owning MachinePool. It also includes handling for autoscaling AKS node pools.

The first commit in this PR is the same as what's queued up to merge in #4794. It should disappear from this PR automatically once that other PR merges. I'm electing to create this PR now to open up these new changes for feedback in the meantime.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #4713

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 2, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 2, 2024

/hold for #4794

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels May 2, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 2, 2024

/milestone v1.15

@k8s-ci-robot k8s-ci-robot added this to the v1.15 milestone May 2, 2024
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 78.02198% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 62.73%. Comparing base (daf5081) to head (368425e).

Files Patch % Lines
exp/mutators/azureasomanagedmachinepool.go 81.81% 7 Missing and 7 partials ⚠️
exp/mutators/azureasomanagedcontrolplane.go 50.00% 3 Missing and 2 partials ⚠️
...ntrollers/azureasomanagedmachinepool_controller.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4798      +/-   ##
==========================================
+ Coverage   62.66%   62.73%   +0.06%     
==========================================
  Files         198      199       +1     
  Lines       16420    16507      +87     
==========================================
+ Hits        10290    10356      +66     
- Misses       5369     5381      +12     
- Partials      761      770       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

} else if replicaManager != infrav1exp.ReplicasManagedByAKS {
return fmt.Errorf("failed to enable autoscaling, replicas are already being managed by %s according to MachinePool %s's %s annotation", replicaManager, machinePool.Name, clusterv1.ReplicasManagedByAnnotation)
}
} else if !autoscaling && replicaManager == infrav1exp.ReplicasManagedByAKS {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment here to indicate that this implements the required reconciliation logic to enable mutating from "node pool is autoscaler-enabled" to "node pool is not autoscaler-enabled"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I exactly get what you mean, but I took a stab here.

Copy link
Contributor

Choose a reason for hiding this comment

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

ya this works

@jackfrancis
Copy link
Contributor

this lgtm w/ some minor comments

@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 2, 2024

/hold only for squash now that #4794 has merged.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 2, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 2, 2024

The first commit in this PR is the same as what's queued up to merge in #4794. It should disappear from this PR automatically once that other PR merges.

It wasn't automatic, but merging main seemed to work so those old changes don't appear in the diff anymore.

Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 2, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1599f67ed609ef80db50dbf0f9e1a8ad53b3baca

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2024
@nojnhuh nojnhuh force-pushed the v2-machinepools branch from 28d912d to 368425e Compare May 2, 2024 20:48
@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 2, 2024

squashed! (to the original two commits)
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 2, 2024
@nojnhuh nojnhuh mentioned this pull request May 2, 2024
4 tasks
@k8s-ci-robot k8s-ci-robot merged commit 39189af into kubernetes-sigs:main May 2, 2024
23 of 27 checks passed
@nojnhuh nojnhuh deleted the v2-machinepools branch May 2, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants