-
Notifications
You must be signed in to change notification settings - Fork 431
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
feat: respect externally managed annotation on unmanaged MachinePools #2588
feat: respect externally managed annotation on unmanaged MachinePools #2588
Conversation
Hi @mweibel. 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. |
6af0b84
to
46e860c
Compare
#2444 got merged so you should be able to reuse the code from it now if you rebase See also kubernetes-sigs/cluster-api#7107 which is relevant / in progress |
/ok-to-test |
46e860c
to
9b325d8
Compare
yes I saw that, thanks. Once that PR is merged and released, we can adjust CAPZ code to use the const from CAPI. |
959efc4
to
f7ecf82
Compare
I tested using a separate empty commit and the tests ran through. I squashed them together and now there's again a conflict in the e2e test. What can I do about this? |
/retest the failure above looks like a flake |
/cc @jackfrancis |
@mweibel this is an interesting use-case. So the idea is that you might want to use cluster-autoscaler on your cluster, but not leverage the Cluster API provider, and instead use the Azure provider (which updates replicas directly via the Azure VMSS API)? Or are there other use cases you're thinking of? I'm wondering if there's a better, general workflow to indicate this rather than requiring the user to manually add a well-known annotation to the corresponding capi MachinePool resource? |
f7ecf82
to
d8ec3b3
Compare
d8ec3b3
to
d78f9ce
Compare
/lifecyle active |
yes exactly. I contributed the same to CAPA already. The use case we have currently is that the cluster-api autoscaler does not yet have enough functionality to replace the native azure one. Crucial features like taints/labels and separate cool down times etc. are not available yet and will probably not for a little while (especially the taints since that's onlyin a proposal how to manage it in CAPI itself).
I settled for an annotation since there was discussion on CAPA about this (annotations vs. a separate field) and they preferred an annotation. It also kind of fits together with the changes in kubernetes-sigs/cluster-api#7107. |
/milestone v1.7 |
/assign |
/assign @dthorsen |
d78f9ce
to
66a3529
Compare
@mweibel: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
@mweibel this lgtm, I think we need to rebase this PR on top of latest Thanks again for this, let's try to land this before mid-next week so it can be included in the 1.7. release! |
|
||
// HasReplicasExternallyManaged returns true if the externally managed annotation is set on the CAPI MachinePool resource. | ||
func (m *MachinePoolScope) HasReplicasExternallyManaged(ctx context.Context) bool { | ||
return m.MachinePool.Annotations[azure.ReplicasManagedByAutoscalerAnnotation] == "true" |
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.
@jackfrancis do we need a PR to get rid of this CAPZ specific annotation in favor of the CAPI one that you added?
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.
we should even be able to get rid of this function altogether and directly use the ReplicasManagedByExternalAutoscaler()
helper from CAPI in ReconcileReplicas
below
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.
For this PR, yes, replacing that func w/ the CAPI one should work. For AzureManaged, we'll need to incorporate some back-compat w/ the capz annotation (I can do that as a separate PR).
Prow does the rebase when running tests /retest |
as discussed in https://kubernetes.slack.com/archives/CEX9HENG7/p1673034488923059, let's merge this and refactor to use the CAPI helper function in a separate PR: #2993 /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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:
This adds support for marking
MachinePool
resources as externally managed. Similar to #2444 but for unmanaged clusters. It does not rely on a property inAzureMachinePool
since, unlike in AzureManagedMachinePool`, this property does not exist.Special notes for your reviewer:
Please note that this is just a Draft PR in order to get some feedback on the approach. I reused code and methodology from #2444 in the hope that it matches the existing code style.
I did not yet add tests since I just added the code and I'm trying it on a local cluster.
TODOs:
Release note: