-
Notifications
You must be signed in to change notification settings - Fork 430
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
migrate natgateways to use aso #4059
Conversation
Skipping CI for Draft Pull Request. |
395fa88
to
da61e42
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4059 +/- ##
==========================================
+ Coverage 57.63% 57.84% +0.21%
==========================================
Files 188 187 -1
Lines 19202 19069 -133
==========================================
- Hits 11067 11031 -36
+ Misses 7505 7414 -91
+ Partials 630 624 -6
☔ View full report in Codecov by Sentry. |
592a613
to
cee8b8d
Compare
bc1ef69
to
d76bf75
Compare
7131b5f
to
1591fe8
Compare
Squashing all and running a test locally. |
1591fe8
to
9540f48
Compare
d3bad65
to
5eb3a9a
Compare
26f1f0d
to
176ba9f
Compare
Adding my two cents. But allowing to |
I think it should read "can be modified durably by users out-of-band with kubectl", right? That's neither a feature nor a bug, but a practical architectural decision until we protect those ASO resources behind something like a serviceaccount. |
In addition to what Jack said and Cross-posting the summary from a discussion we had async, below are some more observations made:
|
Need to make changes to allow a user to set fields out-of-band. |
76ac62d
to
53da702
Compare
/unhold |
I mean even today by modifying the Azure resources with I guess my main question here is in @nawazkh's scenario of a NAT gateway managed by CAPZ without |
Could you please expand on this part specifically? Why is ASO overwriting changes made outside of CAPZ/Azure more than the CAPZ reconciler was before?
Is CAPZ defaulting the field? Is it because the field required?
IMO behavior should be the same (if CAPZ is hardcoding and overwriting a field already it would overwrite portal changes today, ASO should not change that behavior). If CAPZ is not overwriting changes from the portal, then it should not overwrite changes from ASO either. |
Several resources types created by CAPZ are never modified by CAPZ after they are created, e.g. bastionhosts: cluster-api-provider-azure/azure/services/bastionhosts/spec.go Lines 67 to 73 in 1a70b01
Currently, users are free to change any parameters with
I think CAPZ essentially has no knowledge of the field in this case. If CAPZ reconstructs the entire
That makes sense to me as long as we accept that changes from the portal that do not get overwritten today may then eventually get overwritten by ASO. I don't think there's a good way around that. |
I thought the patch helper would handle this and only patch the changed values? CAPI patch helper uses the |
It looks like it does not based on a quick test I ran. |
To add more clarity, there are two types of scenarios in discussion here.
The current implementation that I have put in for NAT Gateway spec supports scenario 2. Refer: https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4059/files?diff=split#diff-8592ed50d123a48d0e32068cf51a94a4b6d57588b0526d982c1c4f2723be085cR56-R59 |
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.
/lgtm
LGTM label has been added. Git tree hash: 9cdc983e76b352eb418e098e13e20afd0ae42ac7
|
@@ -158,7 +158,7 @@ WEBHOOK_ROOT ?= $(MANIFEST_ROOT)/webhook | |||
RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac | |||
ASO_CRDS_PATH := $(MANIFEST_ROOT)/aso/crds.yaml | |||
ASO_VERSION := v2.3.0 | |||
ASO_CRDS := resourcegroups.resources.azure.com | |||
ASO_CRDS := resourcegroups.resources.azure.com natgateways.network.azure.com |
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.
@nojnhuh is this list going to keep growing everytime we add a new CRD? would it make sense to track it in some other way once the list ends up being more than a few?
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.
Yes, this will eventually get unwieldy here. Didn't get around to finding a better mechanism yet.
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.
not blocking for this PR, we can circle back once the list gets big enough
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.
/lgtm
great to see all that deleted code and added tests!
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nojnhuh 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:
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 #4040
Special notes for your reviewer:
TODOs:
Release note: